Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a2767f62
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a2767f62
编写于
12月 13, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scalar expr result type is not definitely double
上级
4d407d81
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
73 deletion
+23
-73
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+5
-4
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-2
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+2
-7
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+14
-60
未找到文件。
src/client/src/tscUtil.c
浏览文件 @
a2767f62
...
...
@@ -4919,16 +4919,17 @@ int32_t createProjectionExpr(SQueryInfo* pQueryInfo, STableMetaInfo* pTableMetaI
pse
->
colInfo
.
colId
=
pSource
->
base
.
colInfo
.
colId
;
pse
->
colType
=
pSource
->
base
.
colType
;
pse
->
colBytes
=
pSource
->
base
.
colBytes
;
pse
->
resBytes
=
sizeof
(
double
);
pse
->
resType
=
TSDB_DATA_TYPE_DOUBLE
;
pse
->
functionId
=
pSource
->
base
.
functionId
;
pse
->
numOfParams
=
pSource
->
base
.
numOfParams
;
for
(
int32_t
j
=
0
;
j
<
pSource
->
base
.
numOfParams
;
++
j
)
{
tVariantAssign
(
&
pse
->
param
[
j
],
&
pSource
->
base
.
param
[
j
]);
build
Arithmetic
ExprFromMsg
(
px
,
NULL
);
build
Scalar
ExprFromMsg
(
px
,
NULL
);
}
pse
->
resBytes
=
px
->
pExpr
->
resultBytes
;
pse
->
resType
=
px
->
pExpr
->
resultType
;
}
}
...
...
@@ -5123,7 +5124,7 @@ int32_t tscCreateQueryFromQueryInfo(SQueryInfo* pQueryInfo, SQueryAttr* pQueryAt
if
(
pQueryAttr
->
pExpr1
[
i
].
base
.
functionId
==
TSDB_FUNC_SCALAR_EXPR
)
{
for
(
int32_t
j
=
0
;
j
<
pQueryAttr
->
pExpr1
[
i
].
base
.
numOfParams
;
++
j
)
{
build
Arithmetic
ExprFromMsg
(
&
pQueryAttr
->
pExpr1
[
i
],
NULL
);
build
Scalar
ExprFromMsg
(
&
pQueryAttr
->
pExpr1
[
i
],
NULL
);
}
}
}
...
...
src/query/inc/qExecutor.h
浏览文件 @
a2767f62
...
...
@@ -686,7 +686,7 @@ void freeColumnFilterInfo(SColumnFilterInfo* pFilter, int32_t numOfFilters);
STableQueryInfo
*
createTableQueryInfo
(
SQueryAttr
*
pQueryAttr
,
void
*
pTable
,
bool
groupbyColumn
,
STimeWindow
win
,
void
*
buf
);
STableQueryInfo
*
createTmpTableQueryInfo
(
STimeWindow
win
);
int32_t
build
ArithmeticExprFromMsg
(
SExprInfo
*
pArith
ExprInfo
,
void
*
pQueryMsg
);
int32_t
build
ScalarExprFromMsg
(
SExprInfo
*
p
ExprInfo
,
void
*
pQueryMsg
);
bool
isQueryKilled
(
SQInfo
*
pQInfo
);
int32_t
checkForQueryBuf
(
size_t
numOfTables
);
...
...
@@ -717,5 +717,5 @@ int32_t getMaximumIdleDurationSec();
void
doInvokeUdf
(
SUdfInfo
*
pUdfInfo
,
SQLFunctionCtx
*
pCtx
,
int32_t
idx
,
int32_t
type
);
int32_t
getColumnDataFromId
(
void
*
param
,
int32_t
id
,
void
**
data
);
void
qInfoLogSSDataBlock
(
SSDataBlock
*
block
);
void
qInfoLogSSDataBlock
(
SSDataBlock
*
block
,
char
*
location
);
#endif // TDENGINE_QEXECUTOR_H
src/query/src/qAggMain.c
浏览文件 @
a2767f62
...
...
@@ -218,6 +218,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
}
assert
(
!
TSDB_FUNC_IS_SCALAR
(
functionId
));
assert
(
functionId
!=
TSDB_FUNC_SCALAR_EXPR
);
if
(
functionId
==
TSDB_FUNC_TS
||
functionId
==
TSDB_FUNC_TS_DUMMY
||
functionId
==
TSDB_FUNC_TAG_DUMMY
||
functionId
==
TSDB_FUNC_DIFF
||
functionId
==
TSDB_FUNC_PRJ
||
functionId
==
TSDB_FUNC_TAGPRJ
||
...
...
@@ -259,13 +260,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
*
interBytes
=
0
;
return
TSDB_CODE_SUCCESS
;
}
if
(
functionId
==
TSDB_FUNC_SCALAR_EXPR
)
{
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
*
bytes
=
sizeof
(
double
);
*
interBytes
=
0
;
return
TSDB_CODE_SUCCESS
;
}
if
(
functionId
==
TSDB_FUNC_TS_COMP
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
...
...
src/query/src/qExecutor.c
浏览文件 @
a2767f62
...
...
@@ -8230,7 +8230,7 @@ int32_t cloneExprFilterInfo(SColumnFilterInfo **dst, SColumnFilterInfo* src, int
return
TSDB_CODE_SUCCESS
;
}
int32_t
build
Arithmetic
ExprFromMsg
(
SExprInfo
*
pExprInfo
,
void
*
pQueryMsg
)
{
int32_t
build
Scalar
ExprFromMsg
(
SExprInfo
*
pExprInfo
,
void
*
pQueryMsg
)
{
qDebug
(
"qmsg:%p create arithmetic expr from binary"
,
pQueryMsg
);
tExprNode
*
pExprNode
=
NULL
;
...
...
@@ -8444,7 +8444,7 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp
// parse the arithmetic expression
if
(
pExprs
[
i
].
base
.
functionId
==
TSDB_FUNC_SCALAR_EXPR
)
{
code
=
build
Arithmetic
ExprFromMsg
(
&
pExprs
[
i
],
pMsg
);
code
=
build
Scalar
ExprFromMsg
(
&
pExprs
[
i
],
pMsg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pExprs
);
...
...
@@ -8580,30 +8580,31 @@ int32_t createIndirectQueryFuncExprFromMsg(SQueryTableMsg* pQueryMsg, int32_t nu
// parse the arithmetic expression
if
(
pExprs
[
i
].
base
.
functionId
==
TSDB_FUNC_SCALAR_EXPR
)
{
code
=
build
Arithmetic
ExprFromMsg
(
&
pExprs
[
i
],
pQueryMsg
);
code
=
build
Scalar
ExprFromMsg
(
&
pExprs
[
i
],
pQueryMsg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pExprs
);
return
code
;
}
type
=
TSDB_DATA_TYPE_DOUBLE
;
bytes
=
tDataTypes
[
type
].
bytes
;
pExprs
[
i
].
base
.
resBytes
=
pExprs
[
i
].
pExpr
->
resultBytes
;
pExprs
[
i
].
base
.
resType
=
pExprs
[
i
].
pExpr
->
resultType
;
pExprs
[
i
].
base
.
interBytes
=
0
;
}
else
{
int32_t
index
=
pExprs
[
i
].
base
.
colInfo
.
colIndex
;
assert
(
prevExpr
[
index
].
base
.
resColId
==
pExprs
[
i
].
base
.
colInfo
.
colId
);
type
=
prevExpr
[
index
].
base
.
resType
;
type
=
prevExpr
[
index
].
base
.
resType
;
bytes
=
prevExpr
[
index
].
base
.
resBytes
;
}
int32_t
param
=
(
int32_t
)
pExprs
[
i
].
base
.
param
[
0
].
i64
;
if
(
getResultDataInfo
(
type
,
bytes
,
pExprs
[
i
].
base
.
functionId
,
param
,
&
pExprs
[
i
].
base
.
resType
,
&
pExprs
[
i
].
base
.
resBytes
,
&
pExprs
[
i
].
base
.
interBytes
,
0
,
isSuperTable
,
pUdfInfo
)
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pExprs
);
return
TSDB_CODE_QRY_INVALID_MSG
;
int32_t
param
=
(
int32_t
)
pExprs
[
i
].
base
.
param
[
0
].
i64
;
if
(
getResultDataInfo
(
type
,
bytes
,
pExprs
[
i
].
base
.
functionId
,
param
,
&
pExprs
[
i
].
base
.
resType
,
&
pExprs
[
i
].
base
.
resBytes
,
&
pExprs
[
i
].
base
.
interBytes
,
0
,
isSuperTable
,
pUdfInfo
)
!=
TSDB_CODE_SUCCESS
)
{
tfree
(
pExprs
);
return
TSDB_CODE_QRY_INVALID_MSG
;
}
}
assert
(
isValidDataType
(
pExprs
[
i
].
base
.
resType
));
}
...
...
@@ -9372,50 +9373,3 @@ void freeQueryAttr(SQueryAttr* pQueryAttr) {
filterFreeInfo
(
pQueryAttr
->
pFilters
);
}
}
void
qInfoLogSSDataBlock
(
SSDataBlock
*
block
)
{
if
(
block
==
NULL
)
{
qInfo
(
"SSDataBlock : NULL"
);
return
;
}
qInfo
(
"SSDataBlock rows:%d, cols:%d, tid:%d, uid:%"
PRId64
", skey:%"
PRId64
", ekey:%"
PRId64
,
block
->
info
.
rows
,
block
->
info
.
numOfCols
,
block
->
info
.
tid
,
block
->
info
.
uid
,
block
->
info
.
window
.
skey
,
block
->
info
.
window
.
ekey
);
if
(
block
->
pBlockStatis
!=
NULL
)
{
qInfo
(
"SSDataBlock statics: null %d, max %"
PRId64
", min %"
PRId64
", colId %d, maxIndex %d, minIndex %d, colId %d, sum %"
PRId64
,
block
->
pBlockStatis
->
numOfNull
,
block
->
pBlockStatis
->
max
,
block
->
pBlockStatis
->
min
,
block
->
pBlockStatis
->
colId
,
block
->
pBlockStatis
->
maxIndex
,
block
->
pBlockStatis
->
minIndex
,
block
->
pBlockStatis
->
colId
,
block
->
pBlockStatis
->
sum
);
}
for
(
int
i
=
0
;
i
<
block
->
info
.
numOfCols
;
++
i
)
{
SColumnInfoData
*
infoData
=
taosArrayGet
(
block
->
pDataBlock
,
i
);
qInfo
(
"column %d, bytes %d, colId %d, type %d"
,
i
,
infoData
->
info
.
bytes
,
infoData
->
info
.
colId
,
infoData
->
info
.
type
);
for
(
int
j
=
0
;
j
<
block
->
info
.
rows
;
++
j
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
infoData
->
info
.
type
))
{
int64_t
v
;
GET_TYPED_DATA
(
v
,
int64_t
,
infoData
->
info
.
type
,
infoData
->
pData
+
j
*
infoData
->
info
.
bytes
);
qInfo
(
"%d, %"
PRId64
,
j
,
v
);
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
infoData
->
info
.
type
))
{
uint64_t
v
;
GET_TYPED_DATA
(
v
,
uint64_t
,
infoData
->
info
.
type
,
infoData
->
pData
+
j
*
infoData
->
info
.
bytes
);
qInfo
(
"%d, %"
PRIu64
,
j
,
v
);
}
else
if
(
IS_FLOAT_TYPE
(
infoData
->
info
.
type
))
{
double
v
;
GET_TYPED_DATA
(
v
,
double
,
infoData
->
info
.
type
,
infoData
->
pData
+
j
*
infoData
->
info
.
bytes
);
qInfo
(
"%d, %lf"
,
j
,
v
);
}
else
if
(
infoData
->
info
.
type
==
TSDB_DATA_TYPE_BOOL
)
{
bool
v
;
GET_TYPED_DATA
(
v
,
bool
,
infoData
->
info
.
type
,
infoData
->
pData
+
j
*
infoData
->
info
.
bytes
);
qInfo
(
"%d, %s"
,
j
,
v
?
"true"
:
"false"
);
}
else
if
(
infoData
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
int64_t
v
;
GET_TYPED_DATA
(
v
,
int64_t
,
infoData
->
info
.
type
,
infoData
->
pData
+
j
*
infoData
->
info
.
bytes
);
qInfo
(
"%d, %"
PRId64
,
j
,
v
);
}
else
{
qInfo
(
"can not print binary or nchar"
);
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录