[ 
https://issues.apache.org/jira/browse/HIVE-28835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Qiheng He updated HIVE-28835:
-----------------------------
    Summary: HiveServer2 JDBC Driver's *initFile* parameter does not recognize 
the path on Windows 11  (was: HiveServer2 JDBC Driver's `initFile` parameter 
does not recognize the path on Windows 11)

> HiveServer2 JDBC Driver's *initFile* parameter does not recognize the path on 
> Windows 11
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-28835
>                 URL: https://issues.apache.org/jira/browse/HIVE-28835
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Qiheng He
>            Priority: Major
>
> - HiveServer2 JDBC Driver's *initFile* parameter does not recognize the path 
> on {*}Windows 11{*}. Of course, the *initFile* parameter still works for 
> {*}Ubuntu 22.04{*}.
>  - I created a minimal reproducible unit test at 
> [https://github.com/linghengqian/hive-init-file-windows-test] . Use a string 
> like 
> *jdbc:hive2://localhost:32783/demo_ds_0;initFile=D:\TwinklingLiftWorks\git\public\hive-init-file-windows-test\src\test\resources\test.sql*
>  to test.
>  - Execute the following command on the *Windows 11* instance with 
> {*}PowerShell/PowerShell{*},
> {*}version-fox/vfox{*}, *git-for-windows/git* and 
> *rancher-sandbox/rancher-desktop* installed.
> {code:java}
> vfox add java
> vfox install [email protected]
> vfox use --global [email protected]
> git clone [email protected]:linghengqian/hive-init-file-windows-test.git
> cd ./hive-init-file-windows-test/
> ./mvnw clean test -T 1C
> {code}
>  - The log is as follows,
> {code:java}
> [INFO] --- surefire:3.2.5:test (default-test) @ hive-init-file-windows-test 
> ---
> [INFO] Using auto detected provider 
> org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
> [INFO] 
> [INFO] -------------------------------------------------------
> [INFO]  T E S T S
> [INFO] -------------------------------------------------------
> [INFO] Running io.github.linghengqian.SimpleTest
> SLF4J: No SLF4J providers were found.
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
> [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 19.36 
> s <<< FAILURE! -- in io.github.linghengqian.SimpleTest
> [ERROR] io.github.linghengqian.SimpleTest.test -- Time elapsed: 19.28 s <<< 
> FAILURE!
> org.opentest4j.AssertionFailedError: Unexpected exception thrown: 
> com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to 
> initialize pool: Illegal character in path at index 45: 
> hive2://dummyhost:00000/demo_ds_0;initFile=D:\TwinklingLiftWorks\git\public\hive-init-file-windows-test\src\test\resources\test.sql
>     
>         at 
> org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
>         at 
> org.junit.jupiter.api.AssertDoesNotThrow.createAssertionFailedError(AssertDoesNotThrow.java:84)
>         at 
> org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:53)
>         at 
> org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:36)
>         at 
> org.junit.jupiter.api.Assertions.assertDoesNotThrow(Assertions.java:3199)
>         at io.github.linghengqian.SimpleTest.test(SimpleTest.java:49)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>         at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
>         at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)
> Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: 
> Failed to initialize pool: Illegal character in path at index 45: 
> hive2://dummyhost:00000/demo_ds_0;initFile=D:\TwinklingLiftWorks\git\public\hive-init-file-windows-test\src\test\resources\test.sql
>         at 
> com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596)
>         at 
> com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582)
>         at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
>         at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
>         at io.github.linghengqian.SimpleTest.lambda$test$1(SimpleTest.java:50)
>         at 
> org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:49)
>         ... 6 more
> Caused by: java.lang.IllegalArgumentException: Illegal character in path at 
> index 45: 
> hive2://dummyhost:00000/demo_ds_0;initFile=D:\TwinklingLiftWorks\git\public\hive-init-file-windows-test\src\test\resources\test.sql
>         at java.base/java.net.URI.create(URI.java:932)
>         at org.apache.hive.jdbc.Utils.extractURLComponents(Utils.java:491)
>         at org.apache.hive.jdbc.Utils.parseURL(Utils.java:445)
>         at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:296)
>         at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:284)
>         at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:94)
>         at 
> com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
>         at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
>         at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
>         at 
> com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
>         at 
> com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
>         ... 10 more
> Caused by: java.net.URISyntaxException: Illegal character in path at index 
> 45: 
> hive2://dummyhost:00000/demo_ds_0;initFile=D:\TwinklingLiftWorks\git\public\hive-init-file-windows-test\src\test\resources\test.sql
>         at java.base/java.net.URI$Parser.fail(URI.java:2995)
>         at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
>         at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
>         at java.base/java.net.URI$Parser.parse(URI.java:3196)
>         at java.base/java.net.URI.<init>(URI.java:645)
>         at java.base/java.net.URI.create(URI.java:930)
>         ... 20 more
> [INFO] 
> [INFO] Results:
> [INFO]
> [ERROR] Failures: 
> [ERROR]   SimpleTest.test:49 Unexpected exception thrown: 
> com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to 
> initialize pool: Illegal character in path at index 45: 
> hive2://dummyhost:00000/demo_ds_0;initFile=D:\TwinklingLiftWorks\git\public\hive-init-file-windows-test\src\test\resources\test.sql
> [INFO]
> [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
> [INFO] {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to