Skip to content

Commit 9aaaa10

Browse files
SNOW-1524152: Rename option for implicit server side query timeout (#2040)
1 parent f2ec619 commit 9aaaa10

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/main/java/net/snowflake/client/core/SFBaseSession.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public abstract class SFBaseSession {
146146

147147
private boolean isJdbcArrowTreatDecimalAsInt = true;
148148

149-
private boolean supportImplicitAsyncQueryTimeout = false;
149+
private boolean implicitServerSideQueryTimeout = false;
150150

151151
private boolean clearBatchOnlyAfterSuccessfulExecution = false;
152152

@@ -1337,12 +1337,12 @@ public boolean getEnableReturnTimestampWithTimeZone() {
13371337
return enableReturnTimestampWithTimeZone;
13381338
}
13391339

1340-
boolean getSupportImplicitAsyncQueryTimeout() {
1341-
return supportImplicitAsyncQueryTimeout;
1340+
boolean getImplicitServerSideQueryTimeout() {
1341+
return implicitServerSideQueryTimeout;
13421342
}
13431343

1344-
void setSupportImplicitAsyncQueryTimeout(boolean supportImplicitAsyncQueryTimeout) {
1345-
this.supportImplicitAsyncQueryTimeout = supportImplicitAsyncQueryTimeout;
1344+
void setImplicitServerSideQueryTimeout(boolean value) {
1345+
this.implicitServerSideQueryTimeout = value;
13461346
}
13471347

13481348
void setClearBatchOnlyAfterSuccessfulExecution(boolean value) {

src/main/java/net/snowflake/client/core/SFBaseStatement.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void addProperty(String propertyName, Object propertyValue) throws SFExce
4242
if ("query_timeout".equalsIgnoreCase(propertyName)) {
4343
// Client side implementation
4444
queryTimeout = (Integer) propertyValue;
45-
if (this.getSFBaseSession().getSupportImplicitAsyncQueryTimeout()) {
45+
if (this.getSFBaseSession().getImplicitServerSideQueryTimeout()) {
4646
// Set server parameter for supporting query timeout on async queries
4747
statementParametersMap.put("STATEMENT_TIMEOUT_IN_SECONDS", (Integer) propertyValue);
4848
}

src/main/java/net/snowflake/client/core/SFSession.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,9 @@ public void addSFSessionProperty(String propertyName, Object propertyValue) thro
551551
}
552552
break;
553553

554-
case SUPPORT_IMPLICIT_ASYNC_QUERY_TIMEOUT:
554+
case IMPLICIT_SERVER_SIDE_QUERY_TIMEOUT:
555555
if (propertyValue != null) {
556-
setSupportImplicitAsyncQueryTimeout(getBooleanValue(propertyValue));
556+
setImplicitServerSideQueryTimeout(getBooleanValue(propertyValue));
557557
}
558558
break;
559559

src/main/java/net/snowflake/client/core/SFSessionProperty.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ public enum SFSessionProperty {
125125
JAVA_LOGGING_CONSOLE_STD_OUT_THRESHOLD(
126126
"JAVA_LOGGING_CONSOLE_STD_OUT_THRESHOLD", false, String.class),
127127

128-
SUPPORT_IMPLICIT_ASYNC_QUERY_TIMEOUT(
129-
"SUPPORT_IMPLICIT_ASYNC_QUERY_TIMEOUT", false, Boolean.class),
128+
IMPLICIT_SERVER_SIDE_QUERY_TIMEOUT("IMPLICIT_SERVER_SIDE_QUERY_TIMEOUT", false, Boolean.class),
130129

131130
CLEAR_BATCH_ONLY_AFTER_SUCCESSFUL_EXECUTION(
132131
"CLEAR_BATCH_ONLY_AFTER_SUCCESSFUL_EXECUTION", false, Boolean.class);

src/test/java/net/snowflake/client/jdbc/StatementLatestIT.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public void testQueryIdIsSetOnFailedExecuteQuery() throws SQLException {
310310
@Test
311311
public void testSetQueryTimeoutForAsyncQueryUsingConnectionProperty() throws SQLException {
312312
Properties p = new Properties();
313-
p.put("SUPPORT_IMPLICIT_ASYNC_QUERY_TIMEOUT", true);
313+
p.put("IMPLICIT_SERVER_SIDE_QUERY_TIMEOUT", true);
314314
try (Connection con = getConnection(p);
315315
Statement statement = con.createStatement()) {
316316
statement.setQueryTimeout(3);
@@ -334,15 +334,15 @@ public void testSetQueryTimeoutForAsyncQueryUsingConnectionProperty() throws SQL
334334
}
335335

336336
/**
337-
* Test for setting query timeout on regular queries with the SUPPORT_IMPLICIT_ASYNC_QUERY_TIMEOUT
337+
* Test for setting query timeout on regular queries with the IMPLICIT_SERVER_SIDE_QUERY_TIMEOUT
338338
* property set to true. Applicable to versions after 3.21.0.
339339
*
340340
* @throws SQLException if there is an error when executing
341341
*/
342342
@Test
343343
public void testSetQueryTimeoutWhenAsyncConnectionPropertySet() throws SQLException {
344344
Properties p = new Properties();
345-
p.put("SUPPORT_IMPLICIT_ASYNC_QUERY_TIMEOUT", true);
345+
p.put("IMPLICIT_SERVER_SIDE_QUERY_TIMEOUT", true);
346346
try (Connection con = getConnection(p);
347347
Statement statement = con.createStatement()) {
348348
statement.setQueryTimeout(3);

0 commit comments

Comments
 (0)