Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5040cb95
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5040cb95
编写于
6月 25, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(query): window included in serialized retrieve table rsp
上级
f0b50add
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
24 addition
and
12 deletion
+24
-12
examples/c/stream_demo.c
examples/c/stream_demo.c
+2
-2
include/common/tmsg.h
include/common/tmsg.h
+5
-6
source/dnode/mnode/impl/src/mndStream.c
source/dnode/mnode/impl/src/mndStream.c
+1
-1
source/libs/stream/src/streamData.c
source/libs/stream/src/streamData.c
+12
-3
source/libs/stream/src/streamDispatch.c
source/libs/stream/src/streamDispatch.c
+4
-0
未找到文件。
examples/c/stream_demo.c
浏览文件 @
5040cb95
...
...
@@ -99,8 +99,8 @@ int32_t create_stream() {
/*const char* sql = "select sum(k) from tu1 interval(10m)";*/
/*pRes = tmq_create_stream(pConn, "stream1", "out1", sql);*/
pRes
=
taos_query
(
pConn
,
"create stream stream1 trigger at_once into outstb as select _wstartts, sum(k) from st1 "
"
partition
by tbname interval(10s) "
);
"create stream stream1 trigger at_once into outstb as select _wstartts, sum(k) from st1
partition
"
"by tbname interval(10s) "
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create stream stream1, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
...
...
include/common/tmsg.h
浏览文件 @
5040cb95
...
...
@@ -851,7 +851,6 @@ typedef struct {
int32_t
tSerializeSServerVerRsp
(
void
*
buf
,
int32_t
bufLen
,
SServerVerRsp
*
pRsp
);
int32_t
tDeserializeSServerVerRsp
(
void
*
buf
,
int32_t
bufLen
,
SServerVerRsp
*
pRsp
);
typedef
struct
SQueryNodeAddr
{
int32_t
nodeId
;
// vgId or qnodeId
SEpSet
epSet
;
...
...
@@ -878,7 +877,6 @@ int32_t tSerializeSDnodeListRsp(void* buf, int32_t bufLen, SDnodeListRsp* pRsp);
int32_t
tDeserializeSDnodeListRsp
(
void
*
buf
,
int32_t
bufLen
,
SDnodeListRsp
*
pRsp
);
void
tFreeSDnodeListRsp
(
SDnodeListRsp
*
pRsp
);
typedef
struct
{
SArray
*
pArray
;
// Array of SUseDbRsp
}
SUseDbBatchRsp
;
...
...
@@ -1245,12 +1243,12 @@ int32_t tSerializeSShowVariablesReq(void* buf, int32_t bufLen, SShowVariablesReq
int32_t
tDeserializeSShowVariablesReq
(
void
*
buf
,
int32_t
bufLen
,
SShowVariablesReq
*
pReq
);
typedef
struct
{
char
name
[
TSDB_CONFIG_OPTION_LEN
+
1
];
char
value
[
TSDB_CONFIG_VALUE_LEN
+
1
];
char
name
[
TSDB_CONFIG_OPTION_LEN
+
1
];
char
value
[
TSDB_CONFIG_VALUE_LEN
+
1
];
}
SVariablesInfo
;
typedef
struct
{
SArray
*
variables
;
//
SArray<SVariablesInfo>
SArray
*
variables
;
//
SArray<SVariablesInfo>
}
SShowVariablesRsp
;
int32_t
tSerializeSShowVariablesRsp
(
void
*
buf
,
int32_t
bufLen
,
SShowVariablesRsp
*
pReq
);
...
...
@@ -1258,7 +1256,6 @@ int32_t tDeserializeSShowVariablesRsp(void* buf, int32_t bufLen, SShowVariablesR
void
tFreeSShowVariablesRsp
(
SShowVariablesRsp
*
pRsp
);
/*
* sql: show tables like '%a_%'
* payload is the query condition, e.g., '%a_%'
...
...
@@ -1308,6 +1305,8 @@ typedef struct {
int32_t
compLen
;
int32_t
numOfRows
;
int32_t
numOfCols
;
int64_t
skey
;
int64_t
ekey
;
char
data
[];
}
SRetrieveTableRsp
;
...
...
source/dnode/mnode/impl/src/mndStream.c
浏览文件 @
5040cb95
...
...
@@ -634,7 +634,7 @@ static int32_t mndProcessDropStreamReq(SRpcMsg *pReq) {
if
(
dropReq
.
igNotExists
)
{
mDebug
(
"stream:%s, not exist, ignore not exist is set"
,
dropReq
.
name
);
sdbRelease
(
pMnode
->
pSdb
,
pStream
);
return
-
1
;
return
0
;
}
else
{
terrno
=
TSDB_CODE_MND_STREAM_NOT_EXIST
;
return
-
1
;
...
...
source/libs/stream/src/streamData.c
浏览文件 @
5040cb95
...
...
@@ -27,11 +27,14 @@ int32_t streamDispatchReqToData(const SStreamDispatchReq* pReq, SStreamDataBlock
ASSERT
(
pReq
->
blockNum
==
taosArrayGetSize
(
pReq
->
dataLen
));
for
(
int32_t
i
=
0
;
i
<
blockNum
;
i
++
)
{
int32_t
len
=
*
(
int32_t
*
)
taosArrayGet
(
pReq
->
dataLen
,
i
);
/*int32_t len = *(int32_t*)taosArrayGet(pReq->dataLen, i);*/
SRetrieveTableRsp
*
pRetrieve
=
taosArrayGetP
(
pReq
->
data
,
i
);
SSDataBlock
*
pDataBlock
=
taosArrayGet
(
pArray
,
i
);
blockCompressDecode
(
pDataBlock
,
htonl
(
pRetrieve
->
numOfCols
),
htonl
(
pRetrieve
->
numOfRows
),
pRetrieve
->
data
);
// TODO: refactor
pDataBlock
->
info
.
window
.
skey
=
be64toh
(
pRetrieve
->
skey
);
pDataBlock
->
info
.
window
.
ekey
=
be64toh
(
pRetrieve
->
ekey
);
pDataBlock
->
info
.
type
=
pRetrieve
->
streamBlockType
;
pDataBlock
->
info
.
childId
=
pReq
->
upstreamChildId
;
}
...
...
@@ -46,8 +49,14 @@ int32_t streamRetrieveReqToData(const SStreamRetrieveReq* pReq, SStreamDataBlock
}
taosArraySetSize
(
pArray
,
1
);
SRetrieveTableRsp
*
pRetrieve
=
pReq
->
pRetrieve
;
SSDataBlock
*
pBlock
=
taosArrayGet
(
pArray
,
0
);
blockCompressDecode
(
pBlock
,
htonl
(
pRetrieve
->
numOfCols
),
htonl
(
pRetrieve
->
numOfRows
),
pRetrieve
->
data
);
SSDataBlock
*
pDataBlock
=
taosArrayGet
(
pArray
,
0
);
blockCompressDecode
(
pDataBlock
,
htonl
(
pRetrieve
->
numOfCols
),
htonl
(
pRetrieve
->
numOfRows
),
pRetrieve
->
data
);
// TODO: refactor
pDataBlock
->
info
.
window
.
skey
=
be64toh
(
pRetrieve
->
skey
);
pDataBlock
->
info
.
window
.
ekey
=
be64toh
(
pRetrieve
->
ekey
);
pDataBlock
->
info
.
type
=
pRetrieve
->
streamBlockType
;
pData
->
blocks
=
pArray
;
return
0
;
}
...
...
source/libs/stream/src/streamDispatch.c
浏览文件 @
5040cb95
...
...
@@ -104,6 +104,8 @@ int32_t streamBroadcastToChildren(SStreamTask* pTask, const SSDataBlock* pBlock)
pRetrieve
->
streamBlockType
=
pBlock
->
info
.
type
;
pRetrieve
->
numOfRows
=
htonl
(
pBlock
->
info
.
rows
);
pRetrieve
->
numOfCols
=
htonl
(
numOfCols
);
pRetrieve
->
skey
=
htobe64
(
pBlock
->
info
.
window
.
skey
);
pRetrieve
->
ekey
=
htobe64
(
pBlock
->
info
.
window
.
ekey
);
int32_t
actualLen
=
0
;
blockCompressEncode
(
pBlock
,
pRetrieve
->
data
,
&
actualLen
,
numOfCols
,
false
);
...
...
@@ -171,6 +173,8 @@ static int32_t streamAddBlockToDispatchMsg(const SSDataBlock* pBlock, SStreamDis
pRetrieve
->
completed
=
1
;
pRetrieve
->
streamBlockType
=
pBlock
->
info
.
type
;
pRetrieve
->
numOfRows
=
htonl
(
pBlock
->
info
.
rows
);
pRetrieve
->
skey
=
htobe64
(
pBlock
->
info
.
window
.
skey
);
pRetrieve
->
ekey
=
htobe64
(
pBlock
->
info
.
window
.
ekey
);
int32_t
numOfCols
=
(
int32_t
)
taosArrayGetSize
(
pBlock
->
pDataBlock
);
pRetrieve
->
numOfCols
=
htonl
(
numOfCols
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录