Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
d33dbed0
I
Iotdb
项目概览
apache
/
Iotdb
12 个月 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d33dbed0
编写于
4月 21, 2020
作者:
B
Boris
提交者:
GitHub
4月 21, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update client. (#1076)
上级
9e8fe564
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
60 addition
and
25 deletion
+60
-25
client/src/main/java/org/apache/iotdb/client/AbstractClient.java
...src/main/java/org/apache/iotdb/client/AbstractClient.java
+59
-24
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
.../main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+1
-1
未找到文件。
client/src/main/java/org/apache/iotdb/client/AbstractClient.java
浏览文件 @
d33dbed0
...
...
@@ -25,6 +25,7 @@ import org.apache.commons.lang3.ArrayUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.iotdb.exception.ArgsErrorException
;
import
org.apache.iotdb.jdbc.IoTDBConnection
;
import
org.apache.iotdb.jdbc.IoTDBNonAlignQueryResultSet
;
import
org.apache.iotdb.jdbc.IoTDBQueryResultSet
;
import
org.apache.iotdb.service.rpc.thrift.ServerProperties
;
import
org.apache.iotdb.tool.ImportCsv
;
...
...
@@ -70,7 +71,7 @@ public abstract class AbstractClient {
static
final
String
MAX_PRINT_ROW_COUNT_ARGS
=
"maxPRC"
;
private
static
final
String
MAX_PRINT_ROW_COUNT_NAME
=
"maxPrintRowCount"
;
static
final
String
RPC_COMPRESS_ARGS
=
"c"
;
static
final
String
RPC_COMPRESS_NAME
=
"rpcCompressed"
;
private
static
final
String
RPC_COMPRESS_NAME
=
"rpcCompressed"
;
static
final
String
SET_MAX_DISPLAY_NUM
=
"set max_display_num"
;
static
final
String
SET_TIMESTAMP_DISPLAY
=
"set time_display_type"
;
static
final
String
SHOW_TIMESTAMP_DISPLAY
=
"show time_display_type"
;
...
...
@@ -582,40 +583,74 @@ public abstract class AbstractClient {
*/
private
static
List
<
List
<
String
>>
cacheResult
(
ResultSet
resultSet
,
List
<
Integer
>
maxSizeList
,
int
columnCount
,
ResultSetMetaData
resultSetMetaData
,
ZoneId
zoneId
)
throws
SQLException
{
boolean
printTimestamp
=
!((
IoTDBQueryResultSet
)
resultSet
).
isIgnoreTimeStamp
();
List
<
List
<
String
>>
lists
=
new
ArrayList
<>(
columnCount
);
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++)
{
List
<
String
>
list
=
new
ArrayList
<>(
maxPrintRowCount
+
1
);
list
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
));
lists
.
add
(
list
);
maxSizeList
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
).
length
());
if
(
resultSet
instanceof
IoTDBQueryResultSet
)
{
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++)
{
List
<
String
>
list
=
new
ArrayList
<>(
maxPrintRowCount
+
1
);
list
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
));
lists
.
add
(
list
);
maxSizeList
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
).
length
());
}
}
else
{
for
(
int
i
=
1
;
i
<=
columnCount
;
i
+=
2
)
{
List
<
String
>
timeList
=
new
ArrayList
<>(
maxPrintRowCount
+
1
);
timeList
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
).
substring
(
0
,
TIMESTAMP_STR
.
length
()));
lists
.
add
(
timeList
);
List
<
String
>
valueList
=
new
ArrayList
<>(
maxPrintRowCount
+
1
);
valueList
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
+
1
));
lists
.
add
(
valueList
);
maxSizeList
.
add
(
TIMESTAMP_STR
.
length
());
maxSizeList
.
add
(
resultSetMetaData
.
getColumnLabel
(
i
+
1
).
length
());
}
}
int
j
=
0
;
if
(
cursorBeforeFirst
)
{
isReachEnd
=
!
resultSet
.
next
();
cursorBeforeFirst
=
false
;
}
while
(
j
<
maxPrintRowCount
&&
!
isReachEnd
)
{
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++)
{
String
tmp
;
if
(
printTimestamp
&&
i
==
1
)
{
tmp
=
formatDatetime
(
resultSet
.
getLong
(
TIMESTAMP_STR
),
zoneId
);
}
else
{
tmp
=
resultSet
.
getString
(
i
);
}
if
(
tmp
==
null
)
{
tmp
=
NULL
;
if
(
resultSet
instanceof
IoTDBQueryResultSet
)
{
boolean
printTimestamp
=
!((
IoTDBQueryResultSet
)
resultSet
).
isIgnoreTimeStamp
();
while
(
j
<
maxPrintRowCount
&&
!
isReachEnd
)
{
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++)
{
String
tmp
;
if
(
printTimestamp
&&
i
==
1
)
{
tmp
=
formatDatetime
(
resultSet
.
getLong
(
TIMESTAMP_STR
),
zoneId
);
}
else
{
tmp
=
resultSet
.
getString
(
i
);
}
if
(
tmp
==
null
)
{
tmp
=
NULL
;
}
lists
.
get
(
i
-
1
).
add
(
tmp
);
if
(
maxSizeList
.
get
(
i
-
1
)
<
tmp
.
length
())
{
maxSizeList
.
set
(
i
-
1
,
tmp
.
length
());
}
}
lists
.
get
(
i
-
1
).
add
(
tmp
);
if
(
maxSizeList
.
get
(
i
-
1
)
<
tmp
.
length
())
{
maxSizeList
.
set
(
i
-
1
,
tmp
.
length
());
j
++;
isReachEnd
=
!
resultSet
.
next
();
}
return
lists
;
}
else
{
while
(
j
<
maxPrintRowCount
&&
!
isReachEnd
)
{
for
(
int
i
=
1
;
i
<=
columnCount
;
i
++)
{
String
tmp
;
tmp
=
resultSet
.
getString
(
i
);
if
(
tmp
==
null
)
{
tmp
=
NULL
;
}
if
(
i
%
2
!=
0
&&
!
tmp
.
equals
(
NULL
))
{
tmp
=
formatDatetime
(
Long
.
parseLong
(
tmp
),
zoneId
);
}
lists
.
get
(
i
-
1
).
add
(
tmp
);
if
(
maxSizeList
.
get
(
i
-
1
)
<
tmp
.
length
())
{
maxSizeList
.
set
(
i
-
1
,
tmp
.
length
());
}
}
j
++;
isReachEnd
=
!
resultSet
.
next
();
}
j
++;
isReachEnd
=
!
resultSet
.
next
();
return
lists
;
}
return
lists
;
}
private
static
void
output
(
List
<
List
<
String
>>
lists
,
List
<
Integer
>
maxSizeList
)
{
...
...
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
浏览文件 @
d33dbed0
...
...
@@ -556,7 +556,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
// create and cache dataset
QueryDataSet
newDataSet
=
createQueryDataSet
(
queryId
,
plan
);
if
(
plan
instanceof
QueryPlan
&&
!((
QueryPlan
)
plan
).
isAlignByTime
())
{
if
(
plan
instanceof
QueryPlan
&&
!((
QueryPlan
)
plan
).
isAlignByTime
()
&&
newDataSet
instanceof
NonAlignEngineDataSet
)
{
TSQueryNonAlignDataSet
result
=
fillRpcNonAlignReturnData
(
fetchSize
,
newDataSet
,
username
);
resp
.
setNonAlignQueryDataSet
(
result
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录