Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bc8ac5f0
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看板
提交
bc8ac5f0
编写于
10月 28, 2022
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(executor): last function optimize error
上级
c1c07861
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
16 deletion
+21
-16
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+21
-16
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
bc8ac5f0
...
...
@@ -318,10 +318,10 @@ static int32_t getColDataFromGroupRes(SGroupResInfo* pGroupResInfo, SQueryRuntim
for
(
int32_t
i
=
0
;
i
<
numRows
;
++
i
)
{
SResultRow
*
row
=
taosArrayGetP
(
pGroupResInfo
->
pRows
,
i
);
row
->
groupIndex
=
i
;
tFilePage
*
page
=
getResBufPage
(
pRuntimeEnv
->
pResultBuf
,
row
->
pageId
);
int32_t
rowsToCopy
=
1
;
char
*
out
=
colData
+
numOfResult
*
colBytes
;
char
*
in
=
getPosInResultPage
(
pRuntimeEnv
->
pQueryAttr
,
page
,
row
->
offset
,
colDataOffset
);
tFilePage
*
page
=
getResBufPage
(
pRuntimeEnv
->
pResultBuf
,
row
->
pageId
);
int32_t
rowsToCopy
=
1
;
char
*
out
=
colData
+
numOfResult
*
colBytes
;
char
*
in
=
getPosInResultPage
(
pRuntimeEnv
->
pQueryAttr
,
page
,
row
->
offset
,
colDataOffset
);
memcpy
(
out
,
in
,
colBytes
*
rowsToCopy
);
numOfResult
+=
rowsToCopy
;
}
...
...
@@ -2837,6 +2837,10 @@ static bool isCachedLastQuery(SQueryAttr* pQueryAttr) {
return
false
;
}
if
(
pQueryAttr
->
pFilters
!=
NULL
||
pQueryAttr
->
pFilterInfo
!=
NULL
)
{
return
false
;
}
return
true
;
}
...
...
@@ -3165,7 +3169,7 @@ static bool overlapWithTimeWindow(SQueryAttr* pQueryAttr, SDataBlockInfo* pBlock
return
true
;
}
while
(
w
.
skey
<
pBlockInfo
->
window
.
ekey
)
{
while
(
w
.
skey
<
pBlockInfo
->
window
.
ekey
)
{
// add one slding
if
(
pQueryAttr
->
interval
.
slidingUnit
==
'n'
||
pQueryAttr
->
interval
.
slidingUnit
==
'y'
)
ekey
=
taosTimeAdd
(
ekey
,
pQueryAttr
->
interval
.
sliding
,
pQueryAttr
->
interval
.
slidingUnit
,
pQueryAttr
->
precision
);
...
...
@@ -3180,7 +3184,7 @@ static bool overlapWithTimeWindow(SQueryAttr* pQueryAttr, SDataBlockInfo* pBlock
getAlignQueryTimeWindow
(
pQueryAttr
,
ekey
,
sk
,
ek
,
&
w
);
}
while
(
1
)
{
while
(
1
)
{
if
(
w
.
ekey
<
pBlockInfo
->
window
.
skey
)
{
break
;
}
...
...
@@ -6339,7 +6343,7 @@ SOperatorInfo* createOrderOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorI
SColumnInfoData
col
=
{{
0
}};
col
.
info
.
colId
=
pExpr
[
i
].
base
.
colInfo
.
colId
;
col
.
info
.
bytes
=
pExpr
[
i
].
base
.
resBytes
;
col
.
info
.
type
=
pExpr
[
i
].
base
.
resType
;
col
.
info
.
type
=
pExpr
[
i
].
base
.
resType
;
taosArrayPush
(
pDataBlock
->
pDataBlock
,
&
col
);
if
(
!
found
&&
col
.
info
.
colId
==
pOrderVal
->
orderColId
)
{
...
...
@@ -6874,18 +6878,18 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
break
;
}
}
if
(
pCtx
==
NULL
)
{
goto
group_finished_exit
;
}
TSKEY
*
tsCols
=
NULL
;
if
(
pBlock
&&
pBlock
->
pDataBlock
!=
NULL
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
0
);
tsCols
=
(
int64_t
*
)
pColDataInfo
->
pData
;
assert
(
tsCols
[
0
]
==
pBlock
->
info
.
window
.
skey
&&
tsCols
[
pBlock
->
info
.
rows
-
1
]
==
pBlock
->
info
.
window
.
ekey
);
}
if
(
pCtx
->
startTs
==
INT64_MIN
)
{
if
(
pQueryAttr
->
range
.
skey
==
INT64_MIN
)
{
if
(
NULL
==
tsCols
)
{
...
...
@@ -6984,7 +6988,7 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo
return
false
;
}
int32_t
nRows
=
pBlock
?
pBlock
->
info
.
rows
:
0
;
int32_t
startPos
=
binarySearchForKey
((
char
*
)
tsCols
,
nRows
,
pCtx
->
startTs
,
pQueryAttr
->
order
.
order
);
int32_t
startPos
=
binarySearchForKey
((
char
*
)
tsCols
,
nRows
,
pCtx
->
startTs
,
pQueryAttr
->
order
.
order
);
if
(
ascQuery
&&
pQueryAttr
->
fillType
!=
TSDB_FILL_NEXT
&&
pCtx
->
start
.
key
==
INT64_MIN
)
{
if
(
startPos
<
0
)
{
...
...
@@ -8522,18 +8526,18 @@ SOperatorInfo* createSLimitOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperator
SColIndex
*
idx
=
taosArrayGet
(
pInfo
->
orderColumnList
,
i
);
offset
+=
pExpr
[
idx
->
colIndex
].
base
.
resBytes
;
}
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
if
(
pOperator
==
NULL
)
{
goto
_clean
;
}
pInfo
->
pRes
=
createOutputBuf
(
pExpr
,
numOfOutput
,
pRuntimeEnv
->
resultInfo
.
capacity
);
if
(
pInfo
->
pRes
==
NULL
)
{
tfree
(
pOperator
);
goto
_clean
;
}
pOperator
->
name
=
"SLimitOperator"
;
pOperator
->
operatorType
=
OP_SLimit
;
pOperator
->
blockingOptr
=
false
;
...
...
@@ -10171,7 +10175,8 @@ SQInfo* createQInfoImpl(SQueryTableMsg* pQueryMsg, SGroupbyExpr* pGroupbyExpr, S
pTableqinfo
->
pGroupList
=
taosArrayInit
(
numOfGroups
,
POINTER_BYTES
);
pTableqinfo
->
numOfTables
=
pTableGroupInfo
->
numOfTables
;
pTableqinfo
->
map
=
taosHashInit
(
pTableGroupInfo
->
numOfTables
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_ENTRY_LOCK
);
pTableqinfo
->
map
=
taosHashInit
(
pTableGroupInfo
->
numOfTables
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
true
,
HASH_ENTRY_LOCK
);
}
pQInfo
->
pBuf
=
calloc
(
pTableGroupInfo
->
numOfTables
,
sizeof
(
STableQueryInfo
));
...
...
@@ -10373,7 +10378,7 @@ static void doDestroyTableQueryInfo(STableGroupInfo* pTableqinfoGroupInfo) {
taosArrayDestroy
(
&
pTableqinfoGroupInfo
->
pGroupList
);
SHashObj
*
pmap
=
pTableqinfoGroupInfo
->
map
;
SHashObj
*
pmap
=
pTableqinfoGroupInfo
->
map
;
if
(
pmap
==
atomic_val_compare_exchange_ptr
(
&
pTableqinfoGroupInfo
->
map
,
pmap
,
NULL
))
{
taosHashCleanup
(
pmap
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录