You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-08 14:22:09 +03:00
MCOL-104 First pass of InfiniDB rename in code
This commit is contained in:
@@ -269,28 +269,28 @@ const CalpontSystemCatalog::TableName make_table(const string& s, const string&
|
||||
return tn;
|
||||
}
|
||||
|
||||
const CalpontSystemCatalog::TableAliasName make_aliastable(const string& s, const string& t, const string& a, const bool isInfiniDB)
|
||||
const CalpontSystemCatalog::TableAliasName make_aliastable(const string& s, const string& t, const string& a, const bool isColumnStore)
|
||||
{
|
||||
CalpontSystemCatalog::TableAliasName tn;
|
||||
tn.schema = s;
|
||||
tn.table = t;
|
||||
tn.alias = a;
|
||||
tn.view = "";
|
||||
tn.fIsInfiniDB = isInfiniDB;
|
||||
tn.fisColumnStore = isColumnStore;
|
||||
transform (tn.schema.begin(), tn.schema.end(), tn.schema.begin(), to_lower());
|
||||
transform (tn.table.begin(), tn.table.end(), tn.table.begin(), to_lower());
|
||||
transform (tn.alias.begin(), tn.alias.end(), tn.alias.begin(), to_lower());
|
||||
return tn;
|
||||
}
|
||||
|
||||
const CalpontSystemCatalog::TableAliasName make_aliasview(const string& s, const string& t, const string& a, const string& v, const bool isInfiniDB)
|
||||
const CalpontSystemCatalog::TableAliasName make_aliasview(const string& s, const string& t, const string& a, const string& v, const bool isColumnStore)
|
||||
{
|
||||
CalpontSystemCatalog::TableAliasName tn;
|
||||
tn.schema = s;
|
||||
tn.table = t;
|
||||
tn.alias = a;
|
||||
tn.view = v;
|
||||
tn.fIsInfiniDB = isInfiniDB;
|
||||
tn.fisColumnStore = isColumnStore;
|
||||
transform (tn.schema.begin(), tn.schema.end(), tn.schema.begin(), to_lower());
|
||||
transform (tn.table.begin(), tn.table.end(), tn.table.begin(), to_lower());
|
||||
transform (tn.alias.begin(), tn.alias.end(), tn.alias.begin(), to_lower());
|
||||
@@ -380,7 +380,7 @@ bool CalpontSystemCatalog::TableAliasName::operator<(const TableAliasName& rhs)
|
||||
}
|
||||
else if (view == rhs.view)
|
||||
{
|
||||
if (fIsInfiniDB < rhs.fIsInfiniDB)
|
||||
if (fisColumnStore < rhs.fisColumnStore)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -396,7 +396,7 @@ void CalpontSystemCatalog::TableAliasName::serialize(messageqcpp::ByteStream& b)
|
||||
b << table;
|
||||
b << alias;
|
||||
b << view;
|
||||
b << static_cast<const ByteStream::doublebyte>(fIsInfiniDB);
|
||||
b << static_cast<const ByteStream::doublebyte>(fisColumnStore);
|
||||
}
|
||||
|
||||
void CalpontSystemCatalog::TableAliasName::unserialize(messageqcpp::ByteStream& b)
|
||||
@@ -405,7 +405,7 @@ void CalpontSystemCatalog::TableAliasName::unserialize(messageqcpp::ByteStream&
|
||||
b >> table;
|
||||
b >> alias;
|
||||
b >> view;
|
||||
b >> reinterpret_cast< ByteStream::doublebyte&>(fIsInfiniDB);
|
||||
b >> reinterpret_cast< ByteStream::doublebyte&>(fisColumnStore);
|
||||
}
|
||||
|
||||
/*static*/
|
||||
@@ -5649,7 +5649,7 @@ const string CalpontSystemCatalog::TableName::toString() const
|
||||
ostream& operator<<(ostream& os, const CalpontSystemCatalog::TableAliasName& rhs)
|
||||
{
|
||||
os << rhs.schema << '.' << rhs.table << "(" << rhs.alias << "/" << rhs.view
|
||||
<< ") engineType=" << (rhs.fIsInfiniDB ? "ColumnStore" : "ForeignEngine");
|
||||
<< ") engineType=" << (rhs.fisColumnStore ? "ColumnStore" : "ForeignEngine");
|
||||
return os;
|
||||
}
|
||||
|
||||
|
@@ -429,16 +429,16 @@ public:
|
||||
*/
|
||||
struct TableAliasName
|
||||
{
|
||||
TableAliasName (): fIsInfiniDB (true) {}
|
||||
TableAliasName (): fisColumnStore (true) {}
|
||||
TableAliasName (std::string sch, std::string tb, std::string al) :
|
||||
schema (sch), table (tb), alias (al), fIsInfiniDB(true) {}
|
||||
schema (sch), table (tb), alias (al), fisColumnStore(true) {}
|
||||
TableAliasName (std::string sch, std::string tb, std::string al, std::string v) :
|
||||
schema (sch), table (tb), alias (al), view(v), fIsInfiniDB(true) {}
|
||||
schema (sch), table (tb), alias (al), view(v), fisColumnStore(true) {}
|
||||
std::string schema;
|
||||
std::string table;
|
||||
std::string alias;
|
||||
std::string view;
|
||||
bool fIsInfiniDB;
|
||||
bool fisColumnStore;
|
||||
void clear();
|
||||
bool operator<(const TableAliasName& rhs) const;
|
||||
bool operator>=(const TableAliasName& rhs) const
|
||||
@@ -451,7 +451,7 @@ public:
|
||||
table == rhs.table &&
|
||||
alias == rhs.alias &&
|
||||
view == rhs.view &&
|
||||
fIsInfiniDB == rhs.fIsInfiniDB);
|
||||
fisColumnStore == rhs.fisColumnStore);
|
||||
}
|
||||
bool operator!=(const TableAliasName& rhs) const
|
||||
{
|
||||
@@ -962,8 +962,8 @@ const CalpontSystemCatalog::TableColName make_tcn(const std::string& s, const st
|
||||
*/
|
||||
const CalpontSystemCatalog::TableName make_table(const std::string& s, const std::string& t);
|
||||
const CalpontSystemCatalog::TableAliasName make_aliastable(const std::string& s, const std::string& t, const std::string& a,
|
||||
const bool fIsInfiniDB = true);
|
||||
const CalpontSystemCatalog::TableAliasName make_aliasview(const std::string& s, const std::string& t, const std::string& a, const std::string& v, const bool fIsInfiniDB = true);
|
||||
const bool fisColumnStore = true);
|
||||
const CalpontSystemCatalog::TableAliasName make_aliasview(const std::string& s, const std::string& t, const std::string& a, const std::string& v, const bool fisColumnStore = true);
|
||||
|
||||
/** convenience function to determine if column type is a char
|
||||
* type
|
||||
|
@@ -72,10 +72,10 @@ PseudoColumn::PseudoColumn(const string& schemaName,
|
||||
PseudoColumn::PseudoColumn(const string& schemaName,
|
||||
const string& tableName,
|
||||
const string& columnName,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t pseudoType,
|
||||
const uint32_t sessionID):
|
||||
SimpleColumn(schemaName, tableName, columnName, isInfiniDB, sessionID),
|
||||
SimpleColumn(schemaName, tableName, columnName, isColumnStore, sessionID),
|
||||
fPseudoType(pseudoType)
|
||||
{
|
||||
adjustResultType();
|
||||
@@ -122,7 +122,7 @@ PseudoColumn& PseudoColumn::operator=(const PseudoColumn& rhs)
|
||||
fData = rhs.data();
|
||||
fSequence = rhs.sequence();
|
||||
fDistinct = rhs.distinct();
|
||||
fIsInfiniDB = rhs.isInfiniDB();
|
||||
fisColumnStore = rhs.isColumnStore();
|
||||
fPseudoType = rhs.pseudoType();
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ const string PseudoColumn::toString() const
|
||||
<< cardinality() << '/'
|
||||
<< joinInfo() << '/'
|
||||
<< colSource() << '/'
|
||||
<< (isInfiniDB() ? "ColumnStore" : "ForeignEngine") << endl;
|
||||
<< (isColumnStore() ? "ColumnStore" : "ForeignEngine") << endl;
|
||||
|
||||
output << "Pseudotype=" << fPseudoType << endl;
|
||||
return output.str();
|
||||
|
@@ -78,7 +78,7 @@ public:
|
||||
PseudoColumn(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t pseudoType,
|
||||
const uint32_t sessionID = 0);
|
||||
PseudoColumn(const SimpleColumn& rhs, const uint32_t pseudoType, const uint32_t sessionID = 0);
|
||||
|
@@ -139,7 +139,7 @@ ParseTree* replaceRefCol(ParseTree*& n, CalpontSelectExecutionPlan::ReturnedColu
|
||||
SimpleColumn::SimpleColumn():
|
||||
ReturnedColumn(),
|
||||
fOid (0),
|
||||
fIsInfiniDB (true)
|
||||
fisColumnStore (true)
|
||||
{
|
||||
fDistinct = false;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ SimpleColumn::SimpleColumn(const string& token, const uint32_t sessionID):
|
||||
ReturnedColumn(sessionID),
|
||||
fOid (0),
|
||||
fData(token),
|
||||
fIsInfiniDB (true)
|
||||
fisColumnStore (true)
|
||||
{
|
||||
parse (token);
|
||||
setOID();
|
||||
@@ -163,7 +163,7 @@ SimpleColumn::SimpleColumn(const string& schemaName,
|
||||
fSchemaName (schemaName),
|
||||
fTableName (tableName),
|
||||
fColumnName (columnName),
|
||||
fIsInfiniDB (true)
|
||||
fisColumnStore (true)
|
||||
{
|
||||
setOID();
|
||||
fDistinct = false;
|
||||
@@ -172,15 +172,15 @@ SimpleColumn::SimpleColumn(const string& schemaName,
|
||||
SimpleColumn::SimpleColumn(const string& schemaName,
|
||||
const string& tableName,
|
||||
const string& columnName,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID):
|
||||
ReturnedColumn(sessionID),
|
||||
fSchemaName (schemaName),
|
||||
fTableName (tableName),
|
||||
fColumnName (columnName),
|
||||
fIsInfiniDB (isInfiniDB)
|
||||
fisColumnStore (isColumnStore)
|
||||
{
|
||||
if (isInfiniDB)
|
||||
if (isColumnStore)
|
||||
setOID();
|
||||
|
||||
fDistinct = false;
|
||||
@@ -197,7 +197,7 @@ SimpleColumn::SimpleColumn (const SimpleColumn& rhs, const uint32_t sessionID):
|
||||
fIndexName (rhs.indexName()),
|
||||
fViewName (rhs.viewName()),
|
||||
fTimeZone (rhs.timeZone()),
|
||||
fIsInfiniDB (rhs.isInfiniDB())
|
||||
fisColumnStore (rhs.isColumnStore())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ SimpleColumn& SimpleColumn::operator=(const SimpleColumn& rhs)
|
||||
fData = rhs.data();
|
||||
fSequence = rhs.sequence();
|
||||
fDistinct = rhs.distinct();
|
||||
fIsInfiniDB = rhs.isInfiniDB();
|
||||
fisColumnStore = rhs.isColumnStore();
|
||||
}
|
||||
|
||||
return *this;
|
||||
@@ -264,7 +264,7 @@ const string SimpleColumn::toString() const
|
||||
<< cardinality() << '/'
|
||||
<< joinInfo() << '/'
|
||||
<< colSource() << '/'
|
||||
<< (isInfiniDB() ? "ColumnStore" : "ForeignEngine") << '/'
|
||||
<< (isColumnStore() ? "ColumnStore" : "ForeignEngine") << '/'
|
||||
<< colPosition() << endl;
|
||||
|
||||
return output.str();
|
||||
@@ -352,7 +352,7 @@ void SimpleColumn::serialize(messageqcpp::ByteStream& b) const
|
||||
b << fData;
|
||||
b << fTableAlias;
|
||||
b << (uint32_t) fSequence;
|
||||
b << static_cast<const ByteStream::doublebyte>(fIsInfiniDB);
|
||||
b << static_cast<const ByteStream::doublebyte>(fisColumnStore);
|
||||
}
|
||||
|
||||
void SimpleColumn::unserialize(messageqcpp::ByteStream& b)
|
||||
@@ -369,7 +369,7 @@ void SimpleColumn::unserialize(messageqcpp::ByteStream& b)
|
||||
b >> fData;
|
||||
b >> fTableAlias;
|
||||
b >> (uint32_t&) fSequence;
|
||||
b >> reinterpret_cast< ByteStream::doublebyte&>(fIsInfiniDB);
|
||||
b >> reinterpret_cast< ByteStream::doublebyte&>(fisColumnStore);
|
||||
}
|
||||
|
||||
bool SimpleColumn::operator==(const SimpleColumn& t) const
|
||||
@@ -412,7 +412,7 @@ bool SimpleColumn::operator==(const SimpleColumn& t) const
|
||||
if (fReturnAll != t.fReturnAll)
|
||||
return false;
|
||||
|
||||
if (fIsInfiniDB != t.fIsInfiniDB)
|
||||
if (fisColumnStore != t.fisColumnStore)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -452,7 +452,7 @@ bool SimpleColumn::sameColumn(const ReturnedColumn* rc) const
|
||||
fColumnName.compare(sc->columnName()) == 0 &&
|
||||
fTableAlias.compare(sc->tableAlias()) == 0 &&
|
||||
fViewName.compare(sc->viewName()) == 0 &&
|
||||
fIsInfiniDB == sc->isInfiniDB());
|
||||
fisColumnStore == sc->isColumnStore());
|
||||
}
|
||||
|
||||
void SimpleColumn::setDerivedTable()
|
||||
|
@@ -70,7 +70,7 @@ public:
|
||||
SimpleColumn(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID = 0);
|
||||
SimpleColumn(const SimpleColumn& rhs, const uint32_t sessionID = 0);
|
||||
|
||||
@@ -160,13 +160,13 @@ public:
|
||||
{
|
||||
fTimeZone = timeZone;
|
||||
}
|
||||
inline const bool isInfiniDB() const
|
||||
inline const bool isColumnStore() const
|
||||
{
|
||||
return fIsInfiniDB;
|
||||
return fisColumnStore;
|
||||
}
|
||||
inline void isInfiniDB(const bool isInfiniDB)
|
||||
inline void isColumnStore(const bool isColumnStore)
|
||||
{
|
||||
fIsInfiniDB = isInfiniDB;
|
||||
fisColumnStore = isColumnStore;
|
||||
}
|
||||
|
||||
/** return a copy of this pointer
|
||||
@@ -261,7 +261,7 @@ protected:
|
||||
// if belong to view, view name is non-empty
|
||||
std::string fViewName;
|
||||
std::string fTimeZone;
|
||||
bool fIsInfiniDB;
|
||||
bool fisColumnStore;
|
||||
|
||||
/** @brief parse SimpleColumn text
|
||||
*
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
SimpleColumn_Decimal(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID = 0);
|
||||
SimpleColumn_Decimal(const SimpleColumn& rhs, const uint32_t sessionID = 0);
|
||||
|
||||
@@ -107,9 +107,9 @@ template<int len>
|
||||
SimpleColumn_Decimal<len>::SimpleColumn_Decimal(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID) :
|
||||
SimpleColumn(schema, table, col, isInfiniDB, sessionID)
|
||||
SimpleColumn(schema, table, col, isColumnStore, sessionID)
|
||||
{
|
||||
setNullVal();
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
SimpleColumn_INT(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID = 0);
|
||||
SimpleColumn_INT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
|
||||
|
||||
@@ -106,9 +106,9 @@ template<int len>
|
||||
SimpleColumn_INT<len>::SimpleColumn_INT(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID) :
|
||||
SimpleColumn(schema, table, col, isInfiniDB, sessionID)
|
||||
SimpleColumn(schema, table, col, isColumnStore, sessionID)
|
||||
{
|
||||
setNullVal();
|
||||
}
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
SimpleColumn_UINT(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID = 0);
|
||||
SimpleColumn_UINT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
|
||||
|
||||
@@ -106,9 +106,9 @@ template<int len>
|
||||
SimpleColumn_UINT<len>::SimpleColumn_UINT(const std::string& schema,
|
||||
const std::string& table,
|
||||
const std::string& col,
|
||||
const bool isInfiniDB,
|
||||
const bool isColumnStore,
|
||||
const uint32_t sessionID) :
|
||||
SimpleColumn(schema, table, col, isInfiniDB, sessionID)
|
||||
SimpleColumn(schema, table, col, isColumnStore, sessionID)
|
||||
{
|
||||
setNullVal();
|
||||
}
|
||||
|
@@ -387,7 +387,7 @@ void ExpressionStep::populateColumnInfo(SimpleColumn* sc, JobInfo& jobInfo)
|
||||
sc->oid(tblOid + 1 + sc->colPosition());
|
||||
ct = sc->resultType();
|
||||
}
|
||||
else if (sc->isInfiniDB() == false)
|
||||
else if (sc->isColumnStore() == false)
|
||||
{
|
||||
ct = sc->colType();
|
||||
}
|
||||
@@ -515,7 +515,7 @@ void ExpressionStep::updateInputIndex(map<uint32_t, uint32_t>& indexMap, const J
|
||||
{
|
||||
ct = sc->resultType();
|
||||
}
|
||||
else if (sc->isInfiniDB() == false)
|
||||
else if (sc->isColumnStore() == false)
|
||||
{
|
||||
ct = sc->colType();
|
||||
}
|
||||
|
@@ -378,7 +378,7 @@ CalpontSystemCatalog::OID tableOid(const SimpleColumn* sc, boost::shared_ptr<Cal
|
||||
if (sc->schemaName().empty())
|
||||
return execplan::CNX_VTABLE_ID;
|
||||
|
||||
if (sc->isInfiniDB() == false)
|
||||
if (sc->isColumnStore() == false)
|
||||
return 0;
|
||||
|
||||
CalpontSystemCatalog::ROPair p = cat->tableRID(make_table(sc->schemaName(),
|
||||
@@ -395,7 +395,7 @@ uint32_t getTupleKey(const JobInfo& jobInfo,
|
||||
return getTupleKey_(jobInfo, sc->oid(), sc->columnName(), extractTableAlias(sc),
|
||||
sc->schemaName(), sc->viewName(),
|
||||
((sc->joinInfo() & execplan::JOIN_CORRELATED) != 0),
|
||||
pseudoType, (sc->isInfiniDB() ? 0 : 1));
|
||||
pseudoType, (sc->isColumnStore() ? 0 : 1));
|
||||
}
|
||||
|
||||
|
||||
@@ -503,7 +503,7 @@ uint32_t makeTableKey(JobInfo& jobInfo, const execplan::SimpleColumn* sc)
|
||||
{
|
||||
CalpontSystemCatalog::OID o = tableOid(sc, jobInfo.csc);
|
||||
return uniqTupleKey(jobInfo, o, o, "", "", sc->tableName(), extractTableAlias(sc),
|
||||
sc->schemaName(), sc->viewName(), 0, (sc->isInfiniDB() ? 0 : 1),
|
||||
sc->schemaName(), sc->viewName(), 0, (sc->isColumnStore() ? 0 : 1),
|
||||
((sc->joinInfo() & execplan::JOIN_CORRELATED) != 0));
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ TupleInfo setTupleInfo(const execplan::CalpontSystemCatalog::ColType& ct,
|
||||
return setTupleInfo_(ct, col_oid, jobInfo, tbl_oid, sc->columnName(), sc->alias(),
|
||||
sc->schemaName(), sc->tableName(), alias, sc->viewName(),
|
||||
((sc->joinInfo() & execplan::JOIN_CORRELATED) != 0),
|
||||
pseudoType, (sc->isInfiniDB() ? 0 : 1));
|
||||
pseudoType, (sc->isColumnStore() ? 0 : 1));
|
||||
}
|
||||
|
||||
|
||||
|
@@ -649,10 +649,10 @@ const JobStepVector doColFilter(const SimpleColumn* sc1, const SimpleColumn* sc2
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (!sc1->schemaName().empty() && sc1->isInfiniDB() && !pc1)
|
||||
if (!sc1->schemaName().empty() && sc1->isColumnStore() && !pc1)
|
||||
ct1 = jobInfo.csc->colType(sc1->oid());
|
||||
|
||||
if (!sc2->schemaName().empty() && sc2->isInfiniDB() && !pc2)
|
||||
if (!sc2->schemaName().empty() && sc2->isColumnStore() && !pc2)
|
||||
ct2 = jobInfo.csc->colType(sc2->oid());
|
||||
|
||||
//X
|
||||
@@ -1074,10 +1074,10 @@ const JobStepVector doJoin(
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (!sc1->schemaName().empty() && sc1->isInfiniDB() && !pc1)
|
||||
if (!sc1->schemaName().empty() && sc1->isColumnStore() && !pc1)
|
||||
ct1 = jobInfo.csc->colType(sc1->oid());
|
||||
|
||||
if (!sc2->schemaName().empty() && sc2->isInfiniDB() && !pc2)
|
||||
if (!sc2->schemaName().empty() && sc2->isColumnStore() && !pc2)
|
||||
ct2 = jobInfo.csc->colType(sc2->oid());
|
||||
|
||||
//X
|
||||
@@ -1341,7 +1341,7 @@ const JobStepVector doSemiJoin(const SimpleColumn* sc, const ReturnedColumn* rc,
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (!sc->schemaName().empty() && sc->isInfiniDB() && !pc1)
|
||||
if (!sc->schemaName().empty() && sc->isColumnStore() && !pc1)
|
||||
ct1 = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -1650,7 +1650,7 @@ const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo)
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (!sc->schemaName().empty() && sc->isInfiniDB() && !pc)
|
||||
if (!sc->schemaName().empty() && sc->isColumnStore() && !pc)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -1902,7 +1902,7 @@ const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo)
|
||||
else
|
||||
pcs = new PseudoColStep(sc->oid(), tbl_oid, pc->pseudoType(), ct, jobInfo);
|
||||
|
||||
if (sc->isInfiniDB())
|
||||
if (sc->isColumnStore())
|
||||
pcs->addFilter(cop, value, rf);
|
||||
|
||||
pcs->alias(alias);
|
||||
@@ -2339,7 +2339,7 @@ const JobStepVector doOuterJoinOnFilter(OuterJoinOnFilter* oj, JobInfo& jobInfo)
|
||||
// MCOL-1182 if we are doing a join between a cross engine
|
||||
// step and a constant then keep the filter for the cross
|
||||
// engine step instead of deleting it further down.
|
||||
if (!sc->isInfiniDB())
|
||||
if (!sc->isColumnStore())
|
||||
{
|
||||
keepFilters = true;
|
||||
}
|
||||
@@ -2724,7 +2724,7 @@ const JobStepVector doConstantFilter(const ConstantFilter* cf, JobInfo& jobInfo)
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (!sc->schemaName().empty() && sc->isInfiniDB() && !pc)
|
||||
if (!sc->schemaName().empty() && sc->isColumnStore() && !pc)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -2950,7 +2950,7 @@ const JobStepVector doConstantFilter(const ConstantFilter* cf, JobInfo& jobInfo)
|
||||
pcs->name(sc->columnName());
|
||||
pcs->schema(sc->schemaName());
|
||||
|
||||
if (sc->isInfiniDB())
|
||||
if (sc->isColumnStore())
|
||||
{
|
||||
if (op)
|
||||
pcs->setBOP(bop2num(op));
|
||||
@@ -3001,7 +3001,7 @@ const JobStepVector doConstantFilter(const ConstantFilter* cf, JobInfo& jobInfo)
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
CalpontSystemCatalog::ColType ct = sc->colType();
|
||||
|
||||
if (!sc->schemaName().empty() && sc->isInfiniDB() && !pc)
|
||||
if (!sc->schemaName().empty() && sc->isColumnStore() && !pc)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
TupleInfo ti(setTupleInfo(ct, sc->oid(), jobInfo, tblOid, sc.get(), alias));
|
||||
|
@@ -802,7 +802,7 @@ void addOrderByAndLimit(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (sc->isInfiniDB() && !(dynamic_cast<PseudoColumn*>(sc)))
|
||||
if (sc->isColumnStore() && !(dynamic_cast<PseudoColumn*>(sc)))
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
|
@@ -127,7 +127,7 @@ void projectSimpleColumn(const SimpleColumn* sc, JobStepVector& jsv, JobInfo& jo
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
// type of pseudo column is set by connector
|
||||
if (sc->isInfiniDB() && !pc)
|
||||
if (sc->isColumnStore() && !pc)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -708,7 +708,7 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo
|
||||
ct = sc->colType();
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
if (sc->isInfiniDB() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
if (sc->isColumnStore() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -994,7 +994,7 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo
|
||||
ct = sc->colType();
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
if (sc->isInfiniDB() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
if (sc->isColumnStore() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -1142,7 +1142,7 @@ const JobStepVector doAggProject(const CalpontSelectExecutionPlan* csep, JobInfo
|
||||
ct = sc->colType();
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
if (sc->isInfiniDB() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
if (sc->isColumnStore() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -1623,7 +1623,7 @@ void parseExecutionPlan(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo,
|
||||
CalpontSystemCatalog::ColType ct = sc->colType();
|
||||
|
||||
//XXX use this before connector sets colType in sc correctly.
|
||||
if (sc->isInfiniDB() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
if (sc->isColumnStore() && dynamic_cast<const PseudoColumn*>(sc) == NULL)
|
||||
ct = jobInfo.csc->colType(sc->oid());
|
||||
|
||||
//X
|
||||
@@ -1759,7 +1759,7 @@ void makeJobSteps(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo,
|
||||
|
||||
if (it->schema.empty())
|
||||
oid = doFromSubquery(fromSubquery[i++].get(), it->alias, it->view, jobInfo);
|
||||
else if (it->fIsInfiniDB)
|
||||
else if (it->fisColumnStore)
|
||||
oid = jobInfo.csc->tableRID(*it).objnum;
|
||||
else
|
||||
oid = 0;
|
||||
|
@@ -71,7 +71,7 @@ pthread_mutex_t calpont_mutex;
|
||||
Function we use in the creation of our hash to get key.
|
||||
*/
|
||||
|
||||
static uchar* calpont_get_key(INFINIDB_SHARE* share, size_t* length,
|
||||
static uchar* calpont_get_key(COLUMNSTORE_SHARE* share, size_t* length,
|
||||
my_bool not_used __attribute__((unused)))
|
||||
{
|
||||
*length = share->table_name_length;
|
||||
|
@@ -25,7 +25,7 @@ extern handlerton* calpont_hton;
|
||||
extern handlerton* mcs_hton;
|
||||
|
||||
/** @brief
|
||||
INFINIDB_SHARE is a structure that will be shared among all open handlers.
|
||||
COLUMNSTORE_SHARE is a structure that will be shared among all open handlers.
|
||||
This example implements the minimum of what you will probably need.
|
||||
*/
|
||||
typedef struct st_calpont_share
|
||||
@@ -34,7 +34,7 @@ typedef struct st_calpont_share
|
||||
uint32_t table_name_length, use_count;
|
||||
pthread_mutex_t mutex;
|
||||
THR_LOCK lock;
|
||||
} INFINIDB_SHARE;
|
||||
} COLUMNSTORE_SHARE;
|
||||
|
||||
/** @brief
|
||||
Class definition for the storage engine
|
||||
@@ -42,7 +42,7 @@ typedef struct st_calpont_share
|
||||
class ha_calpont: public handler
|
||||
{
|
||||
THR_LOCK_DATA lock; ///< MySQL lock
|
||||
INFINIDB_SHARE* share; ///< Shared lock info
|
||||
COLUMNSTORE_SHARE* share; ///< Shared lock info
|
||||
ulonglong int_table_flags;
|
||||
|
||||
public:
|
||||
|
@@ -2370,7 +2370,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
||||
sc->hasAggregate(cols[j]->hasAggregate());
|
||||
|
||||
if (col)
|
||||
sc->isInfiniDB(col->isInfiniDB());
|
||||
sc->isColumnStore(col->isColumnStore());
|
||||
|
||||
// @bug5634, @bug5635. mark used derived col on derived table.
|
||||
// outer join inner table filter can not be moved in
|
||||
@@ -2823,14 +2823,14 @@ SimpleColumn* getSmallestColumn(boost::shared_ptr<CalpontSystemCatalog> csc,
|
||||
}
|
||||
|
||||
// check engine type
|
||||
if (!tan.fIsInfiniDB)
|
||||
if (!tan.fisColumnStore)
|
||||
{
|
||||
// get the first column to project. @todo optimization to get the smallest one for foreign engine.
|
||||
Field* field = *(table->field);
|
||||
SimpleColumn* sc = new SimpleColumn(table->s->db.str, table->s->table_name.str, field->field_name.str, tan.fIsInfiniDB, gwi.sessionid);
|
||||
SimpleColumn* sc = new SimpleColumn(table->s->db.str, table->s->table_name.str, field->field_name.str, tan.fisColumnStore, gwi.sessionid);
|
||||
string alias(table->alias.ptr());
|
||||
sc->tableAlias(lower(alias));
|
||||
sc->isInfiniDB(false);
|
||||
sc->isColumnStore(false);
|
||||
sc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr());
|
||||
sc->resultType(fieldType_MysqlToIDB(field));
|
||||
sc->oid(field->field_index + 1);
|
||||
@@ -4182,16 +4182,16 @@ FunctionColumn* buildCaseFunction(Item_func* item, gp_walk_info& gwi, bool& nonS
|
||||
ConstantColumn* buildDecimalColumn(Item* item, gp_walk_info& gwi)
|
||||
{
|
||||
Item_decimal* idp = (Item_decimal*)item;
|
||||
IDB_Decimal infinidb_decimal;
|
||||
IDB_Decimal columnstore_decimal;
|
||||
String val, *str = item->val_str(&val);
|
||||
string valStr;
|
||||
valStr.assign(str->ptr(), str->length());
|
||||
ostringstream infinidb_decimal_val;
|
||||
ostringstream columnstore_decimal_val;
|
||||
uint32_t i = 0;
|
||||
|
||||
if (str->ptr()[0] == '+' || str->ptr()[0] == '-')
|
||||
{
|
||||
infinidb_decimal_val << str->ptr()[0];
|
||||
columnstore_decimal_val << str->ptr()[0];
|
||||
i = 1;
|
||||
}
|
||||
|
||||
@@ -4200,22 +4200,22 @@ ConstantColumn* buildDecimalColumn(Item* item, gp_walk_info& gwi)
|
||||
if (str->ptr()[i] == '.')
|
||||
continue;
|
||||
|
||||
infinidb_decimal_val << str->ptr()[i];
|
||||
columnstore_decimal_val << str->ptr()[i];
|
||||
}
|
||||
|
||||
infinidb_decimal.value = strtoll(infinidb_decimal_val.str().c_str(), 0, 10);
|
||||
columnstore_decimal.value = strtoll(columnstore_decimal_val.str().c_str(), 0, 10);
|
||||
|
||||
if (gwi.internalDecimalScale >= 0 && idp->decimals > (uint)gwi.internalDecimalScale)
|
||||
{
|
||||
infinidb_decimal.scale = gwi.internalDecimalScale;
|
||||
double val = (double)(infinidb_decimal.value / pow((double)10, idp->decimals - gwi.internalDecimalScale));
|
||||
infinidb_decimal.value = (int64_t)(val > 0 ? val + 0.5 : val - 0.5);
|
||||
columnstore_decimal.scale = gwi.internalDecimalScale;
|
||||
double val = (double)(columnstore_decimal.value / pow((double)10, idp->decimals - gwi.internalDecimalScale));
|
||||
columnstore_decimal.value = (int64_t)(val > 0 ? val + 0.5 : val - 0.5);
|
||||
}
|
||||
else
|
||||
infinidb_decimal.scale = idp->decimals;
|
||||
columnstore_decimal.scale = idp->decimals;
|
||||
|
||||
infinidb_decimal.precision = idp->max_length - idp->decimals;
|
||||
ConstantColumn* cc = new ConstantColumn(valStr, infinidb_decimal);
|
||||
columnstore_decimal.precision = idp->max_length - idp->decimals;
|
||||
ConstantColumn* cc = new ConstantColumn(valStr, columnstore_decimal);
|
||||
cc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr());
|
||||
return cc;
|
||||
}
|
||||
@@ -4239,18 +4239,18 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
||||
return buildSimpleColFromDerivedTable(gwi, ifp);
|
||||
|
||||
CalpontSystemCatalog::ColType ct;
|
||||
bool infiniDB = true;
|
||||
bool columnStore = true;
|
||||
|
||||
try
|
||||
{
|
||||
// check foreign engine
|
||||
if (ifp->cached_table && ifp->cached_table->table)
|
||||
infiniDB = isMCSTable(ifp->cached_table->table);
|
||||
columnStore = isMCSTable(ifp->cached_table->table);
|
||||
// @bug4509. ifp->cached_table could be null for myisam sometimes
|
||||
else if (ifp->field && ifp->field->table)
|
||||
infiniDB = isMCSTable(ifp->field->table);
|
||||
columnStore = isMCSTable(ifp->field->table);
|
||||
|
||||
if (infiniDB)
|
||||
if (columnStore)
|
||||
{
|
||||
ct = gwi.csc->colType(
|
||||
gwi.csc->lookupOID(make_tcn(ifp->db_name, bestTableName(ifp), ifp->field_name.str)));
|
||||
@@ -4273,10 +4273,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
||||
{
|
||||
case CalpontSystemCatalog::TINYINT:
|
||||
if (ct.scale == 0)
|
||||
sc = new SimpleColumn_INT<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_INT<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
else
|
||||
{
|
||||
sc = new SimpleColumn_Decimal<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_Decimal<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||
}
|
||||
|
||||
@@ -4284,10 +4284,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
||||
|
||||
case CalpontSystemCatalog::SMALLINT:
|
||||
if (ct.scale == 0)
|
||||
sc = new SimpleColumn_INT<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_INT<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
else
|
||||
{
|
||||
sc = new SimpleColumn_Decimal<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_Decimal<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||
}
|
||||
|
||||
@@ -4296,10 +4296,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
||||
case CalpontSystemCatalog::INT:
|
||||
case CalpontSystemCatalog::MEDINT:
|
||||
if (ct.scale == 0)
|
||||
sc = new SimpleColumn_INT<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_INT<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
else
|
||||
{
|
||||
sc = new SimpleColumn_Decimal<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_Decimal<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||
}
|
||||
|
||||
@@ -4307,34 +4307,34 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
||||
|
||||
case CalpontSystemCatalog::BIGINT:
|
||||
if (ct.scale == 0)
|
||||
sc = new SimpleColumn_INT<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_INT<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
else
|
||||
{
|
||||
sc = new SimpleColumn_Decimal<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_Decimal<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
ct.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case CalpontSystemCatalog::UTINYINT:
|
||||
sc = new SimpleColumn_UINT<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_UINT<1>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
break;
|
||||
|
||||
case CalpontSystemCatalog::USMALLINT:
|
||||
sc = new SimpleColumn_UINT<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_UINT<2>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
break;
|
||||
|
||||
case CalpontSystemCatalog::UINT:
|
||||
case CalpontSystemCatalog::UMEDINT:
|
||||
sc = new SimpleColumn_UINT<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_UINT<4>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
break;
|
||||
|
||||
case CalpontSystemCatalog::UBIGINT:
|
||||
sc = new SimpleColumn_UINT<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn_UINT<8>(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
break;
|
||||
|
||||
default:
|
||||
sc = new SimpleColumn(ifp->db_name, bestTableName(ifp), ifp->field_name.str, infiniDB, gwi.sessionid);
|
||||
sc = new SimpleColumn(ifp->db_name, bestTableName(ifp), ifp->field_name.str, columnStore, gwi.sessionid);
|
||||
}
|
||||
|
||||
sc->resultType(ct);
|
||||
@@ -4352,10 +4352,10 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
|
||||
sc->viewName(lower(getViewName(ifp->cached_table)));
|
||||
|
||||
sc->alias(ifp->name.str);
|
||||
sc->isInfiniDB(infiniDB);
|
||||
sc->isColumnStore(columnStore);
|
||||
sc->timeZone(gwi.thd->variables.time_zone->get_name()->ptr());
|
||||
|
||||
if (!infiniDB && ifp->field)
|
||||
if (!columnStore && ifp->field)
|
||||
sc->oid(ifp->field->field_index + 1); // ExeMgr requires offset started from 1
|
||||
|
||||
if (ifp->depended_from)
|
||||
@@ -4584,7 +4584,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
|
||||
parm.reset(sc);
|
||||
gwi.columnMap.insert(CalpontSelectExecutionPlan::ColumnMap::value_type(string(ifp->field_name.str), parm));
|
||||
TABLE_LIST* tmp = (ifp->cached_table ? ifp->cached_table : 0);
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] = make_pair(1, tmp);
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] = make_pair(1, tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5084,7 +5084,7 @@ void gp_walk(const Item* item, void* arg)
|
||||
if (!((scp->joinInfo() & JOIN_CORRELATED) || scp->colType().colDataType == CalpontSystemCatalog::VARBINARY))
|
||||
{
|
||||
TABLE_LIST* tmp = (ifp->cached_table ? ifp->cached_table : 0);
|
||||
gwip->tableMap[make_aliastable(scp->schemaName(), scp->tableName(), scp->tableAlias(), scp->isInfiniDB())] =
|
||||
gwip->tableMap[make_aliastable(scp->schemaName(), scp->tableName(), scp->tableAlias(), scp->isColumnStore())] =
|
||||
make_pair(1, tmp);
|
||||
}
|
||||
}
|
||||
@@ -6132,10 +6132,10 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
||||
else
|
||||
{
|
||||
// check foreign engine tables
|
||||
bool infiniDB = (table_ptr->table ? isMCSTable(table_ptr->table) : true);
|
||||
bool columnStore = (table_ptr->table ? isMCSTable(table_ptr->table) : true);
|
||||
|
||||
// trigger system catalog cache
|
||||
if (infiniDB)
|
||||
if (columnStore)
|
||||
csc->columnRIDs(make_table(table_ptr->db.str, table_ptr->table_name.str), true);
|
||||
|
||||
string table_name = table_ptr->table_name.str;
|
||||
@@ -6144,9 +6144,9 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
||||
if (table_ptr->db.length && strcmp(table_ptr->db.str, "information_schema") == 0)
|
||||
table_name = (table_ptr->schema_table_name.length ? table_ptr->schema_table_name.str : table_ptr->alias.str);
|
||||
|
||||
CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_name, table_ptr->alias.str, viewName, infiniDB);
|
||||
CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_name, table_ptr->alias.str, viewName, columnStore);
|
||||
gwi.tbList.push_back(tn);
|
||||
CalpontSystemCatalog::TableAliasName tan = make_aliastable(table_ptr->db.str, table_name, table_ptr->alias.str, infiniDB);
|
||||
CalpontSystemCatalog::TableAliasName tan = make_aliastable(table_ptr->db.str, table_name, table_ptr->alias.str, columnStore);
|
||||
gwi.tableMap[tan] = make_pair(0, table_ptr);
|
||||
#ifdef DEBUG_WALK_COND
|
||||
cerr << tn << endl;
|
||||
@@ -6523,7 +6523,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
||||
if (ifp->cached_table)
|
||||
tmp = ifp->cached_table;
|
||||
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] =
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] =
|
||||
make_pair(1, tmp);
|
||||
}
|
||||
else
|
||||
@@ -7090,7 +7090,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
||||
string fullname;
|
||||
fullname = str.c_ptr();
|
||||
TABLE_LIST* tmp = (funcFieldVec[i]->cached_table ? funcFieldVec[i]->cached_table : 0);
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] =
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] =
|
||||
make_pair(1, tmp);
|
||||
}
|
||||
}
|
||||
@@ -7630,7 +7630,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
||||
gwi.returnedCols.push_back(srcp);
|
||||
gwi.columnMap.insert(CalpontSelectExecutionPlan::ColumnMap::value_type(string(fieldVec[i]->field_name.str), srcp));
|
||||
TABLE_LIST* tmp = (fieldVec[i]->cached_table ? fieldVec[i]->cached_table : 0);
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] =
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] =
|
||||
make_pair(1, tmp);
|
||||
}
|
||||
}
|
||||
@@ -8367,10 +8367,10 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
|
||||
else
|
||||
{
|
||||
// check foreign engine tables
|
||||
bool infiniDB = (table_ptr->table ? isMCSTable(table_ptr->table) : true);
|
||||
bool columnStore = (table_ptr->table ? isMCSTable(table_ptr->table) : true);
|
||||
|
||||
// trigger system catalog cache
|
||||
if (infiniDB)
|
||||
if (columnStore)
|
||||
csc->columnRIDs(make_table(table_ptr->db.str, table_ptr->table_name.str), true);
|
||||
|
||||
string table_name = table_ptr->table_name.str;
|
||||
@@ -8379,9 +8379,9 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
|
||||
if (table_ptr->db.length && strcmp(table_ptr->db.str, "information_schema") == 0)
|
||||
table_name = (table_ptr->schema_table_name.length ? table_ptr->schema_table_name.str : table_ptr->alias.str);
|
||||
|
||||
CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_name, table_ptr->alias.str, viewName, infiniDB);
|
||||
CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_name, table_ptr->alias.str, viewName, columnStore);
|
||||
gwi.tbList.push_back(tn);
|
||||
CalpontSystemCatalog::TableAliasName tan = make_aliastable(table_ptr->db.str, table_name, table_ptr->alias.str, infiniDB);
|
||||
CalpontSystemCatalog::TableAliasName tan = make_aliastable(table_ptr->db.str, table_name, table_ptr->alias.str, columnStore);
|
||||
gwi.tableMap[tan] = make_pair(0, table_ptr);
|
||||
#ifdef DEBUG_WALK_COND
|
||||
cerr << tn << endl;
|
||||
@@ -8646,7 +8646,7 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
|
||||
if (ifp->cached_table)
|
||||
tmp = ifp->cached_table;
|
||||
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] =
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] =
|
||||
make_pair(1, tmp);
|
||||
}
|
||||
else
|
||||
@@ -9235,7 +9235,7 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
|
||||
string fullname;
|
||||
fullname = str.c_ptr();
|
||||
TABLE_LIST* tmp = (funcFieldVec[i]->cached_table ? funcFieldVec[i]->cached_table : 0);
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] =
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] =
|
||||
make_pair(1, tmp);
|
||||
}
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ public:
|
||||
* derived_handler API methods. Could be used by the server
|
||||
* tp process sub-queries.
|
||||
* More details in server/sql/dervied_handler.h
|
||||
* INFINIDB_SHARE* hton share
|
||||
* COLUMNSTORE_SHARE* hton share
|
||||
* tbl in the constructor is the list of the tables involved.
|
||||
* Methods:
|
||||
* init_scan - get plan and send it to ExeMgr. Get the execution result.
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
class ha_columnstore_derived_handler: public derived_handler
|
||||
{
|
||||
private:
|
||||
INFINIDB_SHARE *share;
|
||||
COLUMNSTORE_SHARE *share;
|
||||
|
||||
public:
|
||||
ha_columnstore_derived_handler(THD* thd_arg, TABLE_LIST *tbl);
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
* select_handler API methods. Could be used by the server
|
||||
* tp pushdown the whole query described by SELECT_LEX.
|
||||
* More details in server/sql/select_handler.h
|
||||
* INFINIDB_SHARE* hton share
|
||||
* COLUMNSTORE_SHARE* hton share
|
||||
* sel in the constructor is the semantic tree for the query.
|
||||
* Methods:
|
||||
* init_scan - get plan and send it to ExeMgr. Get the execution result.
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
class ha_columnstore_select_handler: public select_handler
|
||||
{
|
||||
private:
|
||||
INFINIDB_SHARE *share;
|
||||
COLUMNSTORE_SHARE *share;
|
||||
|
||||
public:
|
||||
ha_columnstore_select_handler(THD* thd_arg, SELECT_LEX* sel);
|
||||
|
@@ -134,7 +134,7 @@ static MYSQL_THDVAR_BOOL(
|
||||
static MYSQL_THDVAR_BOOL(
|
||||
double_for_decimal_math,
|
||||
PLUGIN_VAR_NOCMDARG,
|
||||
"Enable/disable the InfiniDB to replace DECIMAL with DOUBLE in arithmetic operation.",
|
||||
"Enable/disable for ColumnStore to replace DECIMAL with DOUBLE in arithmetic operation.",
|
||||
NULL,
|
||||
NULL,
|
||||
0
|
||||
@@ -227,7 +227,7 @@ static MYSQL_THDVAR_ULONG(
|
||||
static MYSQL_THDVAR_ULONG(
|
||||
local_query,
|
||||
PLUGIN_VAR_RQCMDARG,
|
||||
"Enable/disable the Infinidb local PM query only feature.",
|
||||
"Enable/disable the ColumnStore local PM query only feature.",
|
||||
NULL,
|
||||
NULL,
|
||||
0,
|
||||
|
@@ -540,7 +540,7 @@ execplan::ReturnedColumn* buildPseudoColumn(Item* item,
|
||||
{
|
||||
SRCP srcp(sc);
|
||||
gwi.columnMap.insert(CalpontSelectExecutionPlan::ColumnMap::value_type(sc->columnName(), srcp));
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isInfiniDB())] =
|
||||
gwi.tableMap[make_aliastable(sc->schemaName(), sc->tableName(), sc->tableAlias(), sc->isColumnStore())] =
|
||||
make_pair(1, field->cached_table);
|
||||
}
|
||||
else if (!gwi.rcWorkStack.empty())
|
||||
|
@@ -120,13 +120,13 @@ void View::transform()
|
||||
else
|
||||
{
|
||||
// check foreign engine tables
|
||||
bool infiniDB = (table_ptr->table ? isMCSTable(table_ptr->table) : true);
|
||||
bool columnStore = (table_ptr->table ? isMCSTable(table_ptr->table) : true);
|
||||
|
||||
// trigger system catalog cache
|
||||
if (infiniDB)
|
||||
if (columnStore)
|
||||
csc->columnRIDs(make_table(table_ptr->db.str, table_ptr->table_name.str), true);
|
||||
|
||||
CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_ptr->table_name.str, table_ptr->alias.str, viewName, infiniDB);
|
||||
CalpontSystemCatalog::TableAliasName tn = make_aliasview(table_ptr->db.str, table_ptr->table_name.str, table_ptr->alias.str, viewName, columnStore);
|
||||
gwi.tbList.push_back(tn);
|
||||
gwi.tableMap[tn] = make_pair(0, table_ptr);
|
||||
fParentGwip->tableMap[tn] = make_pair(0, table_ptr);
|
||||
|
@@ -454,7 +454,7 @@ tpl_close ( cpsm_tplh_t* ntplh,
|
||||
status_t
|
||||
sm_init ( uint32_t sid,
|
||||
cpsm_conhdl_t** conn_hdl,
|
||||
uint32_t infinidb_local_query)
|
||||
uint32_t columnstore_local_query)
|
||||
{
|
||||
// clear file content
|
||||
#if IDB_SM_DEBUG
|
||||
@@ -465,7 +465,7 @@ sm_init ( uint32_t sid,
|
||||
|
||||
// @bug5660 Connection changes related to the local pm setting
|
||||
/**
|
||||
* when local PM is detected, or infinidb_local_query is set:
|
||||
* when local PM is detected, or columnstore_local_query is set:
|
||||
* 1. SELECT query connect to local ExeMgr 127.0.0.1:8601;
|
||||
* 2. DML/DDL is disallowed.
|
||||
* once local connection is determined, no need to check
|
||||
@@ -474,14 +474,14 @@ sm_init ( uint32_t sid,
|
||||
if (*conn_hdl)
|
||||
{
|
||||
// existing connection is local, ok.
|
||||
if ((*conn_hdl)->exeMgr->localQuery() || ! infinidb_local_query)
|
||||
if ((*conn_hdl)->exeMgr->localQuery() || ! columnstore_local_query)
|
||||
return STATUS_OK;
|
||||
// if session variable changes to local, re-establish the connection to loopback.
|
||||
else
|
||||
sm_cleanup(*conn_hdl);
|
||||
}
|
||||
|
||||
cpsm_conhdl_t* hndl = new cpsm_conhdl_t(time(0), sid, infinidb_local_query);
|
||||
cpsm_conhdl_t* hndl = new cpsm_conhdl_t(time(0), sid, columnstore_local_query);
|
||||
*conn_hdl = hndl;
|
||||
hndl->sessionID = sid;
|
||||
|
||||
|
@@ -198,9 +198,9 @@ typedef boost::shared_ptr<cpsm_tplsch_t> sp_cpsm_tplsch_t;
|
||||
class cpsm_conhdl_t
|
||||
{
|
||||
public:
|
||||
cpsm_conhdl_t(time_t v, const uint32_t sid, bool infinidb_local_query) :
|
||||
cpsm_conhdl_t(time_t v, const uint32_t sid, bool columnstore_local_query) :
|
||||
value(v), sessionID(sid), queryState (NO_QUERY),
|
||||
exeMgr( new execplan::ClientRotator(sid, "ExeMgr", infinidb_local_query)),
|
||||
exeMgr( new execplan::ClientRotator(sid, "ExeMgr", columnstore_local_query)),
|
||||
tblinfo_idx(0), idxinfo_idx(0), curFetchTb (0)
|
||||
{ }
|
||||
|
||||
@@ -275,7 +275,7 @@ struct cpsm_tid_t
|
||||
int value;
|
||||
};
|
||||
|
||||
extern status_t sm_init(uint32_t, cpsm_conhdl_t**, uint32_t infinidb_local_query = false);
|
||||
extern status_t sm_init(uint32_t, cpsm_conhdl_t**, uint32_t columnstore_local_query = false);
|
||||
extern status_t sm_cleanup(cpsm_conhdl_t*);
|
||||
|
||||
extern status_t tpl_open(tableid_t, cpsm_tplh_t*, cpsm_conhdl_t*);
|
||||
|
Reference in New Issue
Block a user