Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a0be0c1d
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看板
提交
a0be0c1d
编写于
4月 13, 2023
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: add client option tsEnableScience
上级
3493fffa
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
6 deletion
+41
-6
include/common/tglobal.h
include/common/tglobal.h
+1
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+4
-0
tools/shell/src/shellEngine.c
tools/shell/src/shellEngine.c
+36
-6
未找到文件。
include/common/tglobal.h
浏览文件 @
a0be0c1d
...
...
@@ -112,6 +112,7 @@ extern int32_t tsQueryNodeChunkSize;
extern
bool
tsQueryUseNodeAllocator
;
extern
bool
tsKeepColumnName
;
extern
bool
tsEnableQueryHb
;
extern
bool
tsEnableScience
;
extern
int32_t
tsRedirectPeriod
;
extern
int32_t
tsRedirectFactor
;
extern
int32_t
tsRedirectMaxPeriod
;
...
...
source/common/src/tglobal.c
浏览文件 @
a0be0c1d
...
...
@@ -105,6 +105,7 @@ int32_t tsQueryPolicy = 1;
int32_t
tsQueryRspPolicy
=
0
;
int64_t
tsQueryMaxConcurrentTables
=
200
;
// unit is TSDB_TABLE_NUM_UNIT
bool
tsEnableQueryHb
=
false
;
bool
tsEnableScience
=
false
;
// on taos-cli show float and doulbe with scientific notation if true
int32_t
tsQuerySmaOptimize
=
0
;
int32_t
tsQueryRsmaTolerance
=
1000
;
// the tolerance time (ms) to judge from which level to query rsma data.
bool
tsQueryPlannerTrace
=
false
;
...
...
@@ -117,6 +118,7 @@ int32_t tsRedirectMaxPeriod = 1000;
int32_t
tsMaxRetryWaitTime
=
10000
;
bool
tsUseAdapter
=
false
;
/*
* denote if the server needs to compress response message at the application layer to client, including query rsp,
* metricmeta rsp, and multi-meter query rsp message body. The client compress the submit message to server.
...
...
@@ -328,6 +330,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"compressColData"
,
tsCompressColData
,
-
1
,
100000000
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"queryPolicy"
,
tsQueryPolicy
,
1
,
4
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"enableQueryHb"
,
tsEnableQueryHb
,
false
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"enableScience"
,
tsEnableScience
,
false
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"querySmaOptimize"
,
tsQuerySmaOptimize
,
0
,
1
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"queryPlannerTrace"
,
tsQueryPlannerTrace
,
true
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"queryNodeChunkSize"
,
tsQueryNodeChunkSize
,
1024
,
128
*
1024
,
true
)
!=
0
)
return
-
1
;
...
...
@@ -730,6 +733,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
tsNumOfTaskQueueThreads
=
cfgGetItem
(
pCfg
,
"numOfTaskQueueThreads"
)
->
i32
;
tsQueryPolicy
=
cfgGetItem
(
pCfg
,
"queryPolicy"
)
->
i32
;
tsEnableQueryHb
=
cfgGetItem
(
pCfg
,
"enableQueryHb"
)
->
bval
;
tsScientific
=
=
cfgGetItem
(
pCfg
,
"enableScience"
)
->
bval
;
tsQuerySmaOptimize
=
cfgGetItem
(
pCfg
,
"querySmaOptimize"
)
->
i32
;
tsQueryPlannerTrace
=
cfgGetItem
(
pCfg
,
"queryPlannerTrace"
)
->
bval
;
tsQueryNodeChunkSize
=
cfgGetItem
(
pCfg
,
"queryNodeChunkSize"
)
->
i32
;
...
...
tools/shell/src/shellEngine.c
浏览文件 @
a0be0c1d
...
...
@@ -315,6 +315,7 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i
quotationStr
[
0
]
=
'\"'
;
quotationStr
[
1
]
=
0
;
int
n
;
char
buf
[
TSDB_MAX_BYTES_PER_ROW
];
switch
(
field
->
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
...
...
@@ -345,11 +346,24 @@ void shellDumpFieldToFile(TdFilePtr pFile, const char *val, TAOS_FIELD *field, i
taosFprintfFile
(
pFile
,
"%"
PRIu64
,
*
((
uint64_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
taosFprintfFile
(
pFile
,
"%e"
,
GET_FLOAT_VAL
(
val
));
if
(
tsEnableScience
)
{
taosFprintfFile
(
pFile
,
"%e"
,
GET_FLOAT_VAL
(
val
));
}
else
{
taosFprintfFile
(
pFile
,
"%.5f"
,
GET_FLOAT_VAL
(
val
));
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
snprintf
(
buf
,
TSDB_MAX_BYTES_PER_ROW
,
"%*.15e"
,
23
,
GET_DOUBLE_VAL
(
val
));
taosFprintfFile
(
pFile
,
"%s"
,
buf
);
if
(
tsEnableScience
)
{
snprintf
(
buf
,
TSDB_MAX_BYTES_PER_ROW
,
"%*.9e"
,
23
,
GET_DOUBLE_VAL
(
val
));
taosFprintfFile
(
pFile
,
"%s"
,
buf
);
}
else
{
n
=
snprintf
(
buf
,
TSDB_MAX_BYTES_PER_ROW
,
"%*.9f"
,
length
,
GET_DOUBLE_VAL
(
val
));
if
(
n
>
TMAX
(
25
,
length
))
{
taosFprintfFile
(
pFile
,
"%*.15e"
,
length
,
GET_DOUBLE_VAL
(
val
));
}
else
{
taosFprintfFile
(
pFile
,
"%s"
,
buf
);
}
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
...
...
@@ -492,6 +506,8 @@ void shellPrintNChar(const char *str, int32_t length, int32_t width) {
}
}
#define FLOAT_NORMAL_MIN -100000000
#define FLOAT_NORMAL_MAX 100000000
void
shellPrintField
(
const
char
*
val
,
TAOS_FIELD
*
field
,
int32_t
width
,
int32_t
length
,
int32_t
precision
)
{
if
(
val
==
NULL
)
{
int32_t
w
=
width
;
...
...
@@ -505,6 +521,7 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t
return
;
}
int
n
;
char
buf
[
TSDB_MAX_BYTES_PER_ROW
];
switch
(
field
->
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
...
...
@@ -535,11 +552,24 @@ void shellPrintField(const char *val, TAOS_FIELD *field, int32_t width, int32_t
printf
(
"%*"
PRIu64
,
width
,
*
((
uint64_t
*
)
val
));
break
;
case
TSDB_DATA_TYPE_FLOAT
:
printf
(
"%*e"
,
width
,
GET_FLOAT_VAL
(
val
));
if
(
tsEnableScience
)
{
printf
(
"%*e"
,
width
,
GET_FLOAT_VAL
(
val
));
}
else
{
printf
(
"%.5f"
,
GET_FLOAT_VAL
(
val
));
}
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
snprintf
(
buf
,
TSDB_MAX_BYTES_PER_ROW
,
"%.9e"
,
GET_DOUBLE_VAL
(
val
));
printf
(
"%*s"
,
width
,
buf
);
if
(
tsEnableScience
)
{
snprintf
(
buf
,
TSDB_MAX_BYTES_PER_ROW
,
"%.9e"
,
GET_DOUBLE_VAL
(
val
));
printf
(
"%*s"
,
width
,
buf
);
}
else
{
n
=
snprintf
(
buf
,
TSDB_MAX_BYTES_PER_ROW
,
"%*.9f"
,
length
,
GET_DOUBLE_VAL
(
val
));
if
(
n
>
TMAX
(
25
,
length
))
{
printf
(
"%*.15e"
,
length
,
GET_DOUBLE_VAL
(
val
));
}
else
{
printf
(
"%s"
,
buf
);
}
}
break
;
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录