This is an automated email from the ASF dual-hosted git repository.

zabetak pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new 0b0e75323b [CALCITE-7626] Pass user-specified JAVA_OPTS to 
sqlline/sqlsh
0b0e75323b is described below

commit 0b0e75323b0ef92668023541330175256f09b1ec
Author: Stamatis Zampetakis <[email protected]>
AuthorDate: Fri Jun 26 13:51:19 2026 +0200

    [CALCITE-7626] Pass user-specified JAVA_OPTS to sqlline/sqlsh
---
 sqlline     | 2 +-
 sqlline.bat | 4 +++-
 sqlsh       | 2 +-
 sqlsh.bat   | 9 +++++----
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/sqlline b/sqlline
index 2da73e43c1..edb4be5486 100755
--- a/sqlline
+++ b/sqlline
@@ -49,6 +49,6 @@ if [ "$cygwin" ]; then
   VM_OPTS=-Djline.terminal=jline.UnixTerminal
 fi
 
-export 
JAVA_OPTS=-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
+JAVA_OPTS="-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 ${JAVA_OPTS}"
 
 exec java -Xmx1g $VM_OPTS $JAVA_OPTS -jar 
"$root/build/libs/sqllineClasspath.jar" "$@"
diff --git a/sqlline.bat b/sqlline.bat
index d98fbd62a4..d2fe22b0d3 100644
--- a/sqlline.bat
+++ b/sqlline.bat
@@ -33,4 +33,6 @@ if not defined CACHE_SQLLINE_CLASSPATH (
 )
 if not exist "%CP%" (call "%DIRNAME%\gradlew" --console plain -q 
:buildSqllineClasspath)
 
-java -Xmx1g -jar "%CP%" %*
+set 
JAVA_OPTS=-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 %JAVA_OPTS%
+
+java -Xmx1g %JAVA_OPTS% -jar "%CP%" %*
diff --git a/sqlsh b/sqlsh
index 1904d9dd3b..437060a249 100755
--- a/sqlsh
+++ b/sqlsh
@@ -43,6 +43,6 @@ if [ "x$CACHE_SQLLINE_CLASSPATH" != "xY" ] || [ ! -f "$CP" ]; 
then
 fi
 
 VM_OPTS=
-export 
JAVA_OPTS=-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
+JAVA_OPTS="-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 ${JAVA_OPTS}"
 
 exec java $VM_OPTS -cp "${CP}" $JAVA_OPTS 
org.apache.calcite.adapter.os.SqlShell "$@"
diff --git a/sqlsh.bat b/sqlsh.bat
index 45d7187b0b..2ad45c5439 100644
--- a/sqlsh.bat
+++ b/sqlsh.bat
@@ -16,10 +16,9 @@
 :: limitations under the License.
 ::
 
-:: sqlline.bat - Windows script to launch SQL shell
+:: sqlsh.bat - Windows script to launch SQL shell
 :: Example:
-:: > sqlline.bat
-:: sqlline> !connect jdbc:calcite: admin admin
+:: > sqlsh.bat select * from du order by 1 limit 3
 
 :: The script updates the classpath on each execution,
 :: You might add CACHE_SQLLINE_CLASSPATH environment variable to cache it
@@ -33,4 +32,6 @@ if not defined CACHE_SQLLINE_CLASSPATH (
 )
 if not exist "%CP%" (call "%DIRNAME%\gradlew" --console plain -q 
:buildSqllineClasspath)
 
-java -Xmx1g -cp "%CP%" org.apache.calcite.adapter.os.SqlShell %*
+set 
JAVA_OPTS=-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
 %JAVA_OPTS%
+
+java -Xmx1g -cp "%CP%" %JAVA_OPTS% org.apache.calcite.adapter.os.SqlShell %*

Reply via email to