Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c1968083
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看板
未验证
提交
c1968083
编写于
6月 18, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 18, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2340 from taosdata/feature/query
Feature/query
上级
6c5c703d
f311f8aa
变更
8
展开全部
显示空白变更内容
内联
并排
Showing
8 changed file
with
440 addition
and
427 deletion
+440
-427
src/client/inc/tscLocalMerge.h
src/client/inc/tscLocalMerge.h
+6
-19
src/client/inc/tscSubquery.h
src/client/inc/tscSubquery.h
+0
-2
src/client/inc/tscUtil.h
src/client/inc/tscUtil.h
+2
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+385
-352
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+0
-1
src/util/src/terror.c
src/util/src/terror.c
+0
-1
tests/script/general/parser/alter.sim
tests/script/general/parser/alter.sim
+40
-40
tests/script/general/parser/testSuite.sim
tests/script/general/parser/testSuite.sim
+7
-11
未找到文件。
src/client/inc/tscLocalMerge.h
浏览文件 @
c1968083
...
@@ -13,8 +13,8 @@
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
#ifndef TDENGINE_TSC
SECONARY
MERGE_H
#ifndef TDENGINE_TSC
LOCAL
MERGE_H
#define TDENGINE_TSC
SECONARY
MERGE_H
#define TDENGINE_TSC
LOCAL
MERGE_H
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -28,13 +28,6 @@ extern "C" {
...
@@ -28,13 +28,6 @@ extern "C" {
#define MAX_NUM_OF_SUBQUERY_RETRY 3
#define MAX_NUM_OF_SUBQUERY_RETRY 3
/*
* @version 0.1
* @date 2018/01/05
* @author liaohj
* management of client-side reducer for metric query
*/
struct
SQLFunctionCtx
;
struct
SQLFunctionCtx
;
typedef
struct
SLocalDataSource
{
typedef
struct
SLocalDataSource
{
...
@@ -60,7 +53,6 @@ typedef struct SLocalReducer {
...
@@ -60,7 +53,6 @@ typedef struct SLocalReducer {
char
*
prevRowOfInput
;
char
*
prevRowOfInput
;
tFilePage
*
pResultBuf
;
tFilePage
*
pResultBuf
;
int32_t
nResultBufSize
;
int32_t
nResultBufSize
;
// char * pBufForInterpo; // intermediate buffer for interpolation
tFilePage
*
pTempBuffer
;
tFilePage
*
pTempBuffer
;
struct
SQLFunctionCtx
*
pCtx
;
struct
SQLFunctionCtx
*
pCtx
;
int32_t
rowSize
;
// size of each intermediate result.
int32_t
rowSize
;
// size of each intermediate result.
...
@@ -81,13 +73,8 @@ typedef struct SLocalReducer {
...
@@ -81,13 +73,8 @@ typedef struct SLocalReducer {
}
SLocalReducer
;
}
SLocalReducer
;
typedef
struct
SSubqueryState
{
typedef
struct
SSubqueryState
{
/*
int32_t
numOfRemain
;
// the number of remain unfinished subquery
* the number of completed retrieval subquery, once this value equals to numOfVnodes,
int32_t
numOfTotal
;
// the number of total sub-queries
* all retrieval are completed.Local merge is launched.
*/
int32_t
numOfCompleted
;
int32_t
numOfTotal
;
// number of total sub-queries
int32_t
code
;
// code from subqueries
uint64_t
numOfRetrievedRows
;
// total number of points in this query
uint64_t
numOfRetrievedRows
;
// total number of points in this query
}
SSubqueryState
;
}
SSubqueryState
;
...
@@ -128,4 +115,4 @@ int32_t tscDoLocalMerge(SSqlObj *pSql);
...
@@ -128,4 +115,4 @@ int32_t tscDoLocalMerge(SSqlObj *pSql);
}
}
#endif
#endif
#endif // TDENGINE_TSC
SECONARY
MERGE_H
#endif // TDENGINE_TSC
LOCAL
MERGE_H
src/client/inc/tscSubquery.h
浏览文件 @
c1968083
...
@@ -26,11 +26,9 @@ extern "C" {
...
@@ -26,11 +26,9 @@ extern "C" {
void
tscFetchDatablockFromSubquery
(
SSqlObj
*
pSql
);
void
tscFetchDatablockFromSubquery
(
SSqlObj
*
pSql
);
void
tscSetupOutputColumnIndex
(
SSqlObj
*
pSql
);
void
tscSetupOutputColumnIndex
(
SSqlObj
*
pSql
);
int32_t
tscLaunchSecondPhaseSubqueries
(
SSqlObj
*
pSql
);
void
tscJoinQueryCallback
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
);
void
tscJoinQueryCallback
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
);
SJoinSupporter
*
tscCreateJoinSupporter
(
SSqlObj
*
pSql
,
SSubqueryState
*
pState
,
int32_t
index
);
SJoinSupporter
*
tscCreateJoinSupporter
(
SSqlObj
*
pSql
,
SSubqueryState
*
pState
,
int32_t
index
);
void
tscDestroyJoinSupporter
(
SJoinSupporter
*
pSupporter
);
int32_t
tscHandleMasterJoinQuery
(
SSqlObj
*
pSql
);
int32_t
tscHandleMasterJoinQuery
(
SSqlObj
*
pSql
);
...
...
src/client/inc/tscUtil.h
浏览文件 @
c1968083
...
@@ -64,7 +64,8 @@ typedef struct SJoinSupporter {
...
@@ -64,7 +64,8 @@ typedef struct SJoinSupporter {
SSubqueryState
*
pState
;
SSubqueryState
*
pState
;
SSqlObj
*
pObj
;
// parent SqlObj
SSqlObj
*
pObj
;
// parent SqlObj
int32_t
subqueryIndex
;
// index of sub query
int32_t
subqueryIndex
;
// index of sub query
int64_t
interval
;
// interval time
int64_t
intervalTime
;
// interval time
int64_t
slidingTime
;
// sliding time
SLimitVal
limit
;
// limit info
SLimitVal
limit
;
// limit info
uint64_t
uid
;
// query meter uid
uint64_t
uid
;
// query meter uid
SArray
*
colList
;
// previous query information, no need to use this attribute, and the corresponding attribution
SArray
*
colList
;
// previous query information, no need to use this attribute, and the corresponding attribution
...
...
src/client/src/tscSubquery.c
浏览文件 @
c1968083
此差异已折叠。
点击以展开。
src/query/src/qExecutor.c
浏览文件 @
c1968083
...
@@ -1216,7 +1216,6 @@ static int32_t tableApplyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SDataBl
...
@@ -1216,7 +1216,6 @@ static int32_t tableApplyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SDataBl
// interval query with limit applied
// interval query with limit applied
int32_t
numOfRes
=
0
;
int32_t
numOfRes
=
0
;
if
(
isIntervalQuery
(
pQuery
))
{
if
(
isIntervalQuery
(
pQuery
))
{
numOfRes
=
doCheckQueryCompleted
(
pRuntimeEnv
,
lastKey
,
pWindowResInfo
);
numOfRes
=
doCheckQueryCompleted
(
pRuntimeEnv
,
lastKey
,
pWindowResInfo
);
}
else
{
}
else
{
...
...
src/util/src/terror.c
浏览文件 @
c1968083
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
#include <stdint.h>
#include <stdint.h>
#include <pthread.h>
#include <pthread.h>
#include <errno.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
...
...
tests/script/general/parser/alter.sim
浏览文件 @
c1968083
...
@@ -114,46 +114,46 @@ sql drop table tb
...
@@ -114,46 +114,46 @@ sql drop table tb
sql drop table mt
sql drop table mt
sleep 3000
sleep 3000
## ALTER TABLE WHILE STREAMING [TBASE271]
##
#
ALTER TABLE WHILE STREAMING [TBASE271]
sql create table tb1 (ts timestamp, c1 int, c2 nchar(5), c3 int)
#
sql create table tb1 (ts timestamp, c1 int, c2 nchar(5), c3 int)
sql create table strm as select count(*), avg(c1), first(c2), sum(c3) from tb1 interval(2s)
#
sql create table strm as select count(*), avg(c1), first(c2), sum(c3) from tb1 interval(2s)
sql select * from strm
#
sql select * from strm
if $rows != 0 then
#
if $rows != 0 then
return -1
#
return -1
endi
#
endi
#sleep 12000
#
#
sleep 12000
sql insert into tb1 values (now, 1, 'taos', 1)
#
sql insert into tb1 values (now, 1, 'taos', 1)
sleep 20000
#
sleep 20000
sql select * from strm
#
sql select * from strm
print rows = $rows
#
print rows = $rows
if $rows != 1 then
#
if $rows != 1 then
return -1
#
return -1
endi
#
endi
if $data04 != 1 then
#
if $data04 != 1 then
return -1
#
return -1
endi
#
endi
sql alter table tb1 drop column c3
#sql alter table tb1 drop column c3
sleep 6000
#
sleep 6000
sql insert into tb1 values (now, 2, 'taos')
#
sql insert into tb1 values (now, 2, 'taos')
sleep 30000
#
sleep 30000
sql select * from strm
#
sql select * from strm
if $rows != 2 then
#
if $rows != 2 then
return -1
#
return -1
endi
#
endi
if $data04 != 1 then
#
if $data04 != 1 then
return -1
#
return -1
endi
#
endi
sql alter table tb1 add column c3 int
#
sql alter table tb1 add column c3 int
sleep 6000
#
sleep 6000
sql insert into tb1 values (now, 3, 'taos', 3);
#
sql insert into tb1 values (now, 3, 'taos', 3);
sleep 3000
#
sleep 3000
sql select * from strm
#
sql select * from strm
if $rows != 3 then
#
if $rows != 3 then
return -1
#
return -1
endi
#
endi
if $data04 != 1 then
#
if $data04 != 1 then
return -1
#
return -1
endi
#
endi
## ALTER TABLE AND INSERT BY COLUMNS
## ALTER TABLE AND INSERT BY COLUMNS
sql create table mt (ts timestamp, c1 int, c2 int) tags(t1 int)
sql create table mt (ts timestamp, c1 int, c2 int) tags(t1 int)
...
...
tests/script/general/parser/testSuite.sim
浏览文件 @
c1968083
...
@@ -82,26 +82,22 @@ sleep 2000
...
@@ -82,26 +82,22 @@ sleep 2000
run general/parser/groupby.sim
run general/parser/groupby.sim
sleep 2000
sleep 2000
run general/parser/set_tag_vals.sim
run general/parser/set_tag_vals.sim
sleep 2000
sleep 2000
run general/parser/slimit_alter_tags.sim # persistent failed
run general/parser/slimit_alter_tags.sim # persistent failed
sleep 2000
sleep 2000
run general/parser/join.sim
run general/parser/join.sim
sleep 2000
sleep 2000
run general/parser/join_multivnode.sim
run general/parser/join_multivnode.sim
sleep 2000
sleep 2000
#run general/parser/repeatAlter.sim
run general/parser/repeatAlter.sim
sleep 2000
#run general/parser/repeatStream.sim
sleep 2000
sleep 2000
run general/parser/binary_escapeCharacter.sim
run general/parser/binary_escapeCharacter.sim
sleep 2000
sleep 2000
run general/parser/bug.sim
run general/parser/bug.sim
sleep 2000
#sleep 2000
run general/parser/stream_on_sys.sim
#run general/parser/repeatStream.sim
sleep 2000
#sleep 2000
run general/parser/stream.sim
#run general/parser/stream_on_sys.sim
\ No newline at end of file
#sleep 2000
#run general/parser/stream.sim
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录