1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-597 Take Window Functions just to get a compile. No other changes were needed.

This commit is contained in:
David Hall
2017-03-03 15:57:41 -06:00
parent f240c89faf
commit 12acd033fb
5 changed files with 46 additions and 49 deletions

View File

@ -699,11 +699,13 @@ void debug_walk(const Item *item, void *arg)
cout << ": <NULL>" << endl;
break;
}
#if 0
case Item::WINDOW_FUNC_ITEM:
{
cout << "Window Function Item" << endl;
break;
}
#endif
default:
{
cout << "UNKNOWN_ITEM type " << item->type() << endl;
@ -2453,6 +2455,7 @@ ReturnedColumn* buildReturnedColumn(Item* item, gp_walk_info& gwi, bool& nonSupp
rc = new ConstantColumn(valStr);
break;
}
#if 0
case Item::WINDOW_FUNC_ITEM:
{
return buildWindowFunctionColumn(item, gwi, nonSupport);
@ -2469,6 +2472,7 @@ ReturnedColumn* buildReturnedColumn(Item* item, gp_walk_info& gwi, bool& nonSupp
rc->resultType(srcp->resultType());
break;
}
#endif
case Item::SUBSELECT_ITEM:
{
gwi.hasSubSelect = true;
@ -3500,23 +3504,24 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi)
end=order_item + gc->order_field();order_item < end;
order_item++)
{
Item *ord_col= *(*order_item)->item;
if (ord_col->type() == Item::INT_ITEM)
{
Item_int* id = (Item_int*)ord_col;
if (id->val_int() > (int)selCols.size())
{
gwi.fatalParseError = true;
return NULL;
}
rc = selCols[id->val_int()-1]->clone();
rc->orderPos(id->val_int()-1);
}
else
{
rc = buildReturnedColumn(ord_col, gwi, gwi.fatalParseError);
}
rc->asc((*order_item)->asc);
Item *ord_col= *(*order_item)->item;
if (ord_col->type() == Item::INT_ITEM)
{
Item_int* id = (Item_int*)ord_col;
if (id->val_int() > (int)selCols.size())
{
gwi.fatalParseError = true;
return NULL;
}
rc = selCols[id->val_int()-1]->clone();
rc->orderPos(id->val_int()-1);
}
else
{
rc = buildReturnedColumn(ord_col, gwi, gwi.fatalParseError);
}
// 10.2 TODO: direction is now a tri-state flag
rc->asc((*order_item)->direction == ORDER::ORDER_ASC ? true : false);
orderCols.push_back(SRCP(rc));
}
@ -4423,6 +4428,7 @@ void gp_walk(const Item *item, void *arg)
gwip->rcWorkStack.push(buildReturnedColumn(itp, *gwip, gwip->fatalParseError));
break;
}
#if 0
case Item::WINDOW_FUNC_ITEM:
{
gwip->hasWindowFunc = true;
@ -4432,6 +4438,7 @@ void gp_walk(const Item *item, void *arg)
gwip->rcWorkStack.push(af);
break;
}
#endif
case Item::COPY_STR_ITEM:
printf("********** received COPY_STR_ITEM *********\n");
break;
@ -4615,9 +4622,11 @@ void parse_item (Item *item, vector<Item_field*>& field_vec, bool& hasNonSupport
setError(item->thd(), ER_CHECK_NOT_IMPLEMENTED, parseErrorText);
break;
}
#if 0
case Item::WINDOW_FUNC_ITEM:
parseInfo |= AF_BIT;
break;
#endif
default:
break;
}
@ -5507,6 +5516,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
setError(gwi.thd, ER_CHECK_NOT_IMPLEMENTED, gwi.parseErrorText, gwi);
return ER_CHECK_NOT_IMPLEMENTED;
}
#if 0
case Item::WINDOW_FUNC_ITEM:
{
SRCP srcp(buildWindowFunctionColumn(item, gwi, gwi.fatalParseError));
@ -5520,6 +5530,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
gwi.returnedCols.push_back(srcp);
break;
}
#endif
default:
{
break;
@ -5672,6 +5683,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
// check if window functions are in order by. InfiniDB process order by list if
// window functions are involved, either in order by or projection.
#if 0
bool hasWindowFunc = gwi.hasWindowFunc;
gwi.hasWindowFunc = false;
for (; groupcol; groupcol= groupcol->next)
@ -5687,7 +5699,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
return ER_CHECK_NOT_IMPLEMENTED;
}
gwi.hasWindowFunc = hasWindowFunc;
#endif
groupcol = reinterpret_cast<ORDER*>(select_lex.group_list.first);
for (; groupcol; groupcol= groupcol->next)
@ -5933,12 +5945,13 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
// check if window functions are in order by. InfiniDB process order by list if
// window functions are involved, either in order by or projection.
#if 0
for (; ordercol; ordercol= ordercol->next)
{
if ((*(ordercol->item))->type() == Item::WINDOW_FUNC_ITEM)
gwi.hasWindowFunc = true;
}
#endif
// re-visit the first of ordercol list
ordercol = reinterpret_cast<ORDER*>(order_list.first);
@ -5989,7 +6002,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
return ER_CHECK_NOT_IMPLEMENTED;
}
}
if (ordercol->asc)
if (ordercol->direction == ORDER::ORDER_ASC)
rc->asc(true);
else
rc->asc(false);
@ -6022,7 +6035,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
ostringstream oss;
oss << ordercol->counter;
ord_cols += oss.str();
if (!ordercol->asc)
if (!ordercol->direction == ORDER::ORDER_ASC)
ord_cols += " desc";
continue;
}
@ -6147,7 +6160,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
gwi.returnedCols.push_back(srcp);
ord_cols += " `" + escapeBackTick(str.c_ptr()) + "`";
}
if (!ordercol->asc)
if (!ordercol->direction == ORDER::ORDER_ASC)
ord_cols += " desc";
continue;
}
@ -6211,7 +6224,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
ord_item->print(&str, QT_INFINIDB);
ord_cols += str.c_ptr();
}
if (!ordercol->asc)
if (!ordercol->direction == ORDER::ORDER_ASC)
ord_cols += " desc";
}
}
@ -6551,7 +6564,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
ord_item->print(&str, QT_INFINIDB_NO_QUOTE);
ord_cols += string(str.c_ptr());
}
if (!ordercol->asc)
if (!ordercol->direction == ORDER::ORDER_ASC)
ord_cols += " desc";
}
}