Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
0212fd85
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,发现更多精彩内容 >>
提交
0212fd85
编写于
12月 10, 2019
作者:
B
Boris
提交者:
Jialin Qiao
12月 10, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move show version to server-side (#630)
* move show version to the server and use antlr to parse it.
上级
919cbcab
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
115 addition
and
58 deletion
+115
-58
jdbc/src/main/java/org/apache/iotdb/jdbc/Constant.java
jdbc/src/main/java/org/apache/iotdb/jdbc/Constant.java
+0
-3
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java
...ain/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java
+0
-14
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBMetadataResultMetadata.java
...va/org/apache/iotdb/jdbc/IoTDBMetadataResultMetadata.java
+1
-1
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBMetadataResultSet.java
...in/java/org/apache/iotdb/jdbc/IoTDBMetadataResultSet.java
+0
-5
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
+0
-5
server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
...rc/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
+7
-2
server/src/main/java/org/apache/iotdb/db/qp/constant/SQLConstant.java
...ain/java/org/apache/iotdb/db/qp/constant/SQLConstant.java
+1
-0
server/src/main/java/org/apache/iotdb/db/qp/executor/AbstractQueryProcessExecutor.java
...he/iotdb/db/qp/executor/AbstractQueryProcessExecutor.java
+23
-10
server/src/main/java/org/apache/iotdb/db/qp/physical/sys/ShowPlan.java
...in/java/org/apache/iotdb/db/qp/physical/sys/ShowPlan.java
+1
-1
server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
...ava/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
+10
-3
server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
...va/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
+2
-0
server/src/main/java/org/apache/iotdb/db/query/dataset/SingleDataSet.java
...java/org/apache/iotdb/db/query/dataset/SingleDataSet.java
+52
-0
server/src/main/java/org/apache/iotdb/db/query/executor/EngineQueryRouter.java
...org/apache/iotdb/db/query/executor/EngineQueryRouter.java
+0
-2
server/src/main/java/org/apache/iotdb/db/query/executor/FillEngineExecutor.java
...rg/apache/iotdb/db/query/executor/FillEngineExecutor.java
+0
-1
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
.../main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+15
-8
server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
...org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
+2
-2
service-rpc/rpc-changelist.md
service-rpc/rpc-changelist.md
+1
-0
service-rpc/src/main/thrift/rpc.thrift
service-rpc/src/main/thrift/rpc.thrift
+0
-1
未找到文件。
jdbc/src/main/java/org/apache/iotdb/jdbc/Constant.java
浏览文件 @
0212fd85
...
...
@@ -24,8 +24,6 @@ public class Constant {
public
static
final
String
GLOBAL_DB_NAME
=
"IoTDB"
;
static
final
String
GLOBAL_VERSION
=
"VERSION"
;
public
static
final
String
GLOBAL_COLUMN_REQ
=
"COLUMN"
;
static
final
String
GLOBAL_SHOW_DEVICES_REQ
=
"SHOW_DEVICES"
;
...
...
@@ -50,7 +48,6 @@ public class Constant {
public
static
final
String
CATALOG_STORAGE_GROUP
=
"sg"
;
public
static
final
String
CATALOG_DEVICES
=
"devices"
;
public
static
final
String
CATALOG_CHILD_PATHS
=
"cp"
;
public
static
final
String
CATALOG_VERSION
=
"version"
;
static
final
String
COUNT_TIMESERIES
=
"cntts"
;
static
final
String
COUNT_NODE_TIMESERIES
=
"cntnodets"
;
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBDatabaseMetadata.java
浏览文件 @
0212fd85
...
...
@@ -161,20 +161,6 @@ public class IoTDBDatabaseMetadata implements DatabaseMetaData {
}
catch
(
TException
e
)
{
throw
new
TException
(
"Connection error when fetching timeseries metadata"
,
e
);
}
case
Constant
.
CATALOG_VERSION
:
req
=
new
TSFetchMetadataReq
(
Constant
.
GLOBAL_VERSION
);
req
.
setColumnPath
(
schemaPattern
);
try
{
TSFetchMetadataResp
resp
=
client
.
fetchMetadata
(
req
);
try
{
RpcUtils
.
verifySuccess
(
resp
.
getStatus
());
}
catch
(
IoTDBRPCException
e
)
{
throw
new
IoTDBSQLException
(
e
.
getMessage
(),
resp
.
getStatus
());
}
return
new
IoTDBMetadataResultSet
(
resp
.
getVersion
(),
MetadataType
.
VERSION
);
}
catch
(
TException
e
)
{
throw
new
TException
(
"Connection error when fetching timeseries metadata"
,
e
);
}
default
:
throw
new
SQLException
(
catalog
+
" is not supported. Please refer to the user guide"
+
" for more details."
);
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBMetadataResultMetadata.java
浏览文件 @
0212fd85
...
...
@@ -24,7 +24,7 @@ import java.sql.SQLException;
import
java.sql.Types
;
/*
TsfileMetadataResultMetadata implements a similar api like TsFile
QueryResultSet
IoTDBMetadataResultMetadata implements a similar api like IoTDB
QueryResultSet
to display column metadata.
*/
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBMetadataResultSet.java
浏览文件 @
0212fd85
...
...
@@ -44,7 +44,6 @@ public class IoTDBMetadataResultSet extends IoTDBQueryResultSet {
private
String
currentStorageGroup
;
private
String
currentDevice
;
private
String
currentChildPath
;
private
String
currentVersion
;
private
List
<
String
>
currentTimeseries
;
private
List
<
String
>
timeseriesNumList
;
private
List
<
String
>
nodesNumList
;
...
...
@@ -282,10 +281,6 @@ public class IoTDBMetadataResultSet extends IoTDBQueryResultSet {
currentNode
=
(
String
)
pair
.
getKey
();
currentNodeTimeseriesNum
=
(
String
)
pair
.
getValue
();
break
;
case
VERSION:
currentVersion
=
(
String
)
columnItr
.
next
();
hasNext
=
false
;
break
;
default
:
break
;
}
...
...
jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
浏览文件 @
0212fd85
...
...
@@ -53,7 +53,6 @@ public class IoTDBStatement implements Statement {
private
static
final
String
COUNT_TIMESERIES_COMMAND_LOWERCASE
=
"count timeseries"
;
private
static
final
String
COUNT_NODES_COMMAND_LOWERCASE
=
"count nodes"
;
private
static
final
String
METHOD_NOT_SUPPORTED_STRING
=
"Method not supported"
;
private
static
final
String
SHOW_VERSION_COMMAND_LOWERCASE
=
"show version"
;
ZoneId
zoneId
;
private
ResultSet
resultSet
=
null
;
...
...
@@ -316,10 +315,6 @@ public class IoTDBStatement implements Statement {
resultSet
=
databaseMetaData
.
getNodes
(
Constant
.
COUNT_NODES
,
path
,
null
,
null
,
level
);
return
true
;
}
}
else
if
(
sqlToLowerCase
.
equals
(
SHOW_VERSION_COMMAND_LOWERCASE
))
{
IoTDBDatabaseMetadata
databaseMetadata
=
(
IoTDBDatabaseMetadata
)
connection
.
getMetaData
();
resultSet
=
databaseMetadata
.
getColumns
(
Constant
.
CATALOG_VERSION
,
null
,
null
,
null
);
return
true
;
}
else
{
TSExecuteStatementReq
execReq
=
new
TSExecuteStatementReq
(
sessionHandle
,
sql
,
stmtId
);
TSExecuteStatementResp
execResp
=
client
.
executeStatement
(
execReq
);
...
...
server/src/main/antlr4/org/apache/iotdb/db/qp/strategy/SqlBase.g4
浏览文件 @
0212fd85
...
...
@@ -69,11 +69,11 @@ statement
| SHOW ALL TTL #showAllTTLStatement
| SHOW FLUSH TASK INFO #showFlushTaskInfo
| SHOW DYNAMIC PARAMETER #showDynamicParameter
| SHOW VERSION #showVersion
| LOAD CONFIGURATION #loadConfigurationStatement
| LOAD FILE autoCreateSchema? #loadFiles
| REMOVE FILE#removeFile
| REMOVE FILE
#removeFile
| MOVE FILE FILE #moveFile
| SELECT INDEX func=ID //not support yet
LR_BRACKET
p1=timeseriesPath COMMA p2=timeseriesPath COMMA n1=timeValue COMMA n2=timeValue COMMA
...
...
@@ -621,6 +621,11 @@ PARAMETER
: P A R A M E T E R
;
VERSION
: V E R S I O N
;
REMOVE
: R E M O V E
;
...
...
server/src/main/java/org/apache/iotdb/db/qp/constant/SQLConstant.java
浏览文件 @
0212fd85
...
...
@@ -128,6 +128,7 @@ public class SQLConstant {
public
static
final
int
TOK_LOAD_FILES
=
69
;
public
static
final
int
TOK_REMOVE_FILE
=
70
;
public
static
final
int
TOK_MOVE_FILE
=
71
;
public
static
final
int
TOK_VERSION
=
72
;
public
static
final
Map
<
Integer
,
String
>
tokenSymbol
=
new
HashMap
<>();
public
static
final
Map
<
Integer
,
String
>
tokenNames
=
new
HashMap
<>();
...
...
server/src/main/java/org/apache/iotdb/db/qp/executor/AbstractQueryProcessExecutor.java
浏览文件 @
0212fd85
...
...
@@ -30,6 +30,7 @@ import java.util.ArrayList;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
org.apache.iotdb.db.conf.IoTDBConstant
;
import
org.apache.iotdb.db.conf.IoTDBDescriptor
;
import
org.apache.iotdb.db.conf.adapter.CompressionRatio
;
import
org.apache.iotdb.db.conf.adapter.IoTDBConfigDynamicAdapter
;
...
...
@@ -40,13 +41,18 @@ import org.apache.iotdb.db.exception.query.QueryProcessException;
import
org.apache.iotdb.db.metadata.MManager
;
import
org.apache.iotdb.db.metadata.MNode
;
import
org.apache.iotdb.db.qp.physical.PhysicalPlan
;
import
org.apache.iotdb.db.qp.physical.crud.*
;
import
org.apache.iotdb.db.qp.physical.crud.AggregationPlan
;
import
org.apache.iotdb.db.qp.physical.crud.DeletePlan
;
import
org.apache.iotdb.db.qp.physical.crud.FillQueryPlan
;
import
org.apache.iotdb.db.qp.physical.crud.GroupByPlan
;
import
org.apache.iotdb.db.qp.physical.crud.QueryPlan
;
import
org.apache.iotdb.db.qp.physical.sys.AuthorPlan
;
import
org.apache.iotdb.db.qp.physical.sys.ShowPlan
;
import
org.apache.iotdb.db.qp.physical.sys.ShowTTLPlan
;
import
org.apache.iotdb.db.query.context.QueryContext
;
import
org.apache.iotdb.db.query.dataset.DeviceIterateDataSet
;
import
org.apache.iotdb.db.query.dataset.ListDataSet
;
import
org.apache.iotdb.db.query.dataset.SingleDataSet
;
import
org.apache.iotdb.db.query.executor.EngineQueryRouter
;
import
org.apache.iotdb.db.query.executor.IEngineQueryRouter
;
import
org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException
;
...
...
@@ -58,15 +64,6 @@ import org.apache.iotdb.tsfile.read.expression.QueryExpression;
import
org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet
;
import
org.apache.iotdb.tsfile.utils.Binary
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
static
org
.
apache
.
iotdb
.
db
.
conf
.
IoTDBConstant
.
STORAGE_GROUP
;
import
static
org
.
apache
.
iotdb
.
db
.
conf
.
IoTDBConstant
.
TTL
;
public
abstract
class
AbstractQueryProcessExecutor
implements
IQueryProcessExecutor
{
IEngineQueryRouter
queryRouter
=
new
EngineQueryRouter
();
...
...
@@ -93,6 +90,8 @@ public abstract class AbstractQueryProcessExecutor implements IQueryProcessExecu
return
processShowDynamicParameterQuery
();
case
FLUSH_TASK_INFO:
return
processShowFlushTaskInfo
();
case
VERSION:
return
processShowVersion
();
default
:
throw
new
QueryProcessException
(
String
.
format
(
"Unrecognized show plan %s"
,
showPlan
));
}
...
...
@@ -134,6 +133,20 @@ public abstract class AbstractQueryProcessExecutor implements IQueryProcessExecu
return
listDataSet
;
}
private
QueryDataSet
processShowVersion
()
{
List
<
Path
>
paths
=
new
ArrayList
<>();
List
<
TSDataType
>
dataTypes
=
new
ArrayList
<>();
paths
.
add
(
new
Path
(
"root"
));
dataTypes
.
add
(
TSDataType
.
TEXT
);
SingleDataSet
singleDataSet
=
new
SingleDataSet
(
paths
,
dataTypes
);
Field
field
=
new
Field
(
TSDataType
.
TEXT
);
field
.
setBinaryV
(
new
Binary
(
IoTDBConstant
.
VERSION
));
RowRecord
rowRecord
=
new
RowRecord
(
0
);
rowRecord
.
addField
(
field
);
singleDataSet
.
setRecord
(
rowRecord
);
return
singleDataSet
;
}
private
QueryDataSet
processShowDynamicParameterQuery
()
{
List
<
Path
>
paths
=
new
ArrayList
<>();
paths
.
add
(
new
Path
(
PARAMETER
));
...
...
server/src/main/java/org/apache/iotdb/db/qp/physical/sys/ShowPlan.java
浏览文件 @
0212fd85
...
...
@@ -49,7 +49,7 @@ public class ShowPlan extends PhysicalPlan {
}
public
enum
ShowContentType
{
DYNAMIC_PARAMETER
,
FLUSH_TASK_INFO
,
TTL
DYNAMIC_PARAMETER
,
FLUSH_TASK_INFO
,
TTL
,
VERSION
}
}
server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
浏览文件 @
0212fd85
...
...
@@ -120,6 +120,7 @@ import org.apache.iotdb.db.qp.strategy.SqlBaseParser.SetStorageGroupContext;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.SetTTLStatementContext
;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.ShowAllTTLStatementContext
;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.ShowTTLStatementContext
;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.ShowVersionContext
;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.SlimitClauseContext
;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.SoffsetClauseContext
;
import
org.apache.iotdb.db.qp.strategy.SqlBaseParser.SuffixPathContext
;
...
...
@@ -191,14 +192,14 @@ public class LogicalGenerator extends SqlBaseBaseListener {
@Override
public
void
enterMoveFile
(
MoveFileContext
ctx
)
{
super
.
enterMoveFile
(
ctx
);
initializedOperator
=
new
MoveFileOperator
(
new
File
(
ctx
.
getChild
(
1
).
getText
()),
new
File
(
ctx
.
getChild
(
2
).
getText
()));
initializedOperator
=
new
MoveFileOperator
(
new
File
(
ctx
.
FILE
(
0
).
getText
()),
new
File
(
ctx
.
FILE
(
1
).
getText
()));
}
@Override
public
void
enterRemoveFile
(
RemoveFileContext
ctx
)
{
super
.
enterRemoveFile
(
ctx
);
initializedOperator
=
new
RemoveFileOperator
(
new
File
(
ctx
.
getChild
(
1
).
getText
()));
initializedOperator
=
new
RemoveFileOperator
(
new
File
(
ctx
.
FILE
(
).
getText
()));
}
@Override
...
...
@@ -207,6 +208,12 @@ public class LogicalGenerator extends SqlBaseBaseListener {
initializedOperator
=
new
LoadConfigurationOperator
();
}
@Override
public
void
enterShowVersion
(
ShowVersionContext
ctx
)
{
super
.
enterShowVersion
(
ctx
);
initializedOperator
=
new
ShowOperator
(
SQLConstant
.
TOK_VERSION
);
}
@Override
public
void
enterShowDynamicParameter
(
SqlBaseParser
.
ShowDynamicParameterContext
ctx
)
{
super
.
enterShowDynamicParameter
(
ctx
);
...
...
server/src/main/java/org/apache/iotdb/db/qp/strategy/PhysicalGenerator.java
浏览文件 @
0212fd85
...
...
@@ -168,6 +168,8 @@ public class PhysicalGenerator {
return
new
ShowPlan
(
ShowContentType
.
DYNAMIC_PARAMETER
);
case
SQLConstant
.
TOK_FLUSH_TASK_INFO
:
return
new
ShowPlan
(
ShowContentType
.
FLUSH_TASK_INFO
);
case
SQLConstant
.
TOK_VERSION
:
return
new
ShowPlan
(
ShowContentType
.
VERSION
);
default
:
throw
new
LogicalOperatorException
(
String
.
format
(
"not supported operator type %s in show operation."
,
operator
.
getType
()));
...
...
server/src/main/java/org/apache/iotdb/db/query/dataset/SingleDataSet.java
0 → 100644
浏览文件 @
0212fd85
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package
org.apache.iotdb.db.query.dataset
;
import
java.io.IOException
;
import
java.util.List
;
import
org.apache.iotdb.tsfile.file.metadata.enums.TSDataType
;
import
org.apache.iotdb.tsfile.read.common.Path
;
import
org.apache.iotdb.tsfile.read.common.RowRecord
;
import
org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet
;
public
class
SingleDataSet
extends
QueryDataSet
{
private
RowRecord
record
;
private
int
i
=
0
;
public
SingleDataSet
(
List
<
Path
>
paths
,
List
<
TSDataType
>
dataTypes
)
{
super
(
paths
,
dataTypes
);
}
public
void
setRecord
(
RowRecord
record
)
{
this
.
record
=
record
;
}
@Override
protected
boolean
hasNextWithoutConstraint
()
throws
IOException
{
return
i
==
0
;
}
@Override
protected
RowRecord
nextWithoutConstraint
()
throws
IOException
{
i
++;
return
record
;
}
}
server/src/main/java/org/apache/iotdb/db/query/executor/EngineQueryRouter.java
浏览文件 @
0212fd85
...
...
@@ -24,7 +24,6 @@ import java.util.LinkedList;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.iotdb.db.exception.StorageEngineException
;
import
org.apache.iotdb.db.exception.path.PathException
;
import
org.apache.iotdb.db.exception.query.QueryProcessException
;
import
org.apache.iotdb.db.query.context.QueryContext
;
import
org.apache.iotdb.db.query.dataset.groupby.GroupByWithValueFilterDataSet
;
...
...
@@ -40,7 +39,6 @@ import org.apache.iotdb.tsfile.read.expression.impl.BinaryExpression;
import
org.apache.iotdb.tsfile.read.expression.impl.GlobalTimeExpression
;
import
org.apache.iotdb.tsfile.read.expression.util.ExpressionOptimizer
;
import
org.apache.iotdb.tsfile.read.filter.GroupByFilter
;
import
org.apache.iotdb.tsfile.read.filter.TimeFilter
;
import
org.apache.iotdb.tsfile.read.filter.factory.FilterType
;
import
org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet
;
import
org.apache.iotdb.tsfile.utils.Pair
;
...
...
server/src/main/java/org/apache/iotdb/db/query/executor/FillEngineExecutor.java
浏览文件 @
0212fd85
...
...
@@ -24,7 +24,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.iotdb.db.exception.StorageEngineException
;
import
org.apache.iotdb.db.exception.path.PathException
;
import
org.apache.iotdb.db.exception.query.QueryProcessException
;
import
org.apache.iotdb.db.metadata.MManager
;
import
org.apache.iotdb.db.query.context.QueryContext
;
...
...
server/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
浏览文件 @
0212fd85
...
...
@@ -378,10 +378,6 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
getNodeTimeseriesNum
(
getNodesList
(
req
.
getColumnPath
(),
req
.
getNodeLevel
())));
status
=
getStatus
(
TSStatusCode
.
SUCCESS_STATUS
);
break
;
case
"VERSION"
:
resp
.
setVersion
(
getVersion
());
status
=
getStatus
(
TSStatusCode
.
SUCCESS_STATUS
);
break
;
default
:
status
=
getStatus
(
TSStatusCode
.
METADATA_ERROR
,
req
.
getType
());
break
;
...
...
@@ -422,10 +418,6 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
return
MManager
.
getInstance
().
getChildNodePathInNextLevel
(
path
);
}
private
String
getVersion
()
throws
SQLException
{
return
IoTDBConstant
.
VERSION
;
}
private
List
<
List
<
String
>>
getTimeSeriesForPath
(
String
path
)
throws
PathException
{
return
MManager
.
getInstance
().
getShowTimeseriesPath
(
path
);
...
...
@@ -669,6 +661,8 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
return
executeShowFlushTaskInfo
();
case
DYNAMIC_PARAMETER:
return
executeShowDynamicParameter
();
case
VERSION:
return
executeShowVersion
();
default
:
logger
.
error
(
"Unsupported show content type: {}"
,
showPlan
.
getShowContentType
());
throw
new
Exception
(
"Unsupported show content type:"
+
showPlan
.
getShowContentType
());
...
...
@@ -720,6 +714,19 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
return
resp
;
}
private
TSExecuteStatementResp
executeShowVersion
()
{
TSExecuteStatementResp
resp
=
getTSExecuteStatementResp
(
getStatus
(
TSStatusCode
.
SUCCESS_STATUS
));
resp
.
setIgnoreTimeStamp
(
true
);
List
<
String
>
columns
=
new
ArrayList
<>();
List
<
String
>
columnTypes
=
new
ArrayList
<>();
columns
.
add
(
"version "
);
columnTypes
.
add
(
TSDataType
.
TEXT
.
toString
());
resp
.
setColumns
(
columns
);
resp
.
setDataTypeList
(
columnTypes
);
return
resp
;
}
private
TSExecuteStatementResp
getAuthQueryColumnHeaders
(
PhysicalPlan
plan
)
{
TSExecuteStatementResp
resp
=
getTSExecuteStatementResp
(
getStatus
(
TSStatusCode
.
SUCCESS_STATUS
));
resp
.
setIgnoreTimeStamp
(
true
);
...
...
server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
浏览文件 @
0212fd85
...
...
@@ -208,8 +208,8 @@ public class IoTDBMetadataFetchIT {
boolean
hasResultSet
=
statement
.
execute
(
sql
);
if
(
hasResultSet
)
{
try
(
ResultSet
resultSet
=
statement
.
getResultSet
())
{
ResultSetMetaData
resultSetMetaData
=
resultSet
.
getMetaData
();
Assert
.
assertEquals
(
resultSet
MetaData
.
getColumnLabel
(
1
),
IoTDBConstant
.
VERSION
);
resultSet
.
next
();
Assert
.
assertEquals
(
resultSet
.
getString
(
2
),
IoTDBConstant
.
VERSION
);
}
}
}
catch
(
Exception
e
)
{
...
...
service-rpc/rpc-changelist.md
浏览文件 @
0212fd85
...
...
@@ -32,6 +32,7 @@ Last Updated on October 27th, 2019 by Lei Rui.
| Delete struct TSSetStorageGroupReq | Jialin Qiao |
| Remove struct TSDataValue | Lei Rui |
| Remove struct TSRowRecord | Lei Rui |
| Remove optional string version in TSFetchMetadataResp | Genius_pig |
...
...
service-rpc/src/main/thrift/rpc.thrift
浏览文件 @
0212fd85
...
...
@@ -198,7 +198,6 @@ struct TSFetchMetadataResp{
9: optional list<string> nodesList
10: optional map<string, string> nodeTimeseriesNum
11: optional set<string> childPaths
12: optional string version
}
struct TSFetchMetadataReq{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录