InvisibleProgrammer commented on code in PR #6412:
URL: https://github.com/apache/hive/pull/6412#discussion_r3150021774
##########
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 don't think if it is an elegant/performant way of getting a config value
from the jdbc connection string:
Creating a HiveConf object just to validate if the setting is a proper time
setting looks a little bit overkill. HiveConf is not a small object at all. But
also, TimeValidator is not a public class in common so I'm not sure if it can
be used here. Maybe making TimeValidator to public can easily solve this issue.
I'm also not sure if we need to handle that case at all. I mean, HIVE-28265
is about improving the timeout message at set expressions. Honestly, I didn't
even know that we support setting hive config values in the jdbc connection
string. But anyway, if it works, it works.
@ayushtkn , can I ping you to receive your opinion again?
--
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]