Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3078e2d4
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看板
提交
3078e2d4
编写于
4月 10, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(query): INTERP support boolean type
上级
7a832dbc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
7 deletion
+30
-7
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+7
-2
source/libs/executor/src/timesliceoperator.c
source/libs/executor/src/timesliceoperator.c
+22
-4
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+1
-1
未找到文件。
source/libs/executor/src/tfill.c
浏览文件 @
3078e2d4
...
@@ -44,7 +44,7 @@ static void setNotFillColumn(SFillInfo* pFillInfo, SColumnInfoData* pDstColInfo,
...
@@ -44,7 +44,7 @@ static void setNotFillColumn(SFillInfo* pFillInfo, SColumnInfoData* pDstColInfo,
}
else
{
}
else
{
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
&
pFillInfo
->
prev
:
&
pFillInfo
->
next
;
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
&
pFillInfo
->
prev
:
&
pFillInfo
->
next
;
}
}
SGroupKeys
*
pKey
=
taosArrayGet
(
p
->
pRowVal
,
colIdx
);
SGroupKeys
*
pKey
=
taosArrayGet
(
p
->
pRowVal
,
colIdx
);
doSetVal
(
pDstColInfo
,
rowIndex
,
pKey
);
doSetVal
(
pDstColInfo
,
rowIndex
,
pKey
);
}
}
...
@@ -578,7 +578,12 @@ int32_t taosGetLinearInterpolationVal(SPoint* point, int32_t outputType, SPoint*
...
@@ -578,7 +578,12 @@ int32_t taosGetLinearInterpolationVal(SPoint* point, int32_t outputType, SPoint*
GET_TYPED_DATA
(
v1
,
double
,
inputType
,
point1
->
val
);
GET_TYPED_DATA
(
v1
,
double
,
inputType
,
point1
->
val
);
GET_TYPED_DATA
(
v2
,
double
,
inputType
,
point2
->
val
);
GET_TYPED_DATA
(
v2
,
double
,
inputType
,
point2
->
val
);
double
r
=
DO_INTERPOLATION
(
v1
,
v2
,
point1
->
key
,
point2
->
key
,
point
->
key
);
double
r
=
0
;
if
(
!
IS_BOOLEAN_TYPE
(
inputType
))
{
r
=
DO_INTERPOLATION
(
v1
,
v2
,
point1
->
key
,
point2
->
key
,
point
->
key
);
}
else
{
r
=
(
v1
<
1
||
v2
<
1
)
?
0
:
1
;
}
SET_TYPED_DATA
(
point
->
val
,
outputType
,
r
);
SET_TYPED_DATA
(
point
->
val
,
outputType
,
r
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/executor/src/timesliceoperator.c
浏览文件 @
3078e2d4
...
@@ -156,6 +156,16 @@ static FORCE_INLINE int32_t timeSliceEnsureBlockCapacity(STimeSliceOperatorInfo*
...
@@ -156,6 +156,16 @@ static FORCE_INLINE int32_t timeSliceEnsureBlockCapacity(STimeSliceOperatorInfo*
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
static
bool
isIrowtsPseudoColumn
(
SExprInfo
*
pExprInfo
)
{
char
*
name
=
pExprInfo
->
pExpr
->
_function
.
functionName
;
return
(
IS_TIMESTAMP_TYPE
(
pExprInfo
->
base
.
resSchema
.
type
)
&&
strcasecmp
(
name
,
"_irowts"
)
==
0
);
}
static
bool
isIsfilledPseudoColumn
(
SExprInfo
*
pExprInfo
)
{
char
*
name
=
pExprInfo
->
pExpr
->
_function
.
functionName
;
return
(
IS_BOOLEAN_TYPE
(
pExprInfo
->
base
.
resSchema
.
type
)
&&
strcasecmp
(
name
,
"_isfilled"
)
==
0
);
}
static
bool
genInterpolationResult
(
STimeSliceOperatorInfo
*
pSliceInfo
,
SExprSupp
*
pExprSup
,
SSDataBlock
*
pResBlock
,
static
bool
genInterpolationResult
(
STimeSliceOperatorInfo
*
pSliceInfo
,
SExprSupp
*
pExprSup
,
SSDataBlock
*
pResBlock
,
bool
beforeTs
)
{
bool
beforeTs
)
{
int32_t
rows
=
pResBlock
->
info
.
rows
;
int32_t
rows
=
pResBlock
->
info
.
rows
;
...
@@ -170,10 +180,10 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
...
@@ -170,10 +180,10 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
int32_t
dstSlot
=
pExprInfo
->
base
.
resSchema
.
slotId
;
int32_t
dstSlot
=
pExprInfo
->
base
.
resSchema
.
slotId
;
SColumnInfoData
*
pDst
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
dstSlot
);
SColumnInfoData
*
pDst
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
dstSlot
);
if
(
IS_TIMESTAMP_TYPE
(
pExprInfo
->
base
.
resSchema
.
type
))
{
if
(
isIrowtsPseudoColumn
(
pExprInfo
))
{
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
pSliceInfo
->
current
,
false
);
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
pSliceInfo
->
current
,
false
);
continue
;
continue
;
}
else
if
(
IS_BOOLEAN_TYPE
(
pExprInfo
->
base
.
resSchema
.
type
))
{
}
else
if
(
isIsfilledPseudoColumn
(
pExprInfo
))
{
bool
isFilled
=
true
;
bool
isFilled
=
true
;
colDataAppend
(
pDst
,
pResBlock
->
info
.
rows
,
(
char
*
)
&
isFilled
,
false
);
colDataAppend
(
pDst
,
pResBlock
->
info
.
rows
,
(
char
*
)
&
isFilled
,
false
);
continue
;
continue
;
...
@@ -203,6 +213,14 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
...
@@ -203,6 +213,14 @@ static bool genInterpolationResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp
int64_t
v
=
0
;
int64_t
v
=
0
;
GET_TYPED_DATA
(
v
,
int64_t
,
pVar
->
nType
,
&
pVar
->
i
);
GET_TYPED_DATA
(
v
,
int64_t
,
pVar
->
nType
,
&
pVar
->
i
);
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
}
else
if
(
IS_BOOLEAN_TYPE
(
pDst
->
info
.
type
))
{
bool
v
=
false
;
if
(
!
IS_VAR_DATA_TYPE
(
pVar
->
nType
))
{
GET_TYPED_DATA
(
v
,
bool
,
pVar
->
nType
,
&
pVar
->
i
);
}
else
{
v
=
taosStr2Int8
(
varDataVal
(
pVar
->
pz
),
NULL
,
10
);
}
colDataSetVal
(
pDst
,
rows
,
(
char
*
)
&
v
,
false
);
}
}
break
;
break
;
}
}
...
@@ -288,9 +306,9 @@ static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp*
...
@@ -288,9 +306,9 @@ static void addCurrentRowToResult(STimeSliceOperatorInfo* pSliceInfo, SExprSupp*
int32_t
dstSlot
=
pExprInfo
->
base
.
resSchema
.
slotId
;
int32_t
dstSlot
=
pExprInfo
->
base
.
resSchema
.
slotId
;
SColumnInfoData
*
pDst
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
dstSlot
);
SColumnInfoData
*
pDst
=
taosArrayGet
(
pResBlock
->
pDataBlock
,
dstSlot
);
if
(
IS_TIMESTAMP_TYPE
(
pExprInfo
->
base
.
resSchema
.
type
))
{
if
(
isIrowtsPseudoColumn
(
pExprInfo
))
{
colDataSetVal
(
pDst
,
pResBlock
->
info
.
rows
,
(
char
*
)
&
pSliceInfo
->
current
,
false
);
colDataSetVal
(
pDst
,
pResBlock
->
info
.
rows
,
(
char
*
)
&
pSliceInfo
->
current
,
false
);
}
else
if
(
IS_BOOLEAN_TYPE
(
pExprInfo
->
base
.
resSchema
.
type
))
{
}
else
if
(
isIsfilledPseudoColumn
(
pExprInfo
))
{
bool
isFilled
=
false
;
bool
isFilled
=
false
;
colDataSetVal
(
pDst
,
pResBlock
->
info
.
rows
,
(
char
*
)
&
isFilled
,
false
);
colDataSetVal
(
pDst
,
pResBlock
->
info
.
rows
,
(
char
*
)
&
isFilled
,
false
);
}
else
{
}
else
{
...
...
source/libs/function/src/builtins.c
浏览文件 @
3078e2d4
...
@@ -1575,7 +1575,7 @@ static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
...
@@ -1575,7 +1575,7 @@ static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
uint8_t
nodeType
=
nodeType
(
nodesListGetNode
(
pFunc
->
pParameterList
,
0
));
uint8_t
nodeType
=
nodeType
(
nodesListGetNode
(
pFunc
->
pParameterList
,
0
));
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
||
QUERY_NODE_VALUE
==
nodeType
)
{
if
(
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_BOOLEAN_TYPE
(
paraType
))
||
QUERY_NODE_VALUE
==
nodeType
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录