[
https://issues.apache.org/jira/browse/PHOENIX-5397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Artem Ervits updated PHOENIX-5397:
----------------------------------
Description:
Today, it is possible to pass sql commands to sqlline via a file, it would be a
welcome addition to pass commands not wrapped in a file in addition to sqlfile.
{code:java}
/opt/phoenix/bin/sqlline.py localhost sqlfile
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
Setting property: [run, sqlfile]
issuing: !connect jdbc:phoenix:localhost none none
org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:localhost
19/07/18 14:41:24 WARN util.NativeCodeLoader: Unable to load native-hadoop
library for your platform... using builtin-java classes where applicable
Connected to: Phoenix (version 4.14)
Driver: PhoenixEmbeddedDriver (version 4.14)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true
to skip)...
134/134 (100%) Done
Done
1/1 !quit
Closing: org.apache.phoenix.jdbc.PhoenixConnection
sqlline version 1.2.0
/opt/phoenix/bin/sqlline-thin.py localhost sqlfile
Failed to find hbase executable on PATH, defaulting serialization to PROTOBUF.
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
Setting property: [run, sqlfile]
issuing: !connect
jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none
org.apache.phoenix.queryserver.client.Driver
Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF
Connected to: Apache Phoenix (version unknown version)
Driver: Phoenix Remote JDBC Driver (version unknown version)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true
to skip)...
134/134 (100%) Done
Done
1/1 !quit
Closing:
org.apache.phoenix.shaded.org.apache.calcite.avatica.AvaticaJdbc41Factory$AvaticaJdbc41Connection
sqlline version 1.2.0{code}
additionally, behavior between the two drivers is different
{code:java}
/opt/phoenix/bin/sqlline-thin.py localhost '!quit'
Failed to find hbase executable on PATH, defaulting serialization to PROTOBUF.
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
Setting property: [run, !quit]
issuing: !connect
jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none
org.apache.phoenix.queryserver.client.Driver
Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF
Connected to: Apache Phoenix (version unknown version)
Driver: Phoenix Remote JDBC Driver (version unknown version)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true
to skip)...
134/134 (100%) Done
Done
java.io.FileNotFoundException: !quit (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at java.io.FileReader.<init>(FileReader.java:58)
at sqlline.Commands.run(Commands.java:1235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
at sqlline.SqlLine.dispatch(SqlLine.java:809)
at sqlline.SqlLine.initArgs(SqlLine.java:613)
at sqlline.SqlLine.begin(SqlLine.java:661)
at sqlline.SqlLine.start(SqlLine.java:398)
at sqlline.SqlLine.main(SqlLine.java:291)
at
org.apache.phoenix.queryserver.client.SqllineWrapper.main(SqllineWrapper.java:93)
Closing:
org.apache.phoenix.shaded.org.apache.calcite.avatica.AvaticaJdbc41Factory$AvaticaJdbc41Connection
/opt/phoenix/bin/sqlline.py localhost '!quit'
usage: sqlline.py [-h] [-v VERBOSE] [-c COLOR] [-fc FASTCONNECT]
[zookeepers] [sqlfile]
Launches the Apache Phoenix Client.
positional arguments:
zookeepers The ZooKeeper quorum string
sqlfile A file of SQL commands to execute
optional arguments:
-h, --help show this help message and exit
-v VERBOSE, --verbose VERBOSE
Verbosity on sqlline.
-c COLOR, --color COLOR
Color setting for sqlline.
-fc FASTCONNECT, --fastconnect FASTCONNECT
Fetch all schemas on initial connection{code}
it would be a welcome addition to consolidate behavior between both clients
was:
Today, it is possible to pass sql commands to sqlline via a file, it would be a
welcome addition to pass commands not wrapped in a file in addition to sqlfile.
{code:java}
/opt/phoenix/bin/sqlline.py localhost sqlfile
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
Setting property: [run, sqlfile]
issuing: !connect jdbc:phoenix:localhost none none
org.apache.phoenix.jdbc.PhoenixDriver
Connecting to jdbc:phoenix:localhost
19/07/18 14:41:24 WARN util.NativeCodeLoader: Unable to load native-hadoop
library for your platform... using builtin-java classes where applicable
Connected to: Phoenix (version 4.14)
Driver: PhoenixEmbeddedDriver (version 4.14)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true
to skip)...
134/134 (100%) Done
Done
1/1 !quit
Closing: org.apache.phoenix.jdbc.PhoenixConnection
sqlline version 1.2.0
/opt/phoenix/bin/sqlline-thin.py localhost sqlfile
Failed to find hbase executable on PATH, defaulting serialization to PROTOBUF.
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
Setting property: [run, sqlfile]
issuing: !connect
jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none
org.apache.phoenix.queryserver.client.Driver
Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF
Connected to: Apache Phoenix (version unknown version)
Driver: Phoenix Remote JDBC Driver (version unknown version)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
Building list of tables and columns for tab-completion (set fastconnect to true
to skip)...
134/134 (100%) Done
Done
1/1 !quit
Closing:
org.apache.phoenix.shaded.org.apache.calcite.avatica.AvaticaJdbc41Factory$AvaticaJdbc41Connection
sqlline version 1.2.0{code}
> Extend sqlline and sqlline-thin to accept standard sql in addition to sqlfile
> ------------------------------------------------------------------------------
>
> Key: PHOENIX-5397
> URL: https://issues.apache.org/jira/browse/PHOENIX-5397
> Project: Phoenix
> Issue Type: Improvement
> Affects Versions: 4.14.2
> Reporter: Artem Ervits
> Priority: Minor
>
> Today, it is possible to pass sql commands to sqlline via a file, it would be
> a welcome addition to pass commands not wrapped in a file in addition to
> sqlfile.
> {code:java}
> /opt/phoenix/bin/sqlline.py localhost sqlfile
> Setting property: [incremental, false]
> Setting property: [isolation, TRANSACTION_READ_COMMITTED]
> Setting property: [run, sqlfile]
> issuing: !connect jdbc:phoenix:localhost none none
> org.apache.phoenix.jdbc.PhoenixDriver
> Connecting to jdbc:phoenix:localhost
> 19/07/18 14:41:24 WARN util.NativeCodeLoader: Unable to load native-hadoop
> library for your platform... using builtin-java classes where applicable
> Connected to: Phoenix (version 4.14)
> Driver: PhoenixEmbeddedDriver (version 4.14)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to
> true to skip)...
> 134/134 (100%) Done
> Done
> 1/1 !quit
> Closing: org.apache.phoenix.jdbc.PhoenixConnection
> sqlline version 1.2.0
> /opt/phoenix/bin/sqlline-thin.py localhost sqlfile
> Failed to find hbase executable on PATH, defaulting serialization to PROTOBUF.
> Setting property: [incremental, false]
> Setting property: [isolation, TRANSACTION_READ_COMMITTED]
> Setting property: [run, sqlfile]
> issuing: !connect
> jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none
> org.apache.phoenix.queryserver.client.Driver
> Connecting to
> jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF
> Connected to: Apache Phoenix (version unknown version)
> Driver: Phoenix Remote JDBC Driver (version unknown version)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to
> true to skip)...
> 134/134 (100%) Done
> Done
> 1/1 !quit
> Closing:
> org.apache.phoenix.shaded.org.apache.calcite.avatica.AvaticaJdbc41Factory$AvaticaJdbc41Connection
> sqlline version 1.2.0{code}
> additionally, behavior between the two drivers is different
> {code:java}
> /opt/phoenix/bin/sqlline-thin.py localhost '!quit'
> Failed to find hbase executable on PATH, defaulting serialization to PROTOBUF.
> Setting property: [incremental, false]
> Setting property: [isolation, TRANSACTION_READ_COMMITTED]
> Setting property: [run, !quit]
> issuing: !connect
> jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF none none
> org.apache.phoenix.queryserver.client.Driver
> Connecting to
> jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF
> Connected to: Apache Phoenix (version unknown version)
> Driver: Phoenix Remote JDBC Driver (version unknown version)
> Autocommit status: true
> Transaction isolation: TRANSACTION_READ_COMMITTED
> Building list of tables and columns for tab-completion (set fastconnect to
> true to skip)...
> 134/134 (100%) Done
> Done
> java.io.FileNotFoundException: !quit (No such file or directory)
> at java.io.FileInputStream.open0(Native Method)
> at java.io.FileInputStream.open(FileInputStream.java:195)
> at java.io.FileInputStream.<init>(FileInputStream.java:138)
> at java.io.FileInputStream.<init>(FileInputStream.java:93)
> at java.io.FileReader.<init>(FileReader.java:58)
> at sqlline.Commands.run(Commands.java:1235)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
> at sqlline.SqlLine.dispatch(SqlLine.java:809)
> at sqlline.SqlLine.initArgs(SqlLine.java:613)
> at sqlline.SqlLine.begin(SqlLine.java:661)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:291)
> at
> org.apache.phoenix.queryserver.client.SqllineWrapper.main(SqllineWrapper.java:93)
> Closing:
> org.apache.phoenix.shaded.org.apache.calcite.avatica.AvaticaJdbc41Factory$AvaticaJdbc41Connection
> /opt/phoenix/bin/sqlline.py localhost '!quit'
> usage: sqlline.py [-h] [-v VERBOSE] [-c COLOR] [-fc FASTCONNECT]
> [zookeepers] [sqlfile]
> Launches the Apache Phoenix Client.
> positional arguments:
> zookeepers The ZooKeeper quorum string
> sqlfile A file of SQL commands to execute
> optional arguments:
> -h, --help show this help message and exit
> -v VERBOSE, --verbose VERBOSE
> Verbosity on sqlline.
> -c COLOR, --color COLOR
> Color setting for sqlline.
> -fc FASTCONNECT, --fastconnect FASTCONNECT
> Fetch all schemas on initial connection{code}
> it would be a welcome addition to consolidate behavior between both clients
>
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)