You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/12/30 13:19:44 UTC
[GitHub] [incubator-iotdb] Genius-pig opened a new pull request #697: Move
All command.
Genius-pig opened a new pull request #697: Move All command.
URL: https://github.com/apache/incubator-iotdb/pull/697
Move All command.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304962
##########
File path: jdbc/src/test/java/org/apache/iotdb/jdbc/IoTDBStatementTest.java
##########
@@ -74,149 +74,149 @@ public void setUp() throws Exception {
public void tearDown() throws Exception {
}
- @SuppressWarnings({"resource", "serial"})
- @Test
- public void testExecuteSQL1() throws SQLException {
- IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
- List<List<String>> tsList = new ArrayList<>();
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s0");
- add("root.vehicle");
- add("INT32");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s1");
- add("root.vehicle");
- add("INT64");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s2");
- add("root.vehicle");
- add("FLOAT");
- add("RLE");
- }
- });
- String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
- + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
- + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
- + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
- when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
- boolean res = stmt.execute("show timeseries");
- assertTrue(res);
- try (ResultSet resultSet = stmt.getResultSet()) {
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- int colCount = resultSetMetaData.getColumnCount();
- StringBuilder resultStr = new StringBuilder();
- for (int i = 1; i < colCount + 1; i++) {
- resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
- }
- resultStr.append("\n");
- while (resultSet.next()) {
- for (int i = 1; i <= colCount; i++) {
- resultStr.append(resultSet.getString(i)).append(",");
- }
- resultStr.append("\n");
- }
- Assert.assertEquals(resultStr.toString(), standard);
- } catch (SQLException e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
-
- @SuppressWarnings({"resource", "serial"})
- @Test
- public void testExecuteSQL2() throws SQLException {
- IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
- List<List<String>> tsList = new ArrayList<>();
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s0");
- add("root.vehicle");
- add("INT32");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s1");
- add("root.vehicle");
- add("INT64");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s2");
- add("root.vehicle");
- add("FLOAT");
- add("RLE");
- }
- });
- String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
- + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
- + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
- + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
- when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
- boolean res = stmt.execute("show timeseries root.vehicle.d0");
- assertTrue(res);
- try (ResultSet resultSet = stmt.getResultSet()) {
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- int colCount = resultSetMetaData.getColumnCount();
- StringBuilder resultStr = new StringBuilder();
- for (int i = 1; i < colCount + 1; i++) {
- resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
- }
- resultStr.append("\n");
- while (resultSet.next()) {
- for (int i = 1; i <= colCount; i++) {
- resultStr.append(resultSet.getString(i)).append(",");
- }
- resultStr.append("\n");
- }
- Assert.assertEquals(resultStr.toString(), standard);
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
-
- @SuppressWarnings({"resource"})
- @Test
- public void testExecuteSQL3() throws SQLException {
- IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
- Set<String> sgSet = new HashSet<>();
- sgSet.add("root.vehicle");
- when(fetchMetadataResp.getStorageGroups()).thenReturn(sgSet);
- String standard = "Storage Group,\nroot.vehicle,\n";
- boolean res = stmt.execute("show storage group");
- assertTrue(res);
- try (ResultSet resultSet = stmt.getResultSet()) {
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- int colCount = resultSetMetaData.getColumnCount();
- StringBuilder resultStr = new StringBuilder();
- for (int i = 1; i < colCount + 1; i++) {
- resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
- }
- resultStr.append("\n");
- while (resultSet.next()) {
- for (int i = 1; i <= colCount; i++) {
- resultStr.append(resultSet.getString(i)).append(",");
- }
- resultStr.append("\n");
- }
- Assert.assertEquals(resultStr.toString(), standard);
- } catch (SQLException e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
+// @SuppressWarnings({"resource", "serial"})
+// @Test
+// public void testExecuteSQL1() throws SQLException {
+// IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
+// List<List<String>> tsList = new ArrayList<>();
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s0");
+// add("root.vehicle");
+// add("INT32");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s1");
+// add("root.vehicle");
+// add("INT64");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s2");
+// add("root.vehicle");
+// add("FLOAT");
+// add("RLE");
+// }
+// });
+// String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
+// + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
+// + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
+// + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
+// when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
+// boolean res = stmt.execute("show timeseries");
+// assertTrue(res);
+// try (ResultSet resultSet = stmt.getResultSet()) {
+// ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+// int colCount = resultSetMetaData.getColumnCount();
+// StringBuilder resultStr = new StringBuilder();
+// for (int i = 1; i < colCount + 1; i++) {
+// resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
+// }
+// resultStr.append("\n");
+// while (resultSet.next()) {
+// for (int i = 1; i <= colCount; i++) {
+// resultStr.append(resultSet.getString(i)).append(",");
+// }
+// resultStr.append("\n");
+// }
+// Assert.assertEquals(resultStr.toString(), standard);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// Assert.fail(e.getMessage());
+// }
+// }
+//
+// @SuppressWarnings({"resource", "serial"})
+// @Test
+// public void testExecuteSQL2() throws SQLException {
+// IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
+// List<List<String>> tsList = new ArrayList<>();
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s0");
+// add("root.vehicle");
+// add("INT32");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s1");
+// add("root.vehicle");
+// add("INT64");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s2");
+// add("root.vehicle");
+// add("FLOAT");
+// add("RLE");
+// }
+// });
+// String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
+// + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
+// + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
+// + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
+// when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
+// boolean res = stmt.execute("show timeseries root.vehicle.d0");
+// assertTrue(res);
+// try (ResultSet resultSet = stmt.getResultSet()) {
+// ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+// int colCount = resultSetMetaData.getColumnCount();
+// StringBuilder resultStr = new StringBuilder();
+// for (int i = 1; i < colCount + 1; i++) {
+// resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
+// }
+// resultStr.append("\n");
+// while (resultSet.next()) {
+// for (int i = 1; i <= colCount; i++) {
+// resultStr.append(resultSet.getString(i)).append(",");
+// }
+// resultStr.append("\n");
+// }
+// Assert.assertEquals(resultStr.toString(), standard);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// }
+// }
+//
+// @SuppressWarnings({"resource"})
+// @Test
+// public void testExecuteSQL3() throws SQLException {
+// IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
+// Set<String> sgSet = new HashSet<>();
+// sgSet.add("root.vehicle");
+// when(fetchMetadataResp.getStorageGroups()).thenReturn(sgSet);
+// String standard = "Storage Group,\nroot.vehicle,\n";
+// boolean res = stmt.execute("show storage group");
+// assertTrue(res);
+// try (ResultSet resultSet = stmt.getResultSet()) {
+// ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+// int colCount = resultSetMetaData.getColumnCount();
+// StringBuilder resultStr = new StringBuilder();
+// for (int i = 1; i < colCount + 1; i++) {
+// resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
+// }
+// resultStr.append("\n");
+// while (resultSet.next()) {
+// for (int i = 1; i <= colCount; i++) {
+// resultStr.append(resultSet.getString(i)).append(",");
+// }
+// resultStr.append("\n");
+// }
+// Assert.assertEquals(resultStr.toString(), standard);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// Assert.fail(e.getMessage());
+// }
+// }
Review comment:
fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362718373
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/sys/CountPlan.java
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.qp.physical.sys;
+
+import org.apache.iotdb.tsfile.read.common.Path;
+
+public class CountPlan extends ShowPlan {
Review comment:
```suggestion
public class CountNodePlan extends ShowPlan {
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362176329
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/AbstractQueryProcessExecutor.java
##########
@@ -91,11 +104,167 @@ private QueryDataSet processShowQuery(ShowPlan showPlan) throws QueryProcessExce
return processShowFlushTaskInfo();
case VERSION:
return processShowVersion();
+ case TIMESERIES:
+ return processShowTimeseries((ShowTimeSeriesPlan) showPlan);
+ case STORAGE_GROUP:
+ return processShowStorageGroup();
+ case DEVICES:
+ return processShowDevices();
+ case CHILD_PATH:
+ return processShowChildPaths((ShowChildPathsPlan) showPlan);
+ case COUNT_TIMESERIES:
+ return processCountTimeSeries((CountPlan) showPlan);
+ case COUNT_NODE_TIMESERIES:
+ return processCountNodeTimeSeries((CountPlan) showPlan);
+ case COUNT_NODES:
+ return processCountNodes((CountPlan) showPlan);
default:
throw new QueryProcessException(String.format("Unrecognized show plan %s", showPlan));
}
}
+ private QueryDataSet processCountNodes(CountPlan countPlan) throws SQLException {
+ List<String> nodes = getNodesList(countPlan.getPath().toString(), countPlan.getLevel());
+ int num = nodes.size();
+ List<Path> paths = new ArrayList<>();
+ paths.add(new Path(COLUMN_COUNT));
+ List<TSDataType> dataTypes = new ArrayList<>();
+ dataTypes.add(TSDataType.INT32);
Review comment:
It would be better to use `Collection.singletonList` and `Arrays.asList` to create lists that all elements are known as the lists will be more compact.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304892
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
Show statement are already tested in `showStorageGroupTest`, `showTimeseriesTest()` of `IoTDBMetadataFetchIT`. `showTimeseriesPath1()`, `showTimeseriesPath1()` and `showStorageGroup()` are similar to above tests, the difference is using `getColumn()` method. I think the only `show devices` needs to be tested.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362718461
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/sys/ShowTimeSeriesPlan.java
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.qp.physical.sys;
+
+import org.apache.iotdb.tsfile.read.common.Path;
+
+public class ShowTimeSeriesPlan extends ShowPlan{
+ private Path path;
Review comment:
```suggestion
private Path prefixPath;
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362174893
##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
##########
@@ -58,7 +58,14 @@ private IoTDBConstant() {
public static final String COLUMN_ITEM = " item";
public static final String COLUMN_PARAMETER = " parameter";
public static final String COLUMN_VALUE = "value";
- public static final String COLUMN_VERSION = "version ";
+ public static final String COLUMN_VERSION = " version";
+ public static final String COLUMN_TIMESERIES = "timeseries";
+ public static final String COLUMN_TIMESERIES_DataType = "dataType";
+ public static final String COLUMN_TIMESERIES_Encoding = "encoding";
Review comment:
DataType -> DATATYPE
Encoding -> ENCODING
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304965
##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
##########
@@ -58,7 +58,14 @@ private IoTDBConstant() {
public static final String COLUMN_ITEM = " item";
public static final String COLUMN_PARAMETER = " parameter";
public static final String COLUMN_VALUE = "value";
- public static final String COLUMN_VERSION = "version ";
+ public static final String COLUMN_VERSION = " version";
+ public static final String COLUMN_TIMESERIES = "timeseries";
+ public static final String COLUMN_TIMESERIES_DataType = "dataType";
+ public static final String COLUMN_TIMESERIES_Encoding = "encoding";
Review comment:
fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: [IOTDB-138] Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: [IOTDB-138] Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362736075
##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
##########
@@ -60,8 +60,8 @@ private IoTDBConstant() {
public static final String COLUMN_VALUE = "value";
public static final String COLUMN_VERSION = " version";
public static final String COLUMN_TIMESERIES = "timeseries";
- public static final String COLUMN_TIMESERIES_DataType = "dataType";
- public static final String COLUMN_TIMESERIES_Encoding = "encoding";
+ public static final String COLUMN_TIMESERIES_DataType = "DATATYPE";
+ public static final String COLUMN_TIMESERIES_Encoding = "ENCODING";
Review comment:
Sorry I did not make it clear, I mean COLUMN_TIMESERIES_DataType -> COLUMN_TIMESERIES_DATATYPE and
COLUMN_TIMESERIES_Encoding -> COLUMN_TIMESERIES_ENCODING since static final variables should be in the upper case. And please revert the strings because other column names are still in lower case.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304967
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/AbstractQueryProcessExecutor.java
##########
@@ -91,11 +104,167 @@ private QueryDataSet processShowQuery(ShowPlan showPlan) throws QueryProcessExce
return processShowFlushTaskInfo();
case VERSION:
return processShowVersion();
+ case TIMESERIES:
+ return processShowTimeseries((ShowTimeSeriesPlan) showPlan);
+ case STORAGE_GROUP:
+ return processShowStorageGroup();
+ case DEVICES:
+ return processShowDevices();
+ case CHILD_PATH:
+ return processShowChildPaths((ShowChildPathsPlan) showPlan);
+ case COUNT_TIMESERIES:
+ return processCountTimeSeries((CountPlan) showPlan);
+ case COUNT_NODE_TIMESERIES:
+ return processCountNodeTimeSeries((CountPlan) showPlan);
+ case COUNT_NODES:
+ return processCountNodes((CountPlan) showPlan);
default:
throw new QueryProcessException(String.format("Unrecognized show plan %s", showPlan));
}
}
+ private QueryDataSet processCountNodes(CountPlan countPlan) throws SQLException {
+ List<String> nodes = getNodesList(countPlan.getPath().toString(), countPlan.getLevel());
+ int num = nodes.size();
+ List<Path> paths = new ArrayList<>();
+ paths.add(new Path(COLUMN_COUNT));
+ List<TSDataType> dataTypes = new ArrayList<>();
+ dataTypes.add(TSDataType.INT32);
Review comment:
fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] qiaojialin merged pull request #697: [IOTDB-138]
Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
qiaojialin merged pull request #697: [IOTDB-138] Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362301279
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
They are used to test the show statements instead of `getColumn()`, you just changed the way of using them and commenting them will make the functionality untested, which should be avoided.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362355326
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
In that case, you should remove this code because `getColumn` is deprecated.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362174397
##########
File path: jdbc/src/test/java/org/apache/iotdb/jdbc/IoTDBStatementTest.java
##########
@@ -74,149 +74,149 @@ public void setUp() throws Exception {
public void tearDown() throws Exception {
}
- @SuppressWarnings({"resource", "serial"})
- @Test
- public void testExecuteSQL1() throws SQLException {
- IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
- List<List<String>> tsList = new ArrayList<>();
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s0");
- add("root.vehicle");
- add("INT32");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s1");
- add("root.vehicle");
- add("INT64");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s2");
- add("root.vehicle");
- add("FLOAT");
- add("RLE");
- }
- });
- String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
- + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
- + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
- + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
- when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
- boolean res = stmt.execute("show timeseries");
- assertTrue(res);
- try (ResultSet resultSet = stmt.getResultSet()) {
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- int colCount = resultSetMetaData.getColumnCount();
- StringBuilder resultStr = new StringBuilder();
- for (int i = 1; i < colCount + 1; i++) {
- resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
- }
- resultStr.append("\n");
- while (resultSet.next()) {
- for (int i = 1; i <= colCount; i++) {
- resultStr.append(resultSet.getString(i)).append(",");
- }
- resultStr.append("\n");
- }
- Assert.assertEquals(resultStr.toString(), standard);
- } catch (SQLException e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
-
- @SuppressWarnings({"resource", "serial"})
- @Test
- public void testExecuteSQL2() throws SQLException {
- IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
- List<List<String>> tsList = new ArrayList<>();
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s0");
- add("root.vehicle");
- add("INT32");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s1");
- add("root.vehicle");
- add("INT64");
- add("RLE");
- }
- });
- tsList.add(new ArrayList<String>(4) {
- {
- add("root.vehicle.d0.s2");
- add("root.vehicle");
- add("FLOAT");
- add("RLE");
- }
- });
- String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
- + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
- + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
- + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
- when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
- boolean res = stmt.execute("show timeseries root.vehicle.d0");
- assertTrue(res);
- try (ResultSet resultSet = stmt.getResultSet()) {
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- int colCount = resultSetMetaData.getColumnCount();
- StringBuilder resultStr = new StringBuilder();
- for (int i = 1; i < colCount + 1; i++) {
- resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
- }
- resultStr.append("\n");
- while (resultSet.next()) {
- for (int i = 1; i <= colCount; i++) {
- resultStr.append(resultSet.getString(i)).append(",");
- }
- resultStr.append("\n");
- }
- Assert.assertEquals(resultStr.toString(), standard);
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
-
- @SuppressWarnings({"resource"})
- @Test
- public void testExecuteSQL3() throws SQLException {
- IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
- Set<String> sgSet = new HashSet<>();
- sgSet.add("root.vehicle");
- when(fetchMetadataResp.getStorageGroups()).thenReturn(sgSet);
- String standard = "Storage Group,\nroot.vehicle,\n";
- boolean res = stmt.execute("show storage group");
- assertTrue(res);
- try (ResultSet resultSet = stmt.getResultSet()) {
- ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
- int colCount = resultSetMetaData.getColumnCount();
- StringBuilder resultStr = new StringBuilder();
- for (int i = 1; i < colCount + 1; i++) {
- resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
- }
- resultStr.append("\n");
- while (resultSet.next()) {
- for (int i = 1; i <= colCount; i++) {
- resultStr.append(resultSet.getString(i)).append(",");
- }
- resultStr.append("\n");
- }
- Assert.assertEquals(resultStr.toString(), standard);
- } catch (SQLException e) {
- e.printStackTrace();
- Assert.fail(e.getMessage());
- }
- }
+// @SuppressWarnings({"resource", "serial"})
+// @Test
+// public void testExecuteSQL1() throws SQLException {
+// IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
+// List<List<String>> tsList = new ArrayList<>();
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s0");
+// add("root.vehicle");
+// add("INT32");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s1");
+// add("root.vehicle");
+// add("INT64");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s2");
+// add("root.vehicle");
+// add("FLOAT");
+// add("RLE");
+// }
+// });
+// String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
+// + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
+// + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
+// + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
+// when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
+// boolean res = stmt.execute("show timeseries");
+// assertTrue(res);
+// try (ResultSet resultSet = stmt.getResultSet()) {
+// ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+// int colCount = resultSetMetaData.getColumnCount();
+// StringBuilder resultStr = new StringBuilder();
+// for (int i = 1; i < colCount + 1; i++) {
+// resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
+// }
+// resultStr.append("\n");
+// while (resultSet.next()) {
+// for (int i = 1; i <= colCount; i++) {
+// resultStr.append(resultSet.getString(i)).append(",");
+// }
+// resultStr.append("\n");
+// }
+// Assert.assertEquals(resultStr.toString(), standard);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// Assert.fail(e.getMessage());
+// }
+// }
+//
+// @SuppressWarnings({"resource", "serial"})
+// @Test
+// public void testExecuteSQL2() throws SQLException {
+// IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
+// List<List<String>> tsList = new ArrayList<>();
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s0");
+// add("root.vehicle");
+// add("INT32");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s1");
+// add("root.vehicle");
+// add("INT64");
+// add("RLE");
+// }
+// });
+// tsList.add(new ArrayList<String>(4) {
+// {
+// add("root.vehicle.d0.s2");
+// add("root.vehicle");
+// add("FLOAT");
+// add("RLE");
+// }
+// });
+// String standard = "Timeseries,Storage Group,DataType,Encoding,\n"
+// + "root.vehicle.d0.s0,root.vehicle,INT32,RLE,\n"
+// + "root.vehicle.d0.s1,root.vehicle,INT64,RLE,\n"
+// + "root.vehicle.d0.s2,root.vehicle,FLOAT,RLE,\n";
+// when(fetchMetadataResp.getTimeseriesList()).thenReturn(tsList);
+// boolean res = stmt.execute("show timeseries root.vehicle.d0");
+// assertTrue(res);
+// try (ResultSet resultSet = stmt.getResultSet()) {
+// ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+// int colCount = resultSetMetaData.getColumnCount();
+// StringBuilder resultStr = new StringBuilder();
+// for (int i = 1; i < colCount + 1; i++) {
+// resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
+// }
+// resultStr.append("\n");
+// while (resultSet.next()) {
+// for (int i = 1; i <= colCount; i++) {
+// resultStr.append(resultSet.getString(i)).append(",");
+// }
+// resultStr.append("\n");
+// }
+// Assert.assertEquals(resultStr.toString(), standard);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// }
+// }
+//
+// @SuppressWarnings({"resource"})
+// @Test
+// public void testExecuteSQL3() throws SQLException {
+// IoTDBStatement stmt = new IoTDBStatement(connection, client, sessionId, zoneID);
+// Set<String> sgSet = new HashSet<>();
+// sgSet.add("root.vehicle");
+// when(fetchMetadataResp.getStorageGroups()).thenReturn(sgSet);
+// String standard = "Storage Group,\nroot.vehicle,\n";
+// boolean res = stmt.execute("show storage group");
+// assertTrue(res);
+// try (ResultSet resultSet = stmt.getResultSet()) {
+// ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+// int colCount = resultSetMetaData.getColumnCount();
+// StringBuilder resultStr = new StringBuilder();
+// for (int i = 1; i < colCount + 1; i++) {
+// resultStr.append(resultSetMetaData.getColumnName(i)).append(",");
+// }
+// resultStr.append("\n");
+// while (resultSet.next()) {
+// for (int i = 1; i <= colCount; i++) {
+// resultStr.append(resultSet.getString(i)).append(",");
+// }
+// resultStr.append("\n");
+// }
+// Assert.assertEquals(resultStr.toString(), standard);
+// } catch (SQLException e) {
+// e.printStackTrace();
+// Assert.fail(e.getMessage());
+// }
+// }
Review comment:
Remove or reuse it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304892
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
Show statement are already tested in `showStorageGroupTest`, `showTimeseriesTest()` of `IoTDBMetadataFetchIT`. `showTimeseriesPath1()`, `showTimeseriesPath1()` and `showStorageGroup()` are similar to above tests, the difference is using `getColumn()` method.
I think the only `show devices` needs to be tested.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362722656
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/sys/CountPlan.java
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.qp.physical.sys;
+
+import org.apache.iotdb.tsfile.read.common.Path;
+
+public class CountPlan extends ShowPlan {
Review comment:
`CountPlan` is used to count time-series and count nodes. So `CountPlan` is better.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: [IOTDB-138] Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: [IOTDB-138] Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362728688
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/logical/sys/CountOperator.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.qp.logical.sys;
+
+import org.apache.iotdb.tsfile.read.common.Path;
+
+public class CountOperator extends ShowOperator{
Review comment:
OK, add javadoc.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] qiaojialin commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
qiaojialin commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362718275
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/logical/sys/CountOperator.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.qp.logical.sys;
+
+import org.apache.iotdb.tsfile.read.common.Path;
+
+public class CountOperator extends ShowOperator{
Review comment:
add javadoc, give a sql example or change to a more precise name
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304965
##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConstant.java
##########
@@ -58,7 +58,14 @@ private IoTDBConstant() {
public static final String COLUMN_ITEM = " item";
public static final String COLUMN_PARAMETER = " parameter";
public static final String COLUMN_VALUE = "value";
- public static final String COLUMN_VERSION = "version ";
+ public static final String COLUMN_VERSION = " version";
+ public static final String COLUMN_TIMESERIES = "timeseries";
+ public static final String COLUMN_TIMESERIES_DataType = "dataType";
+ public static final String COLUMN_TIMESERIES_Encoding = "encoding";
Review comment:
fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362192365
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
These tests are used to test `getColumn()` method which I have already disabled, `getColumn()` method is to be implemented in the future. I comment the code out because of maybe useful when
`getColumn()` method is implemented.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362304968
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
##########
@@ -168,6 +177,47 @@ RootOperator getLogicalPlan() {
return initializedOperator;
}
+ @Override
+ public void enterCountTimeseries(CountTimeseriesContext ctx) {
+ super.enterCountTimeseries(ctx);
+ if(ctx.INT() != null) {
+ initializedOperator = new CountOperator(SQLConstant.TOK_COUNT_NODE_TIMESERIES,
+ parsePrefixPath(ctx.prefixPath()), Integer.parseInt(ctx.INT().getText()));
+ } else {
+ initializedOperator = new CountOperator(SQLConstant.TOK_COUNT_TIMESERIES,
+ parsePrefixPath(ctx.prefixPath()));
+ }
+ }
+
+ @Override
+ public void enterCountNodes(CountNodesContext ctx) {
+ super.enterCountNodes(ctx);
+ initializedOperator = new CountOperator(SQLConstant.TOK_COUNT_NODES,
+ parsePrefixPath(ctx.prefixPath()), Integer.parseInt(ctx.INT().getText()));
+ }
+
+ @Override
+ public void enterShowDevices(ShowDevicesContext ctx) {
+ super.enterShowDevices(ctx);
+ initializedOperator = new ShowOperator(SQLConstant.TOK_DEVICES);
+ }
+
+ @Override
+ public void enterShowChildPaths(ShowChildPathsContext ctx) {
+ super.enterShowChildPaths(ctx);
+ if(ctx.prefixPath()!= null) {
+ initializedOperator = new ShowChildPathsOperator(SQLConstant.TOK_CHILD_PATHS, parsePrefixPath(ctx.prefixPath()));
+ } else {
+ initializedOperator = new ShowChildPathsOperator(SQLConstant.TOK_CHILD_PATHS, new Path("root"));
Review comment:
fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362177784
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
##########
@@ -168,6 +177,47 @@ RootOperator getLogicalPlan() {
return initializedOperator;
}
+ @Override
+ public void enterCountTimeseries(CountTimeseriesContext ctx) {
+ super.enterCountTimeseries(ctx);
+ if(ctx.INT() != null) {
+ initializedOperator = new CountOperator(SQLConstant.TOK_COUNT_NODE_TIMESERIES,
+ parsePrefixPath(ctx.prefixPath()), Integer.parseInt(ctx.INT().getText()));
+ } else {
+ initializedOperator = new CountOperator(SQLConstant.TOK_COUNT_TIMESERIES,
+ parsePrefixPath(ctx.prefixPath()));
+ }
+ }
+
+ @Override
+ public void enterCountNodes(CountNodesContext ctx) {
+ super.enterCountNodes(ctx);
+ initializedOperator = new CountOperator(SQLConstant.TOK_COUNT_NODES,
+ parsePrefixPath(ctx.prefixPath()), Integer.parseInt(ctx.INT().getText()));
+ }
+
+ @Override
+ public void enterShowDevices(ShowDevicesContext ctx) {
+ super.enterShowDevices(ctx);
+ initializedOperator = new ShowOperator(SQLConstant.TOK_DEVICES);
+ }
+
+ @Override
+ public void enterShowChildPaths(ShowChildPathsContext ctx) {
+ super.enterShowChildPaths(ctx);
+ if(ctx.prefixPath()!= null) {
+ initializedOperator = new ShowChildPathsOperator(SQLConstant.TOK_CHILD_PATHS, parsePrefixPath(ctx.prefixPath()));
+ } else {
+ initializedOperator = new ShowChildPathsOperator(SQLConstant.TOK_CHILD_PATHS, new Path("root"));
Review comment:
Use the root in the constant.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
jt2594838 commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362178184
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
Please rewrite the tests.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362192365
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
These tests are used to test `getColumn()` method which I have already disabled, `getColumn()` method is to be implemented in the future. I comment the code out because of maybe useful when `getColumn()` method is implemented.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: [IOTDB-138] Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: [IOTDB-138] Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362732213
##########
File path: server/src/main/java/org/apache/iotdb/db/qp/physical/sys/ShowTimeSeriesPlan.java
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.qp.physical.sys;
+
+import org.apache.iotdb.tsfile.read.common.Path;
+
+public class ShowTimeSeriesPlan extends ShowPlan{
+ private Path path;
Review comment:
There is no need to change that, whether it is a prefix path or not is already checked out in antlr4.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-iotdb] Genius-pig commented on a change in pull request
#697: Move All metadata query parser from Client into Server.
Posted by GitBox <gi...@apache.org>.
Genius-pig commented on a change in pull request #697: Move All metadata query parser from Client into Server.
URL: https://github.com/apache/incubator-iotdb/pull/697#discussion_r362381921
##########
File path: server/src/test/java/org/apache/iotdb/db/integration/IoTDBMetadataFetchIT.java
##########
@@ -180,11 +176,11 @@ public void databaseMetaDataTest() throws ClassNotFoundException, SQLException {
.getConnection(Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", "root", "root");
databaseMetaData = connection.getMetaData();
- allColumns();
- device();
- showTimeseriesPath1();
- showTimeseriesPath2();
- showStorageGroup();
+// allColumns();
+// device();
+// showTimeseriesPath1();
+// showTimeseriesPath2();
+// showStorageGroup();
Review comment:
fixed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services