Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
211985f0
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看板
提交
211985f0
编写于
7月 07, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
92276bfa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
9 deletion
+24
-9
include/common/tcommon.h
include/common/tcommon.h
+0
-2
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+3
-3
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+18
-2
tests/system-test/failed.txt
tests/system-test/failed.txt
+1
-0
未找到文件。
include/common/tcommon.h
浏览文件 @
211985f0
...
...
@@ -88,8 +88,6 @@ typedef struct {
#pragma pack(push, 1)
typedef
struct
SColumnDataAgg
{
int16_t
colId
;
int16_t
minIndex
;
int16_t
maxIndex
;
int16_t
numOfNull
;
int64_t
sum
;
int64_t
max
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
211985f0
...
...
@@ -2801,11 +2801,11 @@ int32_t tsdbRetrieveDatablockSMA(STsdbReader* pReader, SColumnDataAgg*** pBlockS
if
(
pAgg
->
colId
==
pSup
->
colIds
[
j
])
{
if
(
IS_BSMA_ON
(
&
(
pReader
->
pSchema
->
columns
[
i
])))
{
pSup
->
plist
[
j
]
=
pAgg
;
i
+=
1
;
j
+=
1
;
}
else
{
*
allHave
=
false
;
}
i
+=
1
;
j
+=
1
;
}
else
if
(
pAgg
->
colId
<
pSup
->
colIds
[
j
])
{
i
+=
1
;
}
else
if
(
pSup
->
colIds
[
j
]
<
pAgg
->
colId
)
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
211985f0
...
...
@@ -741,10 +741,10 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
int64_t
v
=
pFuncParam
->
param
.
i
;
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
min
=
v
,
.
max
=
v
,
.
maxIndex
=
0
,
.
minIndex
=
0
,
.
sum
=
v
*
numOfRows
};
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
min
=
v
,
.
max
=
v
,
.
sum
=
v
*
numOfRows
};
}
else
if
(
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
double
v
=
pFuncParam
->
param
.
d
;
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
maxIndex
=
0
,
.
minIndex
=
0
};
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
};
*
(
double
*
)
&
da
->
min
=
v
;
*
(
double
*
)
&
da
->
max
=
v
;
...
...
@@ -752,7 +752,7 @@ static int32_t doCreateConstantValColumnAggInfo(SInputColumnInfoData* pInput, SF
}
else
if
(
type
==
TSDB_DATA_TYPE_BOOL
)
{
// todo validate this data type
bool
v
=
pFuncParam
->
param
.
i
;
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
,
.
maxIndex
=
0
,
.
minIndex
=
0
};
*
da
=
(
SColumnDataAgg
){.
numOfNull
=
0
};
*
(
bool
*
)
&
da
->
min
=
0
;
*
(
bool
*
)
&
da
->
max
=
v
;
*
(
bool
*
)
&
da
->
sum
=
v
*
numOfRows
;
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
211985f0
...
...
@@ -1080,6 +1080,19 @@ bool getMinmaxFuncEnv(SFunctionNode* UNUSED_PARAM(pFunc), SFuncExecEnv* pEnv) {
static
void
saveTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
);
static
void
copyTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
);
static
int32_t
findRowIndex
(
int32_t
start
,
int32_t
num
,
SColumnInfoData
*
pCol
,
const
char
*
tval
)
{
// the data is loaded, not only the block SMA value
for
(
int32_t
i
=
start
;
i
<
num
+
start
;
++
i
)
{
char
*
p
=
colDataGetData
(
pCol
,
i
);
if
(
memcpy
((
void
*
)
tval
,
p
,
pCol
->
info
.
bytes
)
==
0
)
{
return
i
;
}
}
ASSERT
(
0
);
}
int32_t
doMinMaxHelper
(
SqlFunctionCtx
*
pCtx
,
int32_t
isMinFunc
)
{
int32_t
numOfElems
=
0
;
...
...
@@ -1111,15 +1124,14 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
(
isMinFunc
)
{
tval
=
&
pInput
->
pColumnDataAgg
[
0
]
->
min
;
index
=
pInput
->
pColumnDataAgg
[
0
]
->
minIndex
;
}
else
{
tval
=
&
pInput
->
pColumnDataAgg
[
0
]
->
max
;
index
=
pInput
->
pColumnDataAgg
[
0
]
->
maxIndex
;
}
if
(
!
pBuf
->
assign
)
{
pBuf
->
v
=
*
(
int64_t
*
)
tval
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
else
{
...
...
@@ -1131,6 +1143,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
((
prev
<
val
)
^
isMinFunc
)
{
pBuf
->
v
=
val
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
...
...
@@ -1143,6 +1156,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
((
prev
<
val
)
^
isMinFunc
)
{
pBuf
->
v
=
val
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
...
...
@@ -1154,6 +1168,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
if
((
prev
<
val
)
^
isMinFunc
)
{
pBuf
->
v
=
val
;
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
...
...
@@ -1167,6 +1182,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
}
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
index
=
findRowIndex
(
pInput
->
startRowIndex
,
pInput
->
numOfRows
,
pCol
,
tval
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pBuf
->
tuplePos
);
}
}
...
...
tests/system-test/failed.txt
0 → 100644
浏览文件 @
211985f0
#python3 ./test.py -f 2-query/last.py -Q 3
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录