Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f9bc8ff3
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f9bc8ff3
编写于
3月 14, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support the interpolation of query time window
上级
f232dd2a
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
175 addition
and
151 deletion
+175
-151
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+4
-1
src/inc/tinterpolation.h
src/inc/tinterpolation.h
+1
-1
src/inc/tsqlfunction.h
src/inc/tsqlfunction.h
+7
-0
src/system/detail/inc/vnodeQueryImpl.h
src/system/detail/inc/vnodeQueryImpl.h
+0
-6
src/system/detail/inc/vnodeRead.h
src/system/detail/inc/vnodeRead.h
+12
-0
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+151
-143
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
f9bc8ff3
...
@@ -1636,13 +1636,16 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIdx, tSQLExprIt
...
@@ -1636,13 +1636,16 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIdx, tSQLExprIt
// set the first column ts for diff query
// set the first column ts for diff query
if
(
optr
==
TK_DIFF
)
{
if
(
optr
==
TK_DIFF
)
{
colIdx
+=
1
;
colIdx
+=
1
;
SColumnIndex
indexTS
=
{.
tableIndex
=
index
.
tableIndex
,
.
columnIndex
=
0
};
SColumnIndex
indexTS
=
{.
tableIndex
=
index
.
tableIndex
,
.
columnIndex
=
PRIMARYKEY_TIMESTAMP_COL_INDEX
};
SSqlExpr
*
pExpr
=
tscSqlExprInsert
(
pQueryInfo
,
0
,
TSDB_FUNC_TS_DUMMY
,
&
indexTS
,
TSDB_DATA_TYPE_TIMESTAMP
,
SSqlExpr
*
pExpr
=
tscSqlExprInsert
(
pQueryInfo
,
0
,
TSDB_FUNC_TS_DUMMY
,
&
indexTS
,
TSDB_DATA_TYPE_TIMESTAMP
,
TSDB_KEYSIZE
,
TSDB_KEYSIZE
);
TSDB_KEYSIZE
,
TSDB_KEYSIZE
);
SColumnList
ids
=
getColumnList
(
1
,
0
,
0
);
SColumnList
ids
=
getColumnList
(
1
,
0
,
0
);
insertResultField
(
pQueryInfo
,
0
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS_DUMMY
].
aName
,
insertResultField
(
pQueryInfo
,
0
,
&
ids
,
TSDB_KEYSIZE
,
TSDB_DATA_TYPE_TIMESTAMP
,
aAggs
[
TSDB_FUNC_TS_DUMMY
].
aName
,
pExpr
);
pExpr
);
}
else
if
(
optr
==
TK_RATE
)
{
SColumnIndex
index1
=
{.
tableIndex
=
index
.
tableIndex
,
.
columnIndex
=
PRIMARYKEY_TIMESTAMP_COL_INDEX
};
tscColumnBaseInfoInsert
(
pQueryInfo
,
&
index1
);
}
}
// functions can not be applied to tags
// functions can not be applied to tags
...
...
src/inc/tinterpolation.h
浏览文件 @
f9bc8ff3
...
@@ -30,7 +30,7 @@ typedef struct SInterpolationInfo {
...
@@ -30,7 +30,7 @@ typedef struct SInterpolationInfo {
char
*
prevValues
;
// previous row of data
char
*
prevValues
;
// previous row of data
char
*
nextValues
;
// next row of data
char
*
nextValues
;
// next row of data
int32_t
numOfTags
;
int32_t
numOfTags
;
char
**
pTags
;
// tags value for current inter
op
lation
char
**
pTags
;
// tags value for current inter
po
lation
}
SInterpolationInfo
;
}
SInterpolationInfo
;
typedef
struct
SPoint
{
typedef
struct
SPoint
{
...
...
src/inc/tsqlfunction.h
浏览文件 @
f9bc8ff3
...
@@ -167,6 +167,11 @@ typedef struct SExtTagsInfo {
...
@@ -167,6 +167,11 @@ typedef struct SExtTagsInfo {
struct
SQLFunctionCtx
**
pTagCtxList
;
struct
SQLFunctionCtx
**
pTagCtxList
;
}
SExtTagsInfo
;
}
SExtTagsInfo
;
typedef
struct
SBoundaryData
{
TSKEY
key
;
char
*
data
;
}
SBoundaryData
;
// sql function runtime context
// sql function runtime context
typedef
struct
SQLFunctionCtx
{
typedef
struct
SQLFunctionCtx
{
int32_t
startOffset
;
int32_t
startOffset
;
...
@@ -195,6 +200,8 @@ typedef struct SQLFunctionCtx {
...
@@ -195,6 +200,8 @@ typedef struct SQLFunctionCtx {
SResultInfo
*
resultInfo
;
SResultInfo
*
resultInfo
;
SExtTagsInfo
tagInfo
;
SExtTagsInfo
tagInfo
;
SBoundaryData
beforeRow
;
// this value may be less or equalled to the start time of time window
SBoundaryData
afterRow
;
// this value may be greater or equalled to the end time of time window
}
SQLFunctionCtx
;
}
SQLFunctionCtx
;
typedef
struct
SQLAggFuncElem
{
typedef
struct
SQLAggFuncElem
{
...
...
src/system/detail/inc/vnodeQueryImpl.h
浏览文件 @
f9bc8ff3
...
@@ -85,12 +85,6 @@ typedef enum {
...
@@ -85,12 +85,6 @@ typedef enum {
QUERY_NO_DATA_TO_CHECK
=
0x8u
,
QUERY_NO_DATA_TO_CHECK
=
0x8u
,
}
vnodeQueryStatus
;
}
vnodeQueryStatus
;
typedef
struct
SPointInterpoSupporter
{
int32_t
numOfCols
;
char
**
pPrevPoint
;
char
**
pNextPoint
;
}
SPointInterpoSupporter
;
typedef
struct
SBlockInfo
{
typedef
struct
SBlockInfo
{
TSKEY
keyFirst
;
TSKEY
keyFirst
;
TSKEY
keyLast
;
TSKEY
keyLast
;
...
...
src/system/detail/inc/vnodeRead.h
浏览文件 @
f9bc8ff3
...
@@ -141,6 +141,12 @@ typedef struct SWindowResInfo {
...
@@ -141,6 +141,12 @@ typedef struct SWindowResInfo {
int64_t
threshold
;
// threshold for return completed results.
int64_t
threshold
;
// threshold for return completed results.
}
SWindowResInfo
;
}
SWindowResInfo
;
typedef
struct
SPointInterpoSupporter
{
int32_t
numOfCols
;
char
**
pPrevPoint
;
char
**
pNextPoint
;
}
SPointInterpoSupporter
;
typedef
struct
SQueryRuntimeEnv
{
typedef
struct
SQueryRuntimeEnv
{
SPositionInfo
startPos
;
/* the start position, used for secondary/third iteration */
SPositionInfo
startPos
;
/* the start position, used for secondary/third iteration */
SPositionInfo
endPos
;
/* the last access position in query, served as the start pos of reversed order query */
SPositionInfo
endPos
;
/* the last access position in query, served as the start pos of reversed order query */
...
@@ -166,6 +172,9 @@ typedef struct SQueryRuntimeEnv {
...
@@ -166,6 +172,9 @@ typedef struct SQueryRuntimeEnv {
SWindowResInfo
windowResInfo
;
SWindowResInfo
windowResInfo
;
// require time stamp that are direct before/after query time window
bool
boundaryExternalTS
;
STSBuf
*
pTSBuf
;
STSBuf
*
pTSBuf
;
STSCursor
cur
;
STSCursor
cur
;
SQueryCostSummary
summary
;
SQueryCostSummary
summary
;
...
@@ -179,6 +188,9 @@ typedef struct SQueryRuntimeEnv {
...
@@ -179,6 +188,9 @@ typedef struct SQueryRuntimeEnv {
* So we keep a copy of the support structure as well as the cache block data itself.
* So we keep a copy of the support structure as well as the cache block data itself.
*/
*/
SCacheBlock
cacheBlock
;
SCacheBlock
cacheBlock
;
SPointInterpoSupporter
*
pInterpoSupporter
;
bool
hasTimeWindow
;
}
SQueryRuntimeEnv
;
}
SQueryRuntimeEnv
;
/* intermediate pos during multimeter query involves interval */
/* intermediate pos during multimeter query involves interval */
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
f9bc8ff3
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录