InvisibleProgrammer commented on code in PR #6412:
URL: https://github.com/apache/hive/pull/6412#discussion_r3182051295
##########
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java:
##########
@@ -190,6 +208,49 @@ public class HiveConnection implements java.sql.Connection
{
public TCLIService.Iface getClient() { return client; }
+ /**
+ * Sets the effective {@code hive.query.timeout.seconds} (in seconds) after
connect (URL) or a
+ * successful {@code SET hive.query.timeout.seconds=...}. Used for JDBC
timeout messages (HIVE-28265).
+ */
+ void setSessionQueryTimeoutSeconds(long seconds) {
+ sessionQueryTimeoutSeconds.set(seconds);
+ }
+
+ /**
+ * If the JDBC URL supplied {@code hive.query.timeout.seconds} (query string
/ {@code hiveconf:} map),
+ * parse and store it for {@link #getSessionQueryTimeoutSeconds()} so
timeout error messages can use it
+ * without regex-parsing {@code SET} statements. Does not change HS2
behavior (already applied in
+ * {@link #openSession()}).
+ */
+ private void applySessionQueryTimeoutFromJdbcUrl() {
Review Comment:
I didn't find significantly better alternative that doesn't lead more
changes: the only other solution I found is to extracting the time handling
logging in commons so that it doesn't only accept a configuration object (like
now `HiveConf.getTimeVar` does) but just simply accepts a String so that we
wouldn't need a full HiveConf object, just to get that information.
But as it runs only once, at the initialization of the connection, I think
it should be fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]