This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 9e8fe56 remove check is query in session (#1082)
9e8fe56 is described below
commit 9e8fe564a16570b36f7b2a3771a7011250539d8f
Author: Jialin Qiao <[email protected]>
AuthorDate: Tue Apr 21 20:08:44 2020 +0800
remove check is query in session (#1082)
---
.../main/java/org/apache/iotdb/session/Session.java | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/session/src/main/java/org/apache/iotdb/session/Session.java
b/session/src/main/java/org/apache/iotdb/session/Session.java
index 9c51591..8ea83f6 100644
--- a/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -690,16 +690,6 @@ public class Session {
this.zoneId = ZoneId.of(zoneId);
}
- /**
- * check whether this sql is for query
- *
- * @param sql sql
- * @return whether this sql is for query
- */
- private boolean checkIsQuery(String sql) {
- sql = sql.trim().toLowerCase();
- return sql.startsWith("select") || sql.startsWith("show") ||
sql.startsWith("list");
- }
/**
* execure query sql
@@ -709,10 +699,6 @@ public class Session {
*/
public SessionDataSet executeQueryStatement(String sql)
throws StatementExecutionException, IoTDBConnectionException {
- if (!checkIsQuery(sql)) {
- throw new IllegalArgumentException("your sql \"" + sql
- + "\" is not a query statement, you should use
executeNonQueryStatement method instead.");
- }
TSExecuteStatementReq execReq = new TSExecuteStatementReq(sessionId, sql,
statementId);
execReq.setFetchSize(fetchSize);
@@ -735,11 +721,6 @@ public class Session {
*/
public void executeNonQueryStatement(String sql)
throws IoTDBConnectionException, StatementExecutionException {
- if (checkIsQuery(sql)) {
- throw new IllegalArgumentException("your sql \"" + sql
- + "\" is a query statement, you should use executeQueryStatement
method instead.");
- }
-
TSExecuteStatementReq execReq = new TSExecuteStatementReq(sessionId, sql,
statementId);
try {
TSExecuteStatementResp execResp = client.executeUpdateStatement(execReq);