You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-265 Add support for TIMESTAMP data type
This commit is contained in:
@ -273,6 +273,9 @@ inline string colTypeIdString(CalpontSystemCatalog::ColDataType type)
|
||||
case CalpontSystemCatalog::DATETIME:
|
||||
return string("DATETIME");
|
||||
|
||||
case CalpontSystemCatalog::TIMESTAMP:
|
||||
return string("TIMESTAMP");
|
||||
|
||||
case CalpontSystemCatalog::TIME:
|
||||
return string("TIME");
|
||||
|
||||
@ -1390,6 +1393,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -1431,6 +1435,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::BLOB ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -1626,6 +1631,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
|
||||
RowGroup aggRG(oidsAgg.size(), posAgg, oidsAgg, keysAgg, typeAgg, scaleAgg, precisionAgg,
|
||||
jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_UM_t rowAgg(new RowAggregationUM(groupBy, functionVec, jobInfo.rm, jobInfo.umMemLimit));
|
||||
rowAgg->timeZone(jobInfo.timeZone);
|
||||
rowgroups.push_back(aggRG);
|
||||
aggregators.push_back(rowAgg);
|
||||
|
||||
@ -1919,6 +1925,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -1977,6 +1984,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -2239,6 +2247,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
typeAgg[colAgg] == CalpontSystemCatalog::TEXT ||
|
||||
typeAgg[colAgg] == CalpontSystemCatalog::DATE ||
|
||||
typeAgg[colAgg] == CalpontSystemCatalog::DATETIME ||
|
||||
typeAgg[colAgg] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeAgg[colAgg] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -2650,6 +2659,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
RowGroup aggRG(oidsAgg.size(), posAgg, oidsAgg, keysAgg, typeAgg, scaleAgg, precisionAgg,
|
||||
jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_UM_t rowAgg(new RowAggregationUM(groupBy, functionVec1, jobInfo.rm, jobInfo.umMemLimit));
|
||||
rowAgg->timeZone(jobInfo.timeZone);
|
||||
|
||||
posAggDist.push_back(2); // rid
|
||||
|
||||
@ -2659,6 +2669,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
RowGroup aggRgDist(oidsAggDist.size(), posAggDist, oidsAggDist, keysAggDist, typeAggDist,
|
||||
scaleAggDist, precisionAggDist, jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_DIST rowAggDist(new RowAggregationDistinct(groupByNoDist, functionVec2, jobInfo.rm, jobInfo.umMemLimit));
|
||||
rowAggDist->timeZone(jobInfo.timeZone);
|
||||
|
||||
// mapping the group_concat columns, if any.
|
||||
if (jobInfo.groupConcatInfo.groupConcat().size() > 0)
|
||||
@ -2675,6 +2686,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
{
|
||||
RowAggregationMultiDistinct* multiDistinctAggregator =
|
||||
new RowAggregationMultiDistinct(groupByNoDist, functionVec2, jobInfo.rm, jobInfo.umMemLimit);
|
||||
multiDistinctAggregator->timeZone(jobInfo.timeZone);
|
||||
rowAggDist.reset(multiDistinctAggregator);
|
||||
rowAggDist->groupConcat(jobInfo.groupConcatInfo.groupConcat());
|
||||
|
||||
@ -2804,6 +2816,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
// construct sub-aggregator
|
||||
SP_ROWAGG_UM_t subAgg(
|
||||
new RowAggregationSubDistinct(groupBySub, functionSub1, jobInfo.rm, jobInfo.umMemLimit));
|
||||
subAgg->timeZone(jobInfo.timeZone);
|
||||
subAgg->groupConcat(jobInfo.groupConcatInfo.groupConcat());
|
||||
|
||||
// add to rowAggDist
|
||||
@ -2879,6 +2892,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
|
||||
// construct sub-aggregator
|
||||
SP_ROWAGG_UM_t subAgg(
|
||||
new RowAggregationUM(groupBySubNoDist, functionSub1, jobInfo.rm, jobInfo.umMemLimit));
|
||||
subAgg->timeZone(jobInfo.timeZone);
|
||||
subAgg->groupConcat(jobInfo.groupConcatInfo.groupConcat());
|
||||
|
||||
// add to rowAggDist
|
||||
@ -3159,6 +3173,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -3206,6 +3221,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -3695,6 +3711,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
|
||||
RowGroup aggRgUm(oidsAggUm.size(), posAggUm, oidsAggUm, keysAggUm, typeAggUm, scaleAggUm,
|
||||
precisionAggUm, jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_UM_t rowAggUm(new RowAggregationUMP2(groupByUm, functionVecUm, jobInfo.rm, jobInfo.umMemLimit));
|
||||
rowAggUm->timeZone(jobInfo.timeZone);
|
||||
rowgroups.push_back(aggRgUm);
|
||||
aggregators.push_back(rowAggUm);
|
||||
|
||||
@ -3706,6 +3723,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
|
||||
RowGroup aggRgPm(oidsAggPm.size(), posAggPm, oidsAggPm, keysAggPm, typeAggPm, scaleAggPm,
|
||||
precisionAggPm, jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_PM_t rowAggPm(new RowAggregation(groupByPm, functionVecPm));
|
||||
rowAggPm->timeZone(jobInfo.timeZone);
|
||||
rowgroups.push_back(aggRgPm);
|
||||
aggregators.push_back(rowAggPm);
|
||||
|
||||
@ -4011,6 +4029,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -4069,6 +4088,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
typeProj[colProj] == CalpontSystemCatalog::TEXT ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATE ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::DATETIME ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeProj[colProj] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -4378,6 +4398,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
typeAggUm[colUm] == CalpontSystemCatalog::TEXT ||
|
||||
typeAggUm[colUm] == CalpontSystemCatalog::DATE ||
|
||||
typeAggUm[colUm] == CalpontSystemCatalog::DATETIME ||
|
||||
typeAggUm[colUm] == CalpontSystemCatalog::TIMESTAMP ||
|
||||
typeAggUm[colUm] == CalpontSystemCatalog::TIME)
|
||||
{
|
||||
Message::Args args;
|
||||
@ -4733,6 +4754,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
RowGroup aggRgUm(oidsAggUm.size(), posAggUm, oidsAggUm, keysAggUm, typeAggUm, scaleAggUm,
|
||||
precisionAggUm, jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_UM_t rowAggUm(new RowAggregationUMP2(groupByUm, functionNoDistVec, jobInfo.rm, jobInfo.umMemLimit));
|
||||
rowAggUm->timeZone(jobInfo.timeZone);
|
||||
|
||||
posAggDist.push_back(2); // rid
|
||||
|
||||
@ -4742,6 +4764,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
RowGroup aggRgDist(oidsAggDist.size(), posAggDist, oidsAggDist, keysAggDist, typeAggDist,
|
||||
scaleAggDist, precisionAggDist, jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_DIST rowAggDist(new RowAggregationDistinct(groupByNoDist, functionVecUm, jobInfo.rm, jobInfo.umMemLimit));
|
||||
rowAggDist->timeZone(jobInfo.timeZone);
|
||||
|
||||
// if distinct key word applied to more than one aggregate column, reset rowAggDist
|
||||
vector<RowGroup> subRgVec;
|
||||
@ -4750,6 +4773,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
{
|
||||
RowAggregationMultiDistinct* multiDistinctAggregator =
|
||||
new RowAggregationMultiDistinct(groupByNoDist, functionVecUm, jobInfo.rm, jobInfo.umMemLimit);
|
||||
multiDistinctAggregator->timeZone(jobInfo.timeZone);
|
||||
rowAggDist.reset(multiDistinctAggregator);
|
||||
|
||||
// construct and add sub-aggregators to rowAggDist
|
||||
@ -4878,6 +4902,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
|
||||
// construct sub-aggregator
|
||||
SP_ROWAGG_UM_t subAgg(new RowAggregationSubDistinct(groupBySub, functionSub1, jobInfo.rm, jobInfo.umMemLimit));
|
||||
subAgg->timeZone(jobInfo.timeZone);
|
||||
|
||||
// add to rowAggDist
|
||||
multiDistinctAggregator->addSubAggregator(subAgg, subRg, functionSub2);
|
||||
@ -4953,6 +4978,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
// construct sub-aggregator
|
||||
SP_ROWAGG_UM_t subAgg(
|
||||
new RowAggregationUMP2(groupBySubNoDist, functionSub1, jobInfo.rm, jobInfo.umMemLimit));
|
||||
subAgg->timeZone(jobInfo.timeZone);
|
||||
|
||||
// add to rowAggDist
|
||||
multiDistinctAggregator->addSubAggregator(subAgg, aggRgUm, functionSub2);
|
||||
@ -4973,6 +4999,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
|
||||
RowGroup aggRgPm(oidsAggPm.size(), posAggPm, oidsAggPm, keysAggPm, typeAggPm, scaleAggPm,
|
||||
precisionAggPm, jobInfo.stringTableThreshold);
|
||||
SP_ROWAGG_PM_t rowAggPm(new RowAggregation(groupByPm, functionVecPm));
|
||||
rowAggPm->timeZone(jobInfo.timeZone);
|
||||
rowgroups.push_back(aggRgPm);
|
||||
aggregators.push_back(rowAggPm);
|
||||
|
||||
|
Reference in New Issue
Block a user