Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a160b2dc
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
a160b2dc
编写于
4月 07, 2020
作者:
P
plum-lihui
提交者:
GitHub
4月 07, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1545 from taosdata/feature/liaohj
Feature/liaohj
上级
3604ccdf
985c6af9
变更
15
展开全部
隐藏空白更改
内联
并排
Showing
15 changed file
with
755 addition
and
256 deletion
+755
-256
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+146
-57
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+10
-5
src/client/src/tscSecondaryMerge.c
src/client/src/tscSecondaryMerge.c
+6
-6
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/connector/go
src/connector/go
+0
-1
src/inc/taosmsg.h
src/inc/taosmsg.h
+1
-1
src/inc/tinterpolation.h
src/inc/tinterpolation.h
+3
-1
src/inc/tsqlfunction.h
src/inc/tsqlfunction.h
+7
-0
src/system/detail/inc/vnode.h
src/system/detail/inc/vnode.h
+1
-1
src/system/detail/inc/vnodeQueryImpl.h
src/system/detail/inc/vnodeQueryImpl.h
+1
-6
src/system/detail/inc/vnodeRead.h
src/system/detail/inc/vnodeRead.h
+10
-0
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+520
-171
src/system/detail/src/vnodeRead.c
src/system/detail/src/vnodeRead.c
+1
-1
src/util/src/tinterpolation.c
src/util/src/tinterpolation.c
+47
-4
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
a160b2dc
...
@@ -197,7 +197,7 @@ typedef struct SDataBlockList {
...
@@ -197,7 +197,7 @@ typedef struct SDataBlockList {
typedef
struct
SQueryInfo
{
typedef
struct
SQueryInfo
{
int16_t
command
;
// the command may be different for each subclause, so keep it seperately.
int16_t
command
;
// the command may be different for each subclause, so keep it seperately.
uint16_t
type
;
// query/insert/import type
uint16_t
type
;
// query/insert/import type
char
interval
TimeUnit
;
char
sliding
TimeUnit
;
int64_t
etime
,
stime
;
int64_t
etime
,
stime
;
int64_t
intervalTime
;
// aggregation time interval
int64_t
intervalTime
;
// aggregation time interval
...
...
src/client/src/tscFunctionImpl.c
浏览文件 @
a160b2dc
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "thistogram.h"
#include "thistogram.h"
#include "tinterpolation.h"
#include "tinterpolation.h"
#include "tlog.h"
#include "tlog.h"
#include "tpercentile.h"
#include "tscJoinProcess.h"
#include "tscJoinProcess.h"
#include "tscSyntaxtreefunction.h"
#include "tscSyntaxtreefunction.h"
#include "tscompression.h"
#include "tscompression.h"
...
@@ -27,7 +28,6 @@
...
@@ -27,7 +28,6 @@
#include "ttime.h"
#include "ttime.h"
#include "ttypes.h"
#include "ttypes.h"
#include "tutil.h"
#include "tutil.h"
#include "tpercentile.h"
#define GET_INPUT_CHAR(x) (((char *)((x)->aInputElemBuf)) + ((x)->startOffset) * ((x)->inputBytes))
#define GET_INPUT_CHAR(x) (((char *)((x)->aInputElemBuf)) + ((x)->startOffset) * ((x)->inputBytes))
#define GET_INPUT_CHAR_INDEX(x, y) (GET_INPUT_CHAR(x) + (y) * (x)->inputBytes)
#define GET_INPUT_CHAR_INDEX(x, y) (GET_INPUT_CHAR(x) + (y) * (x)->inputBytes)
...
@@ -4104,8 +4104,6 @@ static void twa_function(SQLFunctionCtx *pCtx) {
...
@@ -4104,8 +4104,6 @@ static void twa_function(SQLFunctionCtx *pCtx) {
if
(
pResInfo
->
superTableQ
)
{
if
(
pResInfo
->
superTableQ
)
{
memcpy
(
pCtx
->
aOutputBuf
,
pInfo
,
sizeof
(
STwaInfo
));
memcpy
(
pCtx
->
aOutputBuf
,
pInfo
,
sizeof
(
STwaInfo
));
}
}
// pCtx->numOfIteratedElems += notNullElems;
}
}
static
void
twa_function_f
(
SQLFunctionCtx
*
pCtx
,
int32_t
index
)
{
static
void
twa_function_f
(
SQLFunctionCtx
*
pCtx
,
int32_t
index
)
{
...
@@ -4138,7 +4136,6 @@ static void twa_function_f(SQLFunctionCtx *pCtx, int32_t index) {
...
@@ -4138,7 +4136,6 @@ static void twa_function_f(SQLFunctionCtx *pCtx, int32_t index) {
pInfo
->
lastKey
=
primaryKey
[
index
];
pInfo
->
lastKey
=
primaryKey
[
index
];
setTWALastVal
(
pCtx
,
pData
,
0
,
pInfo
);
setTWALastVal
(
pCtx
,
pData
,
0
,
pInfo
);
// pCtx->numOfIteratedElems += 1;
pResInfo
->
hasResult
=
DATA_SET_FLAG
;
pResInfo
->
hasResult
=
DATA_SET_FLAG
;
if
(
pResInfo
->
superTableQ
)
{
if
(
pResInfo
->
superTableQ
)
{
...
@@ -4403,10 +4400,8 @@ static double do_calc_rate(const SRateInfo* pRateInfo) {
...
@@ -4403,10 +4400,8 @@ static double do_calc_rate(const SRateInfo* pRateInfo) {
}
}
}
}
int64_t
duration
=
pRateInfo
->
lastKey
-
pRateInfo
->
firstKey
;
double
duration
=
(
pRateInfo
->
lastKey
-
pRateInfo
->
firstKey
)
/
1000
.
0
;
duration
=
(
duration
+
500
)
/
1000
;
double
resultVal
=
diff
/
duration
;
double
resultVal
=
((
double
)
diff
)
/
duration
;
pTrace
(
"do_calc_rate() isIRate:%d firstKey:%"
PRId64
" lastKey:%"
PRId64
" firstValue:%f lastValue:%f CorrectionValue:%f resultVal:%f"
,
pTrace
(
"do_calc_rate() isIRate:%d firstKey:%"
PRId64
" lastKey:%"
PRId64
" firstValue:%f lastValue:%f CorrectionValue:%f resultVal:%f"
,
pRateInfo
->
isIRate
,
pRateInfo
->
firstKey
,
pRateInfo
->
lastKey
,
pRateInfo
->
firstValue
,
pRateInfo
->
lastValue
,
pRateInfo
->
CorrectionValue
,
resultVal
);
pRateInfo
->
isIRate
,
pRateInfo
->
firstKey
,
pRateInfo
->
lastKey
,
pRateInfo
->
firstValue
,
pRateInfo
->
lastValue
,
pRateInfo
->
CorrectionValue
,
resultVal
);
...
@@ -4447,62 +4442,156 @@ static void rate_function(SQLFunctionCtx *pCtx) {
...
@@ -4447,62 +4442,156 @@ static void rate_function(SQLFunctionCtx *pCtx) {
TSKEY
*
primaryKey
=
pCtx
->
ptsList
;
TSKEY
*
primaryKey
=
pCtx
->
ptsList
;
pTrace
(
"%p rate_function() size:%d, hasNull:%d"
,
pCtx
,
pCtx
->
size
,
pCtx
->
hasNull
);
pTrace
(
"%p rate_function() size:%d, hasNull:%d"
,
pCtx
,
pCtx
->
size
,
pCtx
->
hasNull
);
for
(
int32_t
i
=
0
;
i
<
pCtx
->
size
;
++
i
)
{
if
(
pCtx
->
order
==
TSQL_SO_ASC
)
{
char
*
pData
=
GET_INPUT_CHAR_INDEX
(
pCtx
,
i
);
// prev interpolation exists
if
(
pCtx
->
hasNull
&&
isNull
(
pData
,
pCtx
->
inputType
))
{
if
(
pCtx
->
prev
.
key
!=
-
1
)
{
pTrace
(
"%p rate_function() index of null data:%d"
,
pCtx
,
i
);
pRateInfo
->
firstValue
=
pCtx
->
prev
.
data
;
continue
;
pRateInfo
->
firstKey
=
pCtx
->
prev
.
key
;
pCtx
->
prev
.
key
=
-
1
;
// clear the flag
}
}
notNullElems
++
;
for
(
int32_t
i
=
0
;
i
<
pCtx
->
size
;
++
i
)
{
char
*
pData
=
GET_INPUT_CHAR_INDEX
(
pCtx
,
i
);
if
(
pCtx
->
hasNull
&&
isNull
(
pData
,
pCtx
->
inputType
))
{
pTrace
(
"%p rate_function() index of null data:%d"
,
pCtx
,
i
);
continue
;
}
double
v
=
0
;
notNullElems
++
;
switch
(
pCtx
->
inputType
)
{
case
TSDB_DATA_TYPE_TINYINT
:
double
v
=
0
;
v
=
(
double
)
GET_INT8_VAL
(
pData
);
switch
(
pCtx
->
inputType
)
{
break
;
case
TSDB_DATA_TYPE_TINYINT
:
case
TSDB_DATA_TYPE_SMALLINT
:
v
=
(
double
)
GET_INT8_VAL
(
pData
);
v
=
(
double
)
GET_INT16_VAL
(
pData
);
break
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
case
TSDB_DATA_TYPE_INT
:
v
=
(
double
)
GET_INT16_VAL
(
pData
);
v
=
(
double
)
GET_INT32_VAL
(
pData
);
break
;
break
;
case
TSDB_DATA_TYPE_INT
:
case
TSDB_DATA_TYPE_BIGINT
:
v
=
(
double
)
GET_INT32_VAL
(
pData
);
v
=
(
double
)
GET_INT64_VAL
(
pData
);
break
;
break
;
case
TSDB_DATA_TYPE_BIGINT
:
case
TSDB_DATA_TYPE_FLOAT
:
v
=
(
double
)
GET_INT64_VAL
(
pData
);
v
=
(
double
)
GET_FLOAT_VAL
(
pData
);
break
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_DOUBLE
:
v
=
(
double
)
GET_FLOAT_VAL
(
pData
);
v
=
(
double
)
GET_DOUBLE_VAL
(
pData
);
break
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
default:
v
=
(
double
)
GET_DOUBLE_VAL
(
pData
);
assert
(
0
);
break
;
default:
assert
(
0
);
}
if
((
-
DBL_MAX
==
pRateInfo
->
firstValue
)
||
(
INT64_MIN
==
pRateInfo
->
firstKey
))
{
pRateInfo
->
firstValue
=
v
;
pRateInfo
->
firstKey
=
primaryKey
[
i
];
pTrace
(
"firstValue:%f firstKey:%"
PRId64
,
pRateInfo
->
firstValue
,
pRateInfo
->
firstKey
);
}
if
(
-
DBL_MAX
==
pRateInfo
->
lastValue
)
{
pRateInfo
->
lastValue
=
v
;
}
else
if
(
v
<
pRateInfo
->
lastValue
)
{
pRateInfo
->
CorrectionValue
+=
pRateInfo
->
lastValue
;
pTrace
(
"CorrectionValue:%f"
,
pRateInfo
->
CorrectionValue
);
}
pRateInfo
->
lastValue
=
v
;
pRateInfo
->
lastKey
=
primaryKey
[
i
];
pTrace
(
"lastValue:%f lastKey:%"
PRId64
,
pRateInfo
->
lastValue
,
pRateInfo
->
lastKey
);
}
}
if
((
-
DBL_MAX
==
pRateInfo
->
firstValue
)
||
(
INT64_MIN
==
pRateInfo
->
firstKey
))
{
if
(
!
pCtx
->
hasNull
)
{
pRateInfo
->
firstValue
=
v
;
assert
(
pCtx
->
size
==
notNullElems
);
pRateInfo
->
firstKey
=
primaryKey
[
i
];
}
if
(
pCtx
->
next
.
key
!=
-
1
)
{
if
(
pCtx
->
next
.
data
<
pRateInfo
->
lastValue
)
{
pRateInfo
->
CorrectionValue
+=
pRateInfo
->
lastValue
;
pTrace
(
"CorrectionValue:%f"
,
pRateInfo
->
CorrectionValue
);
}
pRateInfo
->
lastValue
=
pCtx
->
next
.
data
;
pRateInfo
->
lastKey
=
pCtx
->
next
.
key
;
pCtx
->
next
.
key
=
-
1
;
}
}
else
{
if
(
pCtx
->
next
.
key
!=
-
1
)
{
pRateInfo
->
lastValue
=
pCtx
->
next
.
data
;
pRateInfo
->
lastKey
=
pCtx
->
next
.
key
;
pCtx
->
next
.
key
=
-
1
;
}
for
(
int32_t
i
=
pCtx
->
size
-
1
;
i
>=
0
;
--
i
)
{
char
*
pData
=
GET_INPUT_CHAR_INDEX
(
pCtx
,
i
);
if
(
pCtx
->
hasNull
&&
isNull
(
pData
,
pCtx
->
inputType
))
{
pTrace
(
"%p rate_function() index of null data:%d"
,
pCtx
,
i
);
continue
;
}
notNullElems
++
;
double
v
=
0
;
switch
(
pCtx
->
inputType
)
{
case
TSDB_DATA_TYPE_TINYINT
:
v
=
(
double
)
GET_INT8_VAL
(
pData
);
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
v
=
(
double
)
GET_INT16_VAL
(
pData
);
break
;
case
TSDB_DATA_TYPE_INT
:
v
=
(
double
)
GET_INT32_VAL
(
pData
);
break
;
case
TSDB_DATA_TYPE_BIGINT
:
v
=
(
double
)
GET_INT64_VAL
(
pData
);
break
;
case
TSDB_DATA_TYPE_FLOAT
:
v
=
(
double
)
GET_FLOAT_VAL
(
pData
);
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
v
=
(
double
)
GET_DOUBLE_VAL
(
pData
);
break
;
default:
assert
(
0
);
}
if
((
-
DBL_MAX
==
pRateInfo
->
lastValue
)
||
(
INT64_MIN
==
pRateInfo
->
lastKey
))
{
pRateInfo
->
lastValue
=
v
;
pRateInfo
->
lastKey
=
primaryKey
[
i
];
pTrace
(
"firstValue:%f firstKey:%"
PRId64
,
pRateInfo
->
lastValue
,
pRateInfo
->
lastKey
);
}
if
(
-
DBL_MAX
==
pRateInfo
->
firstValue
)
{
pRateInfo
->
firstValue
=
v
;
}
else
if
(
v
>
pRateInfo
->
firstValue
)
{
pRateInfo
->
CorrectionValue
+=
pRateInfo
->
firstValue
;
pTrace
(
"CorrectionValue:%f"
,
pRateInfo
->
CorrectionValue
);
}
pRateInfo
->
firstValue
=
v
;
pRateInfo
->
firstKey
=
primaryKey
[
i
];
pTrace
(
"firstValue:%f firstKey:%"
PRId64
,
pRateInfo
->
firstValue
,
pRateInfo
->
firstKey
);
pTrace
(
"firstValue:%f firstKey:%"
PRId64
,
pRateInfo
->
firstValue
,
pRateInfo
->
firstKey
);
}
}
if
(
-
DBL_MAX
==
pRateInfo
->
lastValue
)
{
if
(
!
pCtx
->
hasNull
)
{
pRateInfo
->
lastValue
=
v
;
assert
(
pCtx
->
size
==
notNullElems
);
}
else
if
(
v
<
pRateInfo
->
lastValue
)
{
pRateInfo
->
CorrectionValue
+=
pRateInfo
->
lastValue
;
pTrace
(
"CorrectionValue:%f"
,
pRateInfo
->
CorrectionValue
);
}
}
pRateInfo
->
lastValue
=
v
;
if
(
pCtx
->
prev
.
key
!=
-
1
)
{
pRateInfo
->
lastKey
=
primaryKey
[
i
];
if
(
pCtx
->
prev
.
data
>
pRateInfo
->
firstValue
)
{
pTrace
(
"lastValue:%f lastKey:%"
PRId64
,
pRateInfo
->
lastValue
,
pRateInfo
->
lastKey
);
pRateInfo
->
CorrectionValue
+=
pRateInfo
->
firstValue
;
}
pTrace
(
"CorrectionValue:%f"
,
pRateInfo
->
CorrectionValue
);
}
if
(
!
pCtx
->
hasNull
)
{
assert
(
pCtx
->
size
==
notNullElems
);
pRateInfo
->
firstValue
=
pCtx
->
prev
.
data
;
}
pRateInfo
->
firstKey
=
pCtx
->
prev
.
key
;
pCtx
->
prev
.
key
=
-
1
;
}
};
SET_VAL
(
pCtx
,
notNullElems
,
1
);
SET_VAL
(
pCtx
,
notNullElems
,
1
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
a160b2dc
...
@@ -598,9 +598,6 @@ int32_t parseIntervalClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
...
@@ -598,9 +598,6 @@ int32_t parseIntervalClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
pQueryInfo
->
intervalTime
=
pQueryInfo
->
intervalTime
/
1000
;
pQueryInfo
->
intervalTime
=
pQueryInfo
->
intervalTime
/
1000
;
}
}
/* parser has filter the illegal type, no need to check here */
pQueryInfo
->
intervalTimeUnit
=
pQuerySql
->
interval
.
z
[
pQuerySql
->
interval
.
n
-
1
];
// interval cannot be less than 10 milliseconds
// interval cannot be less than 10 milliseconds
if
(
pQueryInfo
->
intervalTime
<
tsMinIntervalTime
)
{
if
(
pQueryInfo
->
intervalTime
<
tsMinIntervalTime
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg2
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg2
);
...
@@ -689,10 +686,15 @@ int32_t parseSlidingClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
...
@@ -689,10 +686,15 @@ int32_t parseSlidingClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) {
if
(
pQueryInfo
->
slidingTime
>
pQueryInfo
->
intervalTime
)
{
if
(
pQueryInfo
->
slidingTime
>
pQueryInfo
->
intervalTime
)
{
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
return
invalidSqlErrMsg
(
pQueryInfo
->
msg
,
msg1
);
}
}
pQueryInfo
->
slidingTimeUnit
=
pQuerySql
->
sliding
.
z
[
pQuerySql
->
sliding
.
n
-
1
];
}
else
{
}
else
{
pQueryInfo
->
slidingTime
=
pQueryInfo
->
intervalTime
;
pQueryInfo
->
slidingTime
=
pQueryInfo
->
intervalTime
;
// parser has filter the illegal type, no need to check here
pQueryInfo
->
slidingTimeUnit
=
pQuerySql
->
interval
.
z
[
pQuerySql
->
interval
.
n
-
1
];
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -1636,13 +1638,16 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIdx, tSQLExprIt
...
@@ -1636,13 +1638,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/client/src/tscSecondaryMerge.c
浏览文件 @
a160b2dc
...
@@ -325,7 +325,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
...
@@ -325,7 +325,7 @@ void tscCreateLocalReducer(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrd
int64_t
stime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
stime
:
pQueryInfo
->
etime
;
int64_t
stime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
stime
:
pQueryInfo
->
etime
;
int64_t
revisedSTime
=
int64_t
revisedSTime
=
taosGetIntervalStartTimestamp
(
stime
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
interval
TimeUnit
,
prec
);
taosGetIntervalStartTimestamp
(
stime
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
sliding
TimeUnit
,
prec
);
SInterpolationInfo
*
pInterpoInfo
=
&
pReducer
->
interpolationInfo
;
SInterpolationInfo
*
pInterpoInfo
=
&
pReducer
->
interpolationInfo
;
taosInitInterpoInfo
(
pInterpoInfo
,
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
taosInitInterpoInfo
(
pInterpoInfo
,
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
...
@@ -800,7 +800,7 @@ void savePrevRecordAndSetupInterpoInfo(SLocalReducer *pLocalReducer, SQueryInfo
...
@@ -800,7 +800,7 @@ void savePrevRecordAndSetupInterpoInfo(SLocalReducer *pLocalReducer, SQueryInfo
int64_t
stime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
stime
:
pQueryInfo
->
etime
;
int64_t
stime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
stime
:
pQueryInfo
->
etime
;
int64_t
revisedSTime
=
int64_t
revisedSTime
=
taosGetIntervalStartTimestamp
(
stime
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
interval
TimeUnit
,
prec
);
taosGetIntervalStartTimestamp
(
stime
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
sliding
TimeUnit
,
prec
);
taosInitInterpoInfo
(
pInterpoInfo
,
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
taosInitInterpoInfo
(
pInterpoInfo
,
pQueryInfo
->
order
.
order
,
revisedSTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
pLocalReducer
->
rowSize
);
pLocalReducer
->
rowSize
);
...
@@ -944,7 +944,7 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
...
@@ -944,7 +944,7 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
while
(
1
)
{
while
(
1
)
{
int32_t
remains
=
taosNumOfRemainPoints
(
pInterpoInfo
);
int32_t
remains
=
taosNumOfRemainPoints
(
pInterpoInfo
);
TSKEY
etime
=
taosGetRevisedEndKey
(
actualETime
,
pQueryInfo
->
order
.
order
,
pQueryInfo
->
intervalTime
,
TSKEY
etime
=
taosGetRevisedEndKey
(
actualETime
,
pQueryInfo
->
order
.
order
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
interval
TimeUnit
,
precision
);
pQueryInfo
->
sliding
TimeUnit
,
precision
);
int32_t
nrows
=
taosGetNumOfResultWithInterpo
(
pInterpoInfo
,
pPrimaryKeys
,
remains
,
pQueryInfo
->
intervalTime
,
etime
,
int32_t
nrows
=
taosGetNumOfResultWithInterpo
(
pInterpoInfo
,
pPrimaryKeys
,
remains
,
pQueryInfo
->
intervalTime
,
etime
,
pLocalReducer
->
resColModel
->
capacity
);
pLocalReducer
->
resColModel
->
capacity
);
...
@@ -1296,7 +1296,7 @@ static void resetEnvForNewResultset(SSqlRes *pRes, SSqlCmd *pCmd, SLocalReducer
...
@@ -1296,7 +1296,7 @@ static void resetEnvForNewResultset(SSqlRes *pRes, SSqlCmd *pCmd, SLocalReducer
if
(
pQueryInfo
->
interpoType
!=
TSDB_INTERPO_NONE
)
{
if
(
pQueryInfo
->
interpoType
!=
TSDB_INTERPO_NONE
)
{
int64_t
stime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
stime
:
pQueryInfo
->
etime
;
int64_t
stime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
stime
:
pQueryInfo
->
etime
;
int64_t
newTime
=
int64_t
newTime
=
taosGetIntervalStartTimestamp
(
stime
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
interval
TimeUnit
,
precision
);
taosGetIntervalStartTimestamp
(
stime
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
sliding
TimeUnit
,
precision
);
taosInitInterpoInfo
(
&
pLocalReducer
->
interpolationInfo
,
pQueryInfo
->
order
.
order
,
newTime
,
taosInitInterpoInfo
(
&
pLocalReducer
->
interpolationInfo
,
pQueryInfo
->
order
.
order
,
newTime
,
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
pLocalReducer
->
rowSize
);
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
,
pLocalReducer
->
rowSize
);
...
@@ -1326,7 +1326,7 @@ static bool doInterpolationForCurrentGroup(SSqlObj *pSql) {
...
@@ -1326,7 +1326,7 @@ static bool doInterpolationForCurrentGroup(SSqlObj *pSql) {
int32_t
remain
=
taosNumOfRemainPoints
(
pInterpoInfo
);
int32_t
remain
=
taosNumOfRemainPoints
(
pInterpoInfo
);
TSKEY
ekey
=
TSKEY
ekey
=
taosGetRevisedEndKey
(
etime
,
pQueryInfo
->
order
.
order
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
interval
TimeUnit
,
p
);
taosGetRevisedEndKey
(
etime
,
pQueryInfo
->
order
.
order
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
sliding
TimeUnit
,
p
);
int32_t
rows
=
taosGetNumOfResultWithInterpo
(
pInterpoInfo
,
(
TSKEY
*
)
pLocalReducer
->
pBufForInterpo
,
remain
,
int32_t
rows
=
taosGetNumOfResultWithInterpo
(
pInterpoInfo
,
(
TSKEY
*
)
pLocalReducer
->
pBufForInterpo
,
remain
,
pQueryInfo
->
intervalTime
,
ekey
,
pLocalReducer
->
resColModel
->
capacity
);
pQueryInfo
->
intervalTime
,
ekey
,
pLocalReducer
->
resColModel
->
capacity
);
if
(
rows
>
0
)
{
// do interpo
if
(
rows
>
0
)
{
// do interpo
...
@@ -1359,7 +1359,7 @@ static bool doHandleLastRemainData(SSqlObj *pSql) {
...
@@ -1359,7 +1359,7 @@ static bool doHandleLastRemainData(SSqlObj *pSql) {
int64_t
etime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
etime
:
pQueryInfo
->
stime
;
int64_t
etime
=
(
pQueryInfo
->
stime
<
pQueryInfo
->
etime
)
?
pQueryInfo
->
etime
:
pQueryInfo
->
stime
;
etime
=
taosGetRevisedEndKey
(
etime
,
pQueryInfo
->
order
.
order
,
pQueryInfo
->
intervalTime
,
etime
=
taosGetRevisedEndKey
(
etime
,
pQueryInfo
->
order
.
order
,
pQueryInfo
->
intervalTime
,
pQueryInfo
->
interval
TimeUnit
,
precision
);
pQueryInfo
->
sliding
TimeUnit
,
precision
);
int32_t
rows
=
taosGetNumOfResultWithInterpo
(
pInterpoInfo
,
NULL
,
0
,
pQueryInfo
->
intervalTime
,
etime
,
int32_t
rows
=
taosGetNumOfResultWithInterpo
(
pInterpoInfo
,
NULL
,
0
,
pQueryInfo
->
intervalTime
,
etime
,
pLocalReducer
->
resColModel
->
capacity
);
pLocalReducer
->
resColModel
->
capacity
);
if
(
rows
>
0
)
{
// do interpo
if
(
rows
>
0
)
{
// do interpo
...
...
src/client/src/tscServer.c
浏览文件 @
a160b2dc
...
@@ -1681,7 +1681,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -1681,7 +1681,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
}
pQueryMsg
->
intervalTime
=
htobe64
(
pQueryInfo
->
intervalTime
);
pQueryMsg
->
intervalTime
=
htobe64
(
pQueryInfo
->
intervalTime
);
pQueryMsg
->
intervalTimeUnit
=
pQueryInfo
->
interval
TimeUnit
;
pQueryMsg
->
slidingTimeUnit
=
pQueryInfo
->
sliding
TimeUnit
;
pQueryMsg
->
slidingTime
=
htobe64
(
pQueryInfo
->
slidingTime
);
pQueryMsg
->
slidingTime
=
htobe64
(
pQueryInfo
->
slidingTime
);
if
(
pQueryInfo
->
intervalTime
<
0
)
{
if
(
pQueryInfo
->
intervalTime
<
0
)
{
...
...
go
@
8c58c512
比较
8c58c512
...
8c58c512
Subproject commit 8c58c512b6acda8bcdfa48fdc7140227b5221766
src/inc/taosmsg.h
浏览文件 @
a160b2dc
...
@@ -513,7 +513,7 @@ typedef struct {
...
@@ -513,7 +513,7 @@ typedef struct {
int16_t
orderColId
;
int16_t
orderColId
;
int16_t
numOfCols
;
// the number of columns will be load from vnode
int16_t
numOfCols
;
// the number of columns will be load from vnode
char
intervalTimeUnit
;
// time interval type, for revisement of interval(1d)
char
slidingTimeUnit
;
// time interval type, for revisement of interval(1d)
int64_t
intervalTime
;
// time interval for aggregation, in million second
int64_t
intervalTime
;
// time interval for aggregation, in million second
int64_t
slidingTime
;
// value for sliding window
int64_t
slidingTime
;
// value for sliding window
...
...
src/inc/tinterpolation.h
浏览文件 @
a160b2dc
...
@@ -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
{
...
@@ -83,6 +83,8 @@ int32_t taosDoInterpoResult(SInterpolationInfo *pInterpoInfo, int16_t interpoTyp
...
@@ -83,6 +83,8 @@ int32_t taosDoInterpoResult(SInterpolationInfo *pInterpoInfo, int16_t interpoTyp
int
taosDoLinearInterpolation
(
int32_t
type
,
SPoint
*
point1
,
SPoint
*
point2
,
SPoint
*
point
);
int
taosDoLinearInterpolation
(
int32_t
type
,
SPoint
*
point1
,
SPoint
*
point2
,
SPoint
*
point
);
int
taosDoLinearInterpolationD
(
int32_t
type
,
SPoint
*
point1
,
SPoint
*
point2
,
SPoint
*
point
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
src/inc/tsqlfunction.h
浏览文件 @
a160b2dc
...
@@ -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
;
double
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
prev
;
// this value may be less or equalled to the start time of time window
SBoundaryData
next
;
// 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/vnode.h
浏览文件 @
a160b2dc
...
@@ -261,7 +261,7 @@ typedef struct SQuery {
...
@@ -261,7 +261,7 @@ typedef struct SQuery {
TSKEY
ekey
;
TSKEY
ekey
;
int64_t
intervalTime
;
int64_t
intervalTime
;
int64_t
slidingTime
;
// sliding time for sliding window query
int64_t
slidingTime
;
// sliding time for sliding window query
char
interval
TimeUnit
;
// interval data type, used for daytime revise
char
sliding
TimeUnit
;
// interval data type, used for daytime revise
int8_t
precision
;
int8_t
precision
;
int16_t
numOfOutputCols
;
int16_t
numOfOutputCols
;
int16_t
interpoType
;
int16_t
interpoType
;
...
...
src/system/detail/inc/vnodeQueryImpl.h
浏览文件 @
a160b2dc
...
@@ -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
;
...
@@ -285,6 +279,7 @@ void clearClosedTimeWindow(SQueryRuntimeEnv* pRuntimeEnv);
...
@@ -285,6 +279,7 @@ void clearClosedTimeWindow(SQueryRuntimeEnv* pRuntimeEnv);
int32_t
numOfClosedTimeWindow
(
SWindowResInfo
*
pWindowResInfo
);
int32_t
numOfClosedTimeWindow
(
SWindowResInfo
*
pWindowResInfo
);
void
closeTimeWindow
(
SWindowResInfo
*
pWindowResInfo
,
int32_t
slot
);
void
closeTimeWindow
(
SWindowResInfo
*
pWindowResInfo
,
int32_t
slot
);
void
closeAllTimeWindow
(
SWindowResInfo
*
pWindowResInfo
);
void
closeAllTimeWindow
(
SWindowResInfo
*
pWindowResInfo
);
SWindowResult
*
getWindowRes
(
SWindowResInfo
*
pWindowResInfo
,
size_t
index
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/system/detail/inc/vnodeRead.h
浏览文件 @
a160b2dc
...
@@ -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 */
...
@@ -172,6 +178,10 @@ typedef struct SQueryRuntimeEnv {
...
@@ -172,6 +178,10 @@ typedef struct SQueryRuntimeEnv {
bool
stableQuery
;
// is super table query or not
bool
stableQuery
;
// is super table query or not
SQueryDiskbasedResultBuf
*
pResultBuf
;
// query result buffer based on blocked-wised disk file
SQueryDiskbasedResultBuf
*
pResultBuf
;
// query result buffer based on blocked-wised disk file
bool
hasTimeWindow
;
char
**
lastRowInBlock
;
bool
interpoSearch
;
/*
/*
* Temporarily hold the in-memory cache block info during scan cache blocks
* Temporarily hold the in-memory cache block info during scan cache blocks
* Here we do not use the cache block info from pMeterObj, simple because it may change anytime
* Here we do not use the cache block info from pMeterObj, simple because it may change anytime
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
a160b2dc
此差异已折叠。
点击以展开。
src/system/detail/src/vnodeRead.c
浏览文件 @
a160b2dc
...
@@ -269,7 +269,7 @@ static SQInfo *vnodeAllocateQInfoEx(SQueryMeterMsg *pQueryMsg, SSqlGroupbyExpr *
...
@@ -269,7 +269,7 @@ static SQInfo *vnodeAllocateQInfoEx(SQueryMeterMsg *pQueryMsg, SSqlGroupbyExpr *
pQuery
->
intervalTime
=
pQueryMsg
->
intervalTime
;
pQuery
->
intervalTime
=
pQueryMsg
->
intervalTime
;
pQuery
->
slidingTime
=
pQueryMsg
->
slidingTime
;
pQuery
->
slidingTime
=
pQueryMsg
->
slidingTime
;
pQuery
->
interpoType
=
pQueryMsg
->
interpoType
;
pQuery
->
interpoType
=
pQueryMsg
->
interpoType
;
pQuery
->
intervalTimeUnit
=
pQueryMsg
->
interval
TimeUnit
;
pQuery
->
slidingTimeUnit
=
pQueryMsg
->
sliding
TimeUnit
;
pQInfo
->
query
.
pointsToRead
=
vnodeList
[
pMeterObj
->
vnode
].
cfg
.
rowsInFileBlock
;
pQInfo
->
query
.
pointsToRead
=
vnodeList
[
pMeterObj
->
vnode
].
cfg
.
rowsInFileBlock
;
...
...
src/util/src/tinterpolation.c
浏览文件 @
a160b2dc
...
@@ -22,12 +22,12 @@
...
@@ -22,12 +22,12 @@
#define INTERPOL_IS_ASC_INTERPOL(interp) ((interp)->order == TSQL_SO_ASC)
#define INTERPOL_IS_ASC_INTERPOL(interp) ((interp)->order == TSQL_SO_ASC)
int64_t
taosGetIntervalStartTimestamp
(
int64_t
startTime
,
int64_t
timeRange
,
char
interval
TimeUnit
,
int16_t
precision
)
{
int64_t
taosGetIntervalStartTimestamp
(
int64_t
startTime
,
int64_t
timeRange
,
char
sliding
TimeUnit
,
int16_t
precision
)
{
if
(
timeRange
==
0
)
{
if
(
timeRange
==
0
)
{
return
startTime
;
return
startTime
;
}
}
if
(
intervalTimeUnit
==
'a'
||
intervalTimeUnit
==
'm'
||
intervalTimeUnit
==
's'
||
interval
TimeUnit
==
'h'
)
{
if
(
slidingTimeUnit
==
'a'
||
slidingTimeUnit
==
'm'
||
slidingTimeUnit
==
's'
||
sliding
TimeUnit
==
'h'
)
{
return
(
startTime
/
timeRange
)
*
timeRange
;
return
(
startTime
/
timeRange
)
*
timeRange
;
}
else
{
}
else
{
/*
/*
...
@@ -95,11 +95,11 @@ void taosInterpoSetStartInfo(SInterpolationInfo* pInterpoInfo, int32_t numOfRawD
...
@@ -95,11 +95,11 @@ void taosInterpoSetStartInfo(SInterpolationInfo* pInterpoInfo, int32_t numOfRawD
pInterpoInfo
->
numOfRawDataInRows
=
numOfRawDataInRows
;
pInterpoInfo
->
numOfRawDataInRows
=
numOfRawDataInRows
;
}
}
TSKEY
taosGetRevisedEndKey
(
TSKEY
ekey
,
int32_t
order
,
int32_t
timeInterval
,
int8_t
interval
TimeUnit
,
int8_t
precision
)
{
TSKEY
taosGetRevisedEndKey
(
TSKEY
ekey
,
int32_t
order
,
int32_t
timeInterval
,
int8_t
sliding
TimeUnit
,
int8_t
precision
)
{
if
(
order
==
TSQL_SO_ASC
)
{
if
(
order
==
TSQL_SO_ASC
)
{
return
ekey
;
return
ekey
;
}
else
{
}
else
{
return
taosGetIntervalStartTimestamp
(
ekey
,
timeInterval
,
interval
TimeUnit
,
precision
);
return
taosGetIntervalStartTimestamp
(
ekey
,
timeInterval
,
sliding
TimeUnit
,
precision
);
}
}
}
}
...
@@ -191,6 +191,49 @@ int taosDoLinearInterpolation(int32_t type, SPoint* point1, SPoint* point2, SPoi
...
@@ -191,6 +191,49 @@ int taosDoLinearInterpolation(int32_t type, SPoint* point1, SPoint* point2, SPoi
return
0
;
return
0
;
}
}
int
taosDoLinearInterpolationD
(
int32_t
type
,
SPoint
*
point1
,
SPoint
*
point2
,
SPoint
*
point
)
{
switch
(
type
)
{
case
TSDB_DATA_TYPE_INT
:
{
*
(
double
*
)
point
->
val
=
doLinearInterpolationImpl
(
*
(
int32_t
*
)
point1
->
val
,
*
(
int32_t
*
)
point2
->
val
,
point1
->
key
,
point2
->
key
,
point
->
key
);
break
;
}
case
TSDB_DATA_TYPE_FLOAT
:
{
*
(
double
*
)
point
->
val
=
doLinearInterpolationImpl
(
*
(
float
*
)
point1
->
val
,
*
(
float
*
)
point2
->
val
,
point1
->
key
,
point2
->
key
,
point
->
key
);
break
;
};
case
TSDB_DATA_TYPE_DOUBLE
:
{
*
(
double
*
)
point
->
val
=
doLinearInterpolationImpl
(
*
(
double
*
)
point1
->
val
,
*
(
double
*
)
point2
->
val
,
point1
->
key
,
point2
->
key
,
point
->
key
);
break
;
};
case
TSDB_DATA_TYPE_TIMESTAMP
:
case
TSDB_DATA_TYPE_BIGINT
:
{
*
(
double
*
)
point
->
val
=
doLinearInterpolationImpl
(
*
(
int64_t
*
)
point1
->
val
,
*
(
int64_t
*
)
point2
->
val
,
point1
->
key
,
point2
->
key
,
point
->
key
);
break
;
};
case
TSDB_DATA_TYPE_SMALLINT
:
{
*
(
double
*
)
point
->
val
=
doLinearInterpolationImpl
(
*
(
int16_t
*
)
point1
->
val
,
*
(
int16_t
*
)
point2
->
val
,
point1
->
key
,
point2
->
key
,
point
->
key
);
break
;
};
case
TSDB_DATA_TYPE_TINYINT
:
{
*
(
double
*
)
point
->
val
=
doLinearInterpolationImpl
(
*
(
int8_t
*
)
point1
->
val
,
*
(
int8_t
*
)
point2
->
val
,
point1
->
key
,
point2
->
key
,
point
->
key
);
break
;
};
default:
{
// TODO: Deal with interpolation with bool and strings and timestamp
return
-
1
;
}
}
return
0
;
}
static
char
*
getPos
(
char
*
data
,
int32_t
bytes
,
int32_t
index
)
{
return
data
+
index
*
bytes
;
}
static
char
*
getPos
(
char
*
data
,
int32_t
bytes
,
int32_t
index
)
{
return
data
+
index
*
bytes
;
}
static
void
setTagsValueInInterpolation
(
tFilePage
**
data
,
char
**
pTags
,
SColumnModel
*
pModel
,
int32_t
order
,
static
void
setTagsValueInInterpolation
(
tFilePage
**
data
,
char
**
pTags
,
SColumnModel
*
pModel
,
int32_t
order
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录