Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
411371ba
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看板
提交
411371ba
编写于
11月 09, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
dc67c504
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
13 deletion
+31
-13
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-2
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+29
-11
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
411371ba
...
...
@@ -973,7 +973,7 @@ static void copyNumericCols(const SColData* pData, SFileBlockDumpInfo* pDumpInfo
int32_t
mid
=
dumpedRows
>>
1u
;
int8_t
*
pts
=
(
int8_t
*
)
pColData
->
pData
;
for
(
int32_t
j
=
0
;
j
<
mid
;
++
j
)
{
int
64
_t
t
=
pts
[
j
];
int
8
_t
t
=
pts
[
j
];
pts
[
j
]
=
pts
[
dumpedRows
-
j
-
1
];
pts
[
dumpedRows
-
j
-
1
]
=
t
;
}
...
...
@@ -998,7 +998,7 @@ static void copyNumericCols(const SColData* pData, SFileBlockDumpInfo* pDumpInfo
int32_t
mid
=
dumpedRows
>>
1u
;
int32_t
*
pts
=
(
int32_t
*
)
pColData
->
pData
;
for
(
int32_t
j
=
0
;
j
<
mid
;
++
j
)
{
int
64
_t
t
=
pts
[
j
];
int
32
_t
t
=
pts
[
j
];
pts
[
j
]
=
pts
[
dumpedRows
-
j
-
1
];
pts
[
dumpedRows
-
j
-
1
]
=
t
;
}
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
411371ba
...
...
@@ -3096,18 +3096,36 @@ int32_t lastFunction(SqlFunctionCtx* pCtx) {
}
#else
int64_t
*
pts
=
(
int64_t
*
)
pInput
->
pPTS
->
pData
;
for
(
int32_t
i
=
pInput
->
startRowIndex
;
i
<
pInput
->
numOfRows
+
pInput
->
startRowIndex
;
++
i
)
{
if
(
pInputCol
->
hasNull
&&
colDataIsNull
(
pInputCol
,
pInput
->
totalRows
,
i
,
pColAgg
))
{
continue
;
if
(
IS_VAR_DATA_TYPE
(
pInputCol
->
info
.
type
))
{
for
(
int32_t
i
=
pInput
->
startRowIndex
;
i
<
pInput
->
numOfRows
+
pInput
->
startRowIndex
;
++
i
)
{
if
(
pInputCol
->
hasNull
&&
colDataIsNull
(
pInputCol
,
pInput
->
totalRows
,
i
,
pColAgg
))
{
continue
;
}
numOfElems
++
;
char
*
data
=
colDataGetVarData
(
pInputCol
,
i
);
TSKEY
cts
=
pts
[
i
];
if
(
pResInfo
->
numOfRes
==
0
||
pInfo
->
ts
<
cts
)
{
doSaveCurrentVal
(
pCtx
,
i
,
cts
,
type
,
data
);
pResInfo
->
numOfRes
=
1
;
}
}
}
else
{
for
(
int32_t
i
=
pInput
->
startRowIndex
;
i
<
pInput
->
numOfRows
+
pInput
->
startRowIndex
;
++
i
)
{
if
(
pInputCol
->
hasNull
&&
colDataIsNull
(
pInputCol
,
pInput
->
totalRows
,
i
,
pColAgg
))
{
continue
;
}
numOfElems
++
;
numOfElems
++
;
char
*
data
=
colDataGetData
(
pInputCol
,
i
);
TSKEY
cts
=
pts
[
i
];
if
(
pResInfo
->
numOfRes
==
0
||
pInfo
->
ts
<
cts
)
{
doSaveCurrentVal
(
pCtx
,
i
,
cts
,
type
,
data
);
pResInfo
->
numOfRes
=
1
;
char
*
data
=
colDataGetNumData
(
pInputCol
,
i
);
TSKEY
cts
=
pts
[
i
];
if
(
pResInfo
->
numOfRes
==
0
||
pInfo
->
ts
<
cts
)
{
doSaveCurrentVal
(
pCtx
,
i
,
cts
,
type
,
data
);
pResInfo
->
numOfRes
=
1
;
}
}
}
#endif
...
...
@@ -3266,8 +3284,8 @@ int32_t lastRowFunction(SqlFunctionCtx* pCtx) {
#if 0
int32_t blockDataOrder = (startKey <= endKey) ? TSDB_ORDER_ASC : TSDB_ORDER_DESC;
// the optimized version only
function
if all tuples in one block are monotonious increasing or descreasing.
// this is NOT always works if project operator exists in downstream.
// the optimized version only
valid
if all tuples in one block are monotonious increasing or descreasing.
// this
assumption
is NOT always works if project operator exists in downstream.
if (blockDataOrder == TSDB_ORDER_ASC) {
for (int32_t i = pInput->numOfRows + pInput->startRowIndex - 1; i >= pInput->startRowIndex; --i) {
char* data = colDataGetData(pInputCol, i);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录