Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-26336: Add a connectTimeout parameter for JDBC #5683

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

YuxiangZhuang
Copy link

What changes were proposed in this pull request?

Add a connectTimeout parameter for JDBC

Why are the changes needed?

Currently, the Hive JDBC driver lacks a dedicated parameter to set the connectTimeout for connection establishment. The driver implicitly uses the socketTimeout value for both the connect phase and subsequent socket operations. This creates ambiguity and limits users' ability to handle connection establishment failures gracefully.

Does this PR introduce any user-facing change?

Yes. New JDBC parameter connectTimeout is introduced.

Is the change a dependency upgrade?

No

How was this patch tested?

This patch was tested by validate the parsing of JDBC connection parameters in org.apache.hive.jdbc.TestHiveConnection#testHiveConnectionParameters

@YuxiangZhuang
Copy link
Author

YuxiangZhuang commented Mar 10, 2025

Could someone kindly assist me in applying for the workflow approval? I am new to contributing to Hive and this is my first time submitting a PR.
@ayushtkn @zhangbutao

@zhangbutao
Copy link
Contributor

https://ci.hive.apache.org/blue/organizations/jenkins/hive-precommit/detail/PR-5683/1/pipeline
@YuxiangZhuang Please check the CI log & fix the build error:

unit/src/test/java/org/apache/hadoop/hive/ql/parse/WarehouseInstance.java: Recompile with -Xlint:unchecked for details.

[2025-03-07T03:13:58.874Z] [INFO] -------------------------------------------------------------

[2025-03-07T03:13:58.874Z] [ERROR] COMPILATION ERROR : 

[2025-03-07T03:13:58.874Z] [INFO] -------------------------------------------------------------

[2025-03-07T03:13:58.874Z] [ERROR] /home/jenkins/agent/workspace/hive-precommit_PR-5683/itests/hive-unit/src/test/java/org/apache/hive/service/cli/thrift/TestThriftCliServiceWithInfoMessage.java:[98,41] method getSocketTransport in class org.apache.hadoop.hive.common.auth.HiveAuthUtils cannot be applied to given types;

[2025-03-07T03:13:58.874Z]   required: java.lang.String,int,int,int,int

[2025-03-07T03:13:58.874Z]   found: java.lang.String,int,int

[2025-03-07T03:13:58.874Z]   reason: actual and formal argument lists differ in length

[2025-03-07T03:13:58.874Z] [ERROR] /home/jenkins/agent/workspace/hive-precommit_PR-5683/itests/hive-unit/src/test/java/org/apache/hive/service/cli/thrift/TestThriftHttpCLIServiceFeatures.java:[220,25] method getSocketTransport in class org.apache.hadoop.hive.common.auth.HiveAuthUtils cannot be applied to given types;

[2025-03-07T03:13:58.875Z]   required: java.lang.String,int,int,int,int

[2025-03-07T03:13:58.875Z]   found: java.lang.String,int,int

[2025-03-07T03:13:58.875Z]   reason: actual and formal argument lists differ in length

[2025-03-07T03:13:58.875Z] [INFO] 2 errors 

[2025-03-07T03:13:58.875Z] [INFO] -------------------------------------------------------------

[2025-03-07T03:13:58.875Z] [INFO] ------------------------------------------------------------------------

[2025-03-07T03:13:58.875Z] [INFO] Reactor Summary for Hive 4.1.0-SNAPSHOT:

[2025-03-07T03:13:58.875Z] [INFO] 

[2025-03-07T03:13:58.875Z] [INFO] Hive Storage API ................................... SUCCESS [ 13.201 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive ............................................... SUCCESS [  7.825 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Classifications ............................... SUCCESS [  0.460 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Shims Common .................................. SUCCESS [  5.947 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Shims 0.23 .................................... SUCCESS [ 11.139 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Shims ......................................... SUCCESS [  5.746 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Standalone Metastore .......................... SUCCESS [  3.102 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Standalone Metastore Common Code .............. SUCCESS [ 33.571 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Common ........................................ SUCCESS [ 15.184 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Service RPC ................................... SUCCESS [  1.200 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Serde ......................................... SUCCESS [ 20.775 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Metastore ..................................... SUCCESS [ 10.855 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Vector-Code-Gen Utilities ..................... SUCCESS [  1.408 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Parser ........................................ SUCCESS [ 21.130 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive UDF ........................................... SUCCESS [ 10.263 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Llap Common ................................... SUCCESS [ 12.828 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Llap Client ................................... SUCCESS [ 12.258 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Llap Tez ...................................... SUCCESS [ 13.912 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Metastore Server .............................. SUCCESS [ 41.048 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Query Language ................................ SUCCESS [02:19 min]

[2025-03-07T03:13:58.875Z] [INFO] Hive TestUtils ..................................... SUCCESS [  0.504 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Llap Server ................................... SUCCESS [ 35.112 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HPL/SQL ....................................... SUCCESS [ 17.470 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Service ....................................... SUCCESS [ 34.060 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Accumulo Handler .............................. SUCCESS [ 22.597 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive JDBC .......................................... SUCCESS [ 17.273 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Beeline ....................................... SUCCESS [ 36.668 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive CLI ........................................... SUCCESS [ 20.240 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Contrib ....................................... SUCCESS [ 16.081 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Druid Handler ................................. SUCCESS [02:43 min]

[2025-03-07T03:13:58.875Z] [INFO] Hive HBase Handler ................................. SUCCESS [ 27.072 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive JDBC Handler .................................. SUCCESS [ 16.717 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HCatalog ...................................... SUCCESS [  9.867 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HCatalog Core ................................. SUCCESS [ 25.322 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HCatalog Pig Adapter .......................... SUCCESS [ 21.708 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HCatalog Server Extensions .................... SUCCESS [ 22.129 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HCatalog Webhcat Java Client .................. SUCCESS [ 26.529 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive HCatalog Webhcat .............................. SUCCESS [ 23.813 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Streaming ..................................... SUCCESS [ 19.551 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Llap External Client .......................... SUCCESS [ 15.395 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Shims Aggregator .............................. SUCCESS [  0.162 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Kudu Handler .................................. SUCCESS [ 22.140 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Iceberg Modules ............................... SUCCESS [  2.223 s]

[2025-03-07T03:13:58.875Z] [INFO] Patched Iceberg API ................................ SUCCESS [  2.719 s]

[2025-03-07T03:13:58.875Z] [INFO] Patched Iceberg Core ............................... SUCCESS [ 14.130 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Iceberg Shading ............................... SUCCESS [  7.939 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Iceberg Catalog ............................... SUCCESS [ 35.279 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Iceberg Handler ............................... SUCCESS [01:02 min]

[2025-03-07T03:13:58.875Z] [INFO] Hive Kafka Storage Handler ......................... SUCCESS [ 27.174 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Packaging ..................................... SUCCESS [01:44 min]

[2025-03-07T03:13:58.875Z] [INFO] Hive Metastore Tools ............................... SUCCESS [  0.176 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Metastore Tools common libraries .............. SUCCESS [ 25.630 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive metastore benchmarks .......................... SUCCESS [ 23.886 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Parent .......................... SUCCESS [  0.304 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Custom Serde .................... SUCCESS [ 15.290 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Custom udfs ..................... SUCCESS [  0.216 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Custom UDFs - udf-classloader-util SUCCESS [  0.280 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Custom UDFs - udf-classloader-udf1 SUCCESS [ 14.036 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Custom UDFs - udf-classloader-udf2 SUCCESS [ 14.811 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Custom UDFs - udf-vectorized-badexample SUCCESS [ 13.814 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - HCatalog Unit Tests ............. SUCCESS [ 25.989 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - QFile Druid Tests ............... SUCCESS [ 49.053 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Testing Utilities ............... SUCCESS [ 47.589 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Unit Tests ...................... FAILURE [ 15.947 s]

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Blobstore Tests ................. SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Test Serde ...................... SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - QFile Tests ..................... SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - QFile Accumulo Tests ............ SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] JMH benchmark: Hive ................................ SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Unit Tests - Hadoop 2 ........... SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - Unit Tests with miniKdc ......... SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - QFile Kudu Tests ................ SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] Hive Integration - QFile Iceberg Tests ............. SKIPPED

[2025-03-07T03:13:58.875Z] [INFO] ------------------------------------------------------------------------

[2025-03-07T03:13:58.875Z] [INFO] BUILD FAILURE

[2025-03-07T03:13:58.875Z] [INFO] ------------------------------------------------------------------------

[2025-03-07T03:13:58.875Z] [INFO] Total time:  24:40 min

[2025-03-07T03:13:58.875Z] [INFO] Finished at: 2025-03-07T03:13:58Z

[2025-03-07T03:13:58.875Z] [INFO] ------------------------------------------------------------------------

[2025-03-07T03:13:58.875Z] [INFO] 1172 goals, 1172 executed

[2025-03-07T03:13:59.133Z] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on project hive-it-unit: Compilation failure: Compilation failure: 

[2025-03-07T03:13:59.133Z] [ERROR] /home/jenkins/agent/workspace/hive-precommit_PR-5683/itests/hive-unit/src/test/java/org/apache/hive/service/cli/thrift/TestThriftCliServiceWithInfoMessage.java:[98,41] method getSocketTransport in class org.apache.hadoop.hive.common.auth.HiveAuthUtils cannot be applied to given types;

[2025-03-07T03:13:59.133Z] [ERROR]   required: java.lang.String,int,int,int,int

[2025-03-07T03:13:59.133Z] [ERROR]   found: java.lang.String,int,int

[2025-03-07T03:13:59.133Z] [ERROR]   reason: actual and formal argument lists differ in length

[2025-03-07T03:13:59.133Z] [ERROR] /home/jenkins/agent/workspace/hive-precommit_PR-5683/itests/hive-unit/src/test/java/org/apache/hive/service/cli/thrift/TestThriftHttpCLIServiceFeatures.java:[220,25] method getSocketTransport in class org.apache.hadoop.hive.common.auth.HiveAuthUtils cannot be applied to given types;

[2025-03-07T03:13:59.133Z] [ERROR]   required: java.lang.String,int,int,int,int

[2025-03-07T03:13:59.133Z] [ERROR]   found: java.lang.String,int,int

[2025-03-07T03:13:59.133Z] [ERROR]   reason: actual and formal argument lists differ in length

[2025-03-07T03:13:59.133Z] [ERROR] -> [Help 1]

[2025-03-07T03:13:59.133Z] [ERROR] 

[2025-03-07T03:13:59.133Z] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[2025-03-07T03:13:59.133Z] [ERROR] Re-run Maven using the -X switch to enable full debug logging.

[2025-03-07T03:13:59.133Z] [ERROR] 

[2025-03-07T03:13:59.133Z] [ERROR] For more information about the errors and possible solutions, please read the following articles:

[2025-03-07T03:13:59.133Z] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[2025-03-07T03:13:59.133Z] [ERROR] 

[2025-03-07T03:13:59.133Z] [ERROR] After correcting the problems, you can resume the build with the command

[2025-03-07T03:13:59.133Z] [ERROR]   mvn <args> -rf :hive-it-unit

script returned exit code 1

@YuxiangZhuang
Copy link
Author

Thank you very much for your guidance. I have fixed the previous buid errors, and all the tests have been successfully run now. May I ask if it is possible to proceed with the merge?
@zhangbutao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants