提交 51c09bb1 编写于 作者: S Shengliang Guan

TD-1530 aligin double in arm32

上级 1ad7827f
...@@ -2445,8 +2445,8 @@ static bool percentile_function_setup(SQLFunctionCtx *pCtx) { ...@@ -2445,8 +2445,8 @@ static bool percentile_function_setup(SQLFunctionCtx *pCtx) {
// in the first round, get the min-max value of all involved data // in the first round, get the min-max value of all involved data
SResultInfo *pResInfo = GET_RES_INFO(pCtx); SResultInfo *pResInfo = GET_RES_INFO(pCtx);
SPercentileInfo *pInfo = pResInfo->interResultBuf; SPercentileInfo *pInfo = pResInfo->interResultBuf;
pInfo->minval = DBL_MAX; SET_DOUBLE_VAL(&pInfo->minval, DBL_MAX);
pInfo->maxval = -DBL_MAX; SET_DOUBLE_VAL(&pInfo->maxval, -DBL_MAX);
pInfo->numOfElems = 0; pInfo->numOfElems = 0;
return true; return true;
...@@ -2461,12 +2461,12 @@ static void percentile_function(SQLFunctionCtx *pCtx) { ...@@ -2461,12 +2461,12 @@ static void percentile_function(SQLFunctionCtx *pCtx) {
// the first stage, only acquire the min/max value // the first stage, only acquire the min/max value
if (pInfo->stage == 0) { if (pInfo->stage == 0) {
if (pCtx->preAggVals.isSet) { if (pCtx->preAggVals.isSet) {
if (pInfo->minval > pCtx->preAggVals.statis.min) { if (GET_DOUBLE_VAL(&pInfo->minval) > pCtx->preAggVals.statis.min) {
pInfo->minval = (double)pCtx->preAggVals.statis.min; SET_DOUBLE_VAL(&pInfo->minval, (double)pCtx->preAggVals.statis.min);
} }
if (pInfo->maxval < pCtx->preAggVals.statis.max) { if (GET_DOUBLE_VAL(&pInfo->maxval) < pCtx->preAggVals.statis.max) {
pInfo->maxval = (double)pCtx->preAggVals.statis.max; SET_DOUBLE_VAL(&pInfo->maxval, (double)pCtx->preAggVals.statis.max);
} }
pInfo->numOfElems += (pCtx->size - pCtx->preAggVals.statis.numOfNull); pInfo->numOfElems += (pCtx->size - pCtx->preAggVals.statis.numOfNull);
...@@ -2500,12 +2500,12 @@ static void percentile_function(SQLFunctionCtx *pCtx) { ...@@ -2500,12 +2500,12 @@ static void percentile_function(SQLFunctionCtx *pCtx) {
break; break;
} }
if (v < pInfo->minval) { if (v < GET_DOUBLE_VAL(&pInfo->minval)) {
pInfo->minval = v; SET_DOUBLE_VAL(&pInfo->minval, v);
} }
if (v > pInfo->maxval) { if (v > GET_DOUBLE_VAL(&pInfo->maxval)) {
pInfo->maxval = v; SET_DOUBLE_VAL(&pInfo->maxval, v);
} }
pInfo->numOfElems += 1; pInfo->numOfElems += 1;
...@@ -2564,12 +2564,12 @@ static void percentile_function_f(SQLFunctionCtx *pCtx, int32_t index) { ...@@ -2564,12 +2564,12 @@ static void percentile_function_f(SQLFunctionCtx *pCtx, int32_t index) {
break; break;
} }
if (v < pInfo->minval) { if (v < GET_DOUBLE_VAL(&pInfo->minval)) {
pInfo->minval = v; SET_DOUBLE_VAL(&pInfo->minval, v);
} }
if (v > pInfo->maxval) { if (v > GET_DOUBLE_VAL(&pInfo->maxval)) {
pInfo->maxval = v; SET_DOUBLE_VAL(&pInfo->maxval, v);
} }
pInfo->numOfElems += 1; pInfo->numOfElems += 1;
...@@ -2609,7 +2609,7 @@ static void percentile_next_step(SQLFunctionCtx *pCtx) { ...@@ -2609,7 +2609,7 @@ static void percentile_next_step(SQLFunctionCtx *pCtx) {
} }
pInfo->stage += 1; pInfo->stage += 1;
pInfo->pMemBucket = tMemBucketCreate(pCtx->inputBytes, pCtx->inputType, pInfo->minval, pInfo->maxval); pInfo->pMemBucket = tMemBucketCreate(pCtx->inputBytes, pCtx->inputType, GET_DOUBLE_VAL(&pInfo->minval), GET_DOUBLE_VAL(&pInfo->maxval));
} else { } else {
pResInfo->complete = true; pResInfo->complete = true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册