Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ef89a31e
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看板
提交
ef89a31e
编写于
2月 03, 2023
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: force fill function
上级
d5bc02c1
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
3234 addition
and
2660 deletion
+3234
-2660
include/common/ttokendef.h
include/common/ttokendef.h
+324
-321
source/libs/executor/inc/tfill.h
source/libs/executor/inc/tfill.h
+0
-1
source/libs/executor/src/filloperator.c
source/libs/executor/src/filloperator.c
+3
-3
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+4
-5
source/libs/executor/src/timesliceoperator.c
source/libs/executor/src/timesliceoperator.c
+4
-2
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+2
-0
source/libs/parser/src/sql.c
source/libs/parser/src/sql.c
+2897
-2328
未找到文件。
include/common/ttokendef.h
浏览文件 @
ef89a31e
此差异已折叠。
点击以展开。
source/libs/executor/inc/tfill.h
浏览文件 @
ef89a31e
...
...
@@ -62,7 +62,6 @@ typedef struct SFillInfo {
int32_t
srcTsSlotId
;
// timestamp column id in the source data block.
int32_t
order
;
// order [TSDB_ORDER_ASC|TSDB_ORDER_DESC]
int32_t
type
;
// fill type
bool
forceFill
;
// force fill values
int32_t
numOfRows
;
// number of rows in the input data block
int32_t
index
;
// active row index
int32_t
numOfTotal
;
// number of filled rows in one round
...
...
source/libs/executor/src/filloperator.c
浏览文件 @
ef89a31e
...
...
@@ -140,7 +140,7 @@ static SSDataBlock* doFillImpl(SOperatorInfo* pOperator) {
while
(
1
)
{
SSDataBlock
*
pBlock
=
pDownstream
->
fpSet
.
getNextFn
(
pDownstream
);
if
(
pBlock
==
NULL
)
{
if
(
pInfo
->
totalInputRows
==
0
&&
!
pInfo
->
pFillInfo
->
forceFill
)
{
if
(
pInfo
->
totalInputRows
==
0
&&
(
pInfo
->
pFillInfo
->
type
!=
TSDB_FILL_NULL_F
&&
pInfo
->
pFillInfo
->
type
!=
TSDB_FILL_SET_VALUE_F
)
)
{
setOperatorCompleted
(
pOperator
);
return
NULL
;
}
...
...
@@ -456,7 +456,7 @@ void* destroyStreamFillLinearInfo(SStreamFillLinearInfo* pFillLinear) {
return
NULL
;
}
void
*
destroyStreamFillInfo
(
SStreamFillInfo
*
pFillInfo
)
{
if
(
pFillInfo
->
type
==
TSDB_FILL_SET_VALUE
||
pFillInfo
->
type
==
TSDB_FILL_SET_VALUE_F
if
(
pFillInfo
->
type
==
TSDB_FILL_SET_VALUE
||
pFillInfo
->
type
==
TSDB_FILL_SET_VALUE_F
||
pFillInfo
->
type
==
TSDB_FILL_NULL
||
pFillInfo
->
type
==
TSDB_FILL_NULL_F
)
{
taosMemoryFreeClear
(
pFillInfo
->
pResRow
->
pRowVal
);
taosMemoryFreeClear
(
pFillInfo
->
pResRow
);
...
...
@@ -1433,7 +1433,7 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
pCell
->
isNull
=
true
;
}
}
}
else
if
(
pInfo
->
pFillInfo
->
type
==
TSDB_FILL_NULL
)
{
}
else
if
(
pInfo
->
pFillInfo
->
type
==
TSDB_FILL_NULL
||
pInfo
->
pFillInfo
->
type
==
TSDB_FILL_NULL_F
)
{
for
(
int32_t
i
=
0
;
i
<
pInfo
->
pFillSup
->
numOfAllCols
;
++
i
)
{
SFillColInfo
*
pFillCol
=
pInfo
->
pFillSup
->
pAllColInfo
+
i
;
int32_t
slotId
=
GET_DEST_SLOT_ID
(
pFillCol
);
...
...
source/libs/executor/src/tfill.c
浏览文件 @
ef89a31e
...
...
@@ -186,7 +186,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
}
}
}
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NULL
)
{
// fill with NULL
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NULL
||
pFillInfo
->
type
==
TSDB_FILL_NULL_F
)
{
// fill with NULL
setNullRow
(
pBlock
,
pFillInfo
,
index
);
}
else
{
// fill with user specified value for each column
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
...
...
@@ -349,7 +349,7 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
bool
isNull
=
colDataIsNull_s
(
pSrc
,
pFillInfo
->
index
);
colDataAppend
(
pDst
,
index
,
src
,
isNull
);
saveColData
(
pFillInfo
->
prev
.
pRowVal
,
i
,
src
,
isNull
);
// todo:
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NULL
)
{
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NULL
||
pFillInfo
->
type
==
TSDB_FILL_NULL_F
)
{
colDataAppendNULL
(
pDst
,
index
);
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NEXT
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
next
.
pRowVal
:
pFillInfo
->
prev
.
pRowVal
;
...
...
@@ -578,15 +578,14 @@ bool taosFillHasMoreResults(SFillInfo* pFillInfo) {
}
int64_t
getNumOfResultsAfterFillGap
(
SFillInfo
*
pFillInfo
,
TSKEY
ekey
,
int32_t
maxNumOfRows
)
{
SColumnInfoData
*
pCol
=
taosArrayGet
(
pFillInfo
->
pSrcBlock
->
pDataBlock
,
pFillInfo
->
srcTsSlotId
);
int64_t
*
tsList
=
(
int64_t
*
)
pCol
->
pData
;
int32_t
numOfRows
=
taosNumOfRemainRows
(
pFillInfo
);
TSKEY
ekey1
=
ekey
;
int64_t
numOfRes
=
-
1
;
if
(
numOfRows
>
0
)
{
// still fill gap within current data block, not generating data after the result set.
SColumnInfoData
*
pCol
=
taosArrayGet
(
pFillInfo
->
pSrcBlock
->
pDataBlock
,
pFillInfo
->
srcTsSlotId
);
int64_t
*
tsList
=
(
int64_t
*
)
pCol
->
pData
;
TSKEY
lastKey
=
tsList
[
pFillInfo
->
numOfRows
-
1
];
numOfRes
=
taosTimeCountInterval
(
lastKey
,
pFillInfo
->
currentKey
,
pFillInfo
->
interval
.
sliding
,
pFillInfo
->
interval
.
slidingUnit
,
pFillInfo
->
interval
.
precision
);
...
...
source/libs/executor/src/timesliceoperator.c
浏览文件 @
ef89a31e
...
...
@@ -181,12 +181,14 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
int32_t
srcSlot
=
pExprInfo
->
base
.
pParam
[
0
].
pCol
->
slotId
;
switch
(
pSliceInfo
->
fillType
)
{
case
TSDB_FILL_NULL
:
{
case
TSDB_FILL_NULL
:
case
TSDB_FILL_NULL_F
:
{
colDataAppendNULL
(
pDst
,
rows
);
break
;
}
case
TSDB_FILL_SET_VALUE
:
{
case
TSDB_FILL_SET_VALUE
:
case
TSDB_FILL_SET_VALUE_F
:
{
SVariant
*
pVar
=
&
pSliceInfo
->
pFillColInfo
[
j
].
fillVal
;
if
(
pDst
->
info
.
type
==
TSDB_DATA_TYPE_FLOAT
)
{
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
ef89a31e
...
...
@@ -148,6 +148,7 @@ static SKeyword keywordTable[] = {
{
"NOT"
,
TK_NOT
},
{
"NOW"
,
TK_NOW
},
{
"NULL"
,
TK_NULL
},
{
"NULL_F"
,
TK_NULL_F
},
{
"NULLS"
,
TK_NULLS
},
{
"OFFSET"
,
TK_OFFSET
},
{
"ON"
,
TK_ON
},
...
...
@@ -237,6 +238,7 @@ static SKeyword keywordTable[] = {
{
"USERS"
,
TK_USERS
},
{
"USING"
,
TK_USING
},
{
"VALUE"
,
TK_VALUE
},
{
"VALUE_F"
,
TK_VALUE_F
},
{
"VALUES"
,
TK_VALUES
},
{
"VARCHAR"
,
TK_VARCHAR
},
{
"VARIABLES"
,
TK_VARIABLES
},
...
...
source/libs/parser/src/sql.c
浏览文件 @
ef89a31e
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录