This is an automated email from the ASF dual-hosted git repository. ejttianyu pushed a commit to branch win_e_option in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit 4eaf12c433a268f6d493028a81be24a699eaaca2 Author: EJTTianyu <[email protected]> AuthorDate: Tue May 12 11:16:52 2020 +0800 add win -e option --- cli/src/main/java/org/apache/iotdb/cli/WinCli.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cli/src/main/java/org/apache/iotdb/cli/WinCli.java b/cli/src/main/java/org/apache/iotdb/cli/WinCli.java index 97b6a43..1eb5eea 100644 --- a/cli/src/main/java/org/apache/iotdb/cli/WinCli.java +++ b/cli/src/main/java/org/apache/iotdb/cli/WinCli.java @@ -53,6 +53,7 @@ public class WinCli extends AbstractCli { commandLine = null; String[] newArgs; + String[] newArgs2; if (args == null || args.length == 0) { println("Require more params input, please check the following hint."); @@ -61,10 +62,9 @@ public class WinCli extends AbstractCli { } init(); - newArgs = removePasswordArgs(args); - - boolean continues = parseCommandLine(options, newArgs, hf); + newArgs2 = processExecuteArgs(newArgs); + boolean continues = parseCommandLine(options, newArgs2, hf); if (!continues) { return; } @@ -124,6 +124,18 @@ public class WinCli extends AbstractCli { if (password == null) { password = readPassword(); } + if (hasExecuteSQL) { + try (IoTDBConnection connection = (IoTDBConnection) DriverManager + .getConnection(Config.IOTDB_URL_PREFIX + host + ":" + port + "/", username, password)) { + properties = connection.getServerProperties(); + AGGREGRATE_TIME_LIST.addAll(properties.getSupportedTimeAggregationOperations()); + processCommand(execute, connection); + return; + } catch (SQLException e) { + println(IOTDB_CLI_PREFIX + "> can't execute sql because" + e.getMessage()); + } + } + receiveCommands(scanner); } catch (ArgsErrorException e) { println(IOTDB_CLI_PREFIX + "> input params error because" + e.getMessage());
