diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 25e6ccc42..8685b01f1 100644 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -9260,7 +9260,7 @@ void applyParallelCES(CalpontSelectExecutionPlan& csep) auto tables = csep.tableList(); CalpontSelectExecutionPlan::TableList newTableList; CalpontSelectExecutionPlan::SelectList newDerivedTableList; - static const std::string aliasPrefix = "subQ"; + static const std::string aliasPrefix = "$sub_"; // ATM Must be only 1 table for (auto& table: tables) @@ -9268,6 +9268,7 @@ void applyParallelCES(CalpontSelectExecutionPlan& csep) if (!table.isColumnstore()) { auto derivedSCEP = csep.cloneWORecursiveSelects(); + // need to intro a level std::string alias = aliasPrefix + table.schema + "_" + table.table; derivedSCEP->location(CalpontSelectExecutionPlan::FROM); @@ -9287,11 +9288,10 @@ void applyParallelCES(CalpontSelectExecutionPlan& csep) sc->tableName(""); sc->schemaName(""); sc->tableAlias(alias); + sc->colPosition(0); } } - - // WIP need to work with existing derived tables newDerivedTableList.push_back(derivedSCEP); // WIP @@ -9300,6 +9300,14 @@ void applyParallelCES(CalpontSelectExecutionPlan& csep) } } + // SimpleColumn* sc = new SimpleColumn("test", "i1", "i", false, csep.sessionID()); + // string alias(table->alias.c_ptr()); + // sc->timeZone(csep.timeZone()); + // sc->partitions(getPartitions(table)); + // boost::shared_ptr spsc(sc); + + // csep.columnMap().insert({"`test`.`i1`.`i`", spsc}); + csep.derivedTableList(newDerivedTableList); csep.tableList(newTableList); } @@ -9402,7 +9410,7 @@ int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* /*thd*/, SCS cerr << "---------------- cs_get_select_plan rewritten EXECUTION PLAN ----------------" << endl; cerr << *csep << endl; cerr << "-------------- EXECUTION PLAN END --------------\n" << endl; - + return 0; }