constnat value to column
This commit is contained in:
parent
83efe34b2c
commit
ff73213133
|
@ -182,6 +182,11 @@ int32_t sclCopyValueNodeValue(SValueNode *pNode, void **res) {
|
|||
|
||||
int32_t sclInitParam(SNode* node, SScalarParam *param, SScalarCtx *ctx, int32_t *rowNum) {
|
||||
switch (nodeType(node)) {
|
||||
case QUERY_NODE_LEFT_VALUE: {
|
||||
SSDataBlock* pb = taosArrayGetP(ctx->pBlockList, 0);
|
||||
param->numOfRows = pb->info.rows;
|
||||
break;
|
||||
}
|
||||
case QUERY_NODE_VALUE: {
|
||||
SValueNode *valueNode = (SValueNode *)node;
|
||||
|
||||
|
@ -845,7 +850,7 @@ EDealRes sclWalkTarget(SNode* pNode, SScalarCtx *ctx) {
|
|||
}
|
||||
|
||||
EDealRes sclCalcWalker(SNode* pNode, void* pContext) {
|
||||
if (QUERY_NODE_VALUE == nodeType(pNode) || QUERY_NODE_NODE_LIST == nodeType(pNode) || QUERY_NODE_COLUMN == nodeType(pNode)) {
|
||||
if (QUERY_NODE_VALUE == nodeType(pNode) || QUERY_NODE_NODE_LIST == nodeType(pNode) || QUERY_NODE_COLUMN == nodeType(pNode)|| QUERY_NODE_LEFT_VALUE == nodeType(pNode)) {
|
||||
return DEAL_RES_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1332,6 +1332,22 @@ void vectorMathMinus(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pO
|
|||
doReleaseVec(pLeftCol, leftConvert);
|
||||
}
|
||||
|
||||
void vectorAssign(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t _ord) {
|
||||
SColumnInfoData *pOutputCol = pOut->columnData;
|
||||
|
||||
pOut->numOfRows = pLeft->numOfRows;
|
||||
|
||||
if (colDataIsNull_s(pRight->columnData, 0)) {
|
||||
for (int32_t i = 0; i < pOut->numOfRows; ++i) {
|
||||
colDataAppend(pOutputCol, i, NULL, true);
|
||||
}
|
||||
} else {
|
||||
for (int32_t i = 0; i < pOut->numOfRows; ++i) {
|
||||
colDataAppend(pOutputCol, i, colDataGetData(pRight->columnData, 0), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void vectorConcat(SScalarParam* pLeft, SScalarParam* pRight, void *out, int32_t _ord) {
|
||||
#if 0
|
||||
int32_t len = pLeft->bytes + pRight->bytes;
|
||||
|
@ -1690,6 +1706,8 @@ _bin_scalar_fn_t getBinScalarOperatorFn(int32_t binFunctionId) {
|
|||
return vectorMathRemainder;
|
||||
case OP_TYPE_MINUS:
|
||||
return vectorMathMinus;
|
||||
case OP_TYPE_ASSIGN:
|
||||
return vectorAssign;
|
||||
case OP_TYPE_GREATER_THAN:
|
||||
return vectorGreater;
|
||||
case OP_TYPE_GREATER_EQUAL:
|
||||
|
|
Loading…
Reference in New Issue