Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cd19ee2b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
cd19ee2b
编写于
9月 30, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix interp timestamp issue
上级
4676faa3
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
5 addition
and
50 deletion
+5
-50
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/query/inc/qAggMain.h
src/query/inc/qAggMain.h
+1
-0
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+1
-0
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+1
-48
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
cd19ee2b
...
@@ -3672,7 +3672,7 @@ int32_t validateGroupbyNode(SQueryInfo* pQueryInfo, SArray* pList, SSqlCmd* pCmd
...
@@ -3672,7 +3672,7 @@ int32_t validateGroupbyNode(SQueryInfo* pQueryInfo, SArray* pList, SSqlCmd* pCmd
tscColumnListInsert
(
pTableMetaInfo
->
tagColList
,
index
.
columnIndex
,
pTableMeta
->
id
.
uid
,
pSchema
);
tscColumnListInsert
(
pTableMetaInfo
->
tagColList
,
index
.
columnIndex
,
pTableMeta
->
id
.
uid
,
pSchema
);
}
else
{
}
else
{
// check if the column type is valid, here only support the bool/tinyint/smallint/bigint group by
// check if the column type is valid, here only support the bool/tinyint/smallint/bigint group by
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_
TIMESTAMP
||
pSchema
->
type
==
TSDB_DATA_TYPE_
FLOAT
||
pSchema
->
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_FLOAT
||
pSchema
->
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg5
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg5
);
}
}
...
...
src/query/inc/qAggMain.h
浏览文件 @
cd19ee2b
...
@@ -191,6 +191,7 @@ typedef struct SQLFunctionCtx {
...
@@ -191,6 +191,7 @@ typedef struct SQLFunctionCtx {
SResultRowCellInfo
*
resultInfo
;
SResultRowCellInfo
*
resultInfo
;
int16_t
colId
;
SExtTagsInfo
tagInfo
;
SExtTagsInfo
tagInfo
;
SPoint1
start
;
SPoint1
start
;
SPoint1
end
;
SPoint1
end
;
...
...
src/query/src/qAggMain.c
浏览文件 @
cd19ee2b
...
@@ -3697,7 +3697,7 @@ static void interp_function_impl(SQLFunctionCtx *pCtx) {
...
@@ -3697,7 +3697,7 @@ static void interp_function_impl(SQLFunctionCtx *pCtx) {
bool
ascQuery
=
(
pCtx
->
order
==
TSDB_ORDER_ASC
);
bool
ascQuery
=
(
pCtx
->
order
==
TSDB_ORDER_ASC
);
if
(
pCtx
->
inputType
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
if
(
pCtx
->
colId
==
0
&&
pCtx
->
inputType
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
*
(
TSKEY
*
)
pCtx
->
pOutput
=
pCtx
->
startTs
;
*
(
TSKEY
*
)
pCtx
->
pOutput
=
pCtx
->
startTs
;
}
else
if
(
type
==
TSDB_FILL_NULL
)
{
}
else
if
(
type
==
TSDB_FILL_NULL
)
{
setNull
(
pCtx
->
pOutput
,
pCtx
->
outputType
,
pCtx
->
outputBytes
);
setNull
(
pCtx
->
pOutput
,
pCtx
->
outputType
,
pCtx
->
outputBytes
);
...
...
src/query/src/qExecutor.c
浏览文件 @
cd19ee2b
...
@@ -1232,6 +1232,7 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx,
...
@@ -1232,6 +1232,7 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx,
// in case of the block distribution query, the inputBytes is not a constant value.
// in case of the block distribution query, the inputBytes is not a constant value.
pCtx
[
i
].
pInput
=
p
->
pData
;
pCtx
[
i
].
pInput
=
p
->
pData
;
pCtx
[
i
].
colId
=
p
->
info
.
colId
;
assert
(
p
->
info
.
colId
==
pColIndex
->
colId
&&
pCtx
[
i
].
inputType
==
p
->
info
.
type
);
assert
(
p
->
info
.
colId
==
pColIndex
->
colId
&&
pCtx
[
i
].
inputType
==
p
->
info
.
type
);
if
(
pCtx
[
i
].
functionId
<
0
)
{
if
(
pCtx
[
i
].
functionId
<
0
)
{
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
cd19ee2b
...
@@ -653,55 +653,8 @@ SArray* tsdbGetQueriedTableList(TsdbQueryHandleT *pHandle) {
...
@@ -653,55 +653,8 @@ SArray* tsdbGetQueriedTableList(TsdbQueryHandleT *pHandle) {
return
res
;
return
res
;
}
}
// leave only one table for each group
static
STableGroupInfo
*
trimTableGroup
(
STimeWindow
*
window
,
STableGroupInfo
*
pGroupList
)
{
assert
(
pGroupList
);
size_t
numOfGroup
=
taosArrayGetSize
(
pGroupList
->
pGroupList
);
STableGroupInfo
*
pNew
=
calloc
(
1
,
sizeof
(
STableGroupInfo
));
pNew
->
pGroupList
=
taosArrayInit
(
numOfGroup
,
POINTER_BYTES
);
for
(
int32_t
i
=
0
;
i
<
numOfGroup
;
++
i
)
{
SArray
*
oneGroup
=
taosArrayGetP
(
pGroupList
->
pGroupList
,
i
);
size_t
numOfTables
=
taosArrayGetSize
(
oneGroup
);
SArray
*
px
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
for
(
int32_t
j
=
0
;
j
<
numOfTables
;
++
j
)
{
STableKeyInfo
*
pInfo
=
(
STableKeyInfo
*
)
taosArrayGet
(
oneGroup
,
j
);
if
(
window
->
skey
<=
pInfo
->
lastKey
&&
((
STable
*
)
pInfo
->
pTable
)
->
lastKey
!=
TSKEY_INITIAL_VAL
)
{
taosArrayPush
(
px
,
pInfo
);
pNew
->
numOfTables
+=
1
;
break
;
}
}
// there are no data in this group
if
(
taosArrayGetSize
(
px
)
==
0
)
{
taosArrayDestroy
(
px
);
}
else
{
taosArrayPush
(
pNew
->
pGroupList
,
&
px
);
}
}
return
pNew
;
}
TsdbQueryHandleT
tsdbQueryRowsInExternalWindow
(
STsdbRepo
*
tsdb
,
STsdbQueryCond
*
pCond
,
STableGroupInfo
*
groupList
,
uint64_t
qId
,
SMemRef
*
pRef
)
{
TsdbQueryHandleT
tsdbQueryRowsInExternalWindow
(
STsdbRepo
*
tsdb
,
STsdbQueryCond
*
pCond
,
STableGroupInfo
*
groupList
,
uint64_t
qId
,
SMemRef
*
pRef
)
{
STableGroupInfo
*
pNew
=
trimTableGroup
(
&
pCond
->
twindow
,
groupList
);
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
tsdbQueryTables
(
tsdb
,
pCond
,
groupList
,
qId
,
pRef
);
if
(
pNew
->
numOfTables
==
0
)
{
tsdbDebug
(
"update query time range to invalidate time window"
);
assert
(
taosArrayGetSize
(
pNew
->
pGroupList
)
==
0
);
bool
asc
=
ASCENDING_TRAVERSE
(
pCond
->
order
);
if
(
asc
)
{
pCond
->
twindow
.
ekey
=
pCond
->
twindow
.
skey
-
1
;
}
else
{
pCond
->
twindow
.
skey
=
pCond
->
twindow
.
ekey
-
1
;
}
}
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
tsdbQueryTables
(
tsdb
,
pCond
,
pNew
,
qId
,
pRef
);
pQueryHandle
->
loadExternalRow
=
true
;
pQueryHandle
->
loadExternalRow
=
true
;
pQueryHandle
->
currentLoadExternalRows
=
true
;
pQueryHandle
->
currentLoadExternalRows
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录