You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ch...@apache.org on 2022/04/09 12:32:05 UTC
[iotdb] branch master updated: Modify the jdbc query time column to be empty (#5281)
This is an automated email from the ASF dual-hosted git repository.
chaow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 43a8febae5 Modify the jdbc query time column to be empty (#5281)
43a8febae5 is described below
commit 43a8febae52c13c4b95d5ff48d98436e9f2fb909
Author: 任宇华 <79...@users.noreply.github.com>
AuthorDate: Sat Apr 9 20:31:58 2022 +0800
Modify the jdbc query time column to be empty (#5281)
Co-authored-by: renyuhua <ry...@163.com>
---
.../aggregation/IoTDBAggregationIT.java | 28 ++++++++++++++++++++++
.../java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java | 1 +
2 files changed, 29 insertions(+)
diff --git a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java
index 810cb997f6..f3bd89cd8b 100644
--- a/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java
+++ b/integration/src/test/java/org/apache/iotdb/db/integration/aggregation/IoTDBAggregationIT.java
@@ -33,8 +33,10 @@ import org.junit.experimental.categories.Category;
import java.sql.Connection;
import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
+import java.sql.Types;
import java.util.Locale;
import static org.apache.iotdb.db.constant.TestConstant.avg;
@@ -1028,4 +1030,30 @@ public class IoTDBAggregationIT {
e.printStackTrace();
}
}
+
+ @Test
+ public void timeWasNullTest() throws Exception {
+ try (Connection connection = EnvFactory.getEnv().getConnection();
+ Statement statement = connection.createStatement()) {
+ boolean hasResultSet =
+ statement.execute(
+ "select max_value(temperature),count(status) from root.ln.wf01.wt01 group by ([0, 600), 100ms);");
+ Assert.assertTrue(hasResultSet);
+ ResultSet resultSet = statement.getResultSet();
+ ResultSetMetaData metaData = resultSet.getMetaData();
+ int columnCount = metaData.getColumnCount();
+ while (resultSet.next()) {
+ for (int i = 1; i <= columnCount; i++) {
+ int ct = metaData.getColumnType(i);
+ if (ct == Types.TIMESTAMP) {
+ if (resultSet.wasNull()) {
+ Assert.assertTrue(false);
+ } else {
+ Assert.assertTrue(true);
+ }
+ }
+ }
+ }
+ }
+ }
}
diff --git a/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java b/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
index fe2ab91465..a2bd14d6fd 100644
--- a/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
+++ b/service-rpc/src/main/java/org/apache/iotdb/rpc/IoTDBRpcDataSet.java
@@ -200,6 +200,7 @@ public class IoTDBRpcDataSet {
public boolean next() throws StatementExecutionException, IoTDBConnectionException {
if (hasCachedResults()) {
+ lastReadWasNull = false;
constructOneRow();
return true;
}