From dacea075ca56ea26b2bc57ec87bab7c05bfe3b64 Mon Sep 17 00:00:00 2001 From: Saber Mirzaei Date: Fri, 1 Dec 2023 11:48:48 -0800 Subject: [PATCH] SNOW-957349: Make some API/classes needed in stored procs public (#1570) Make some API/classes needed in stored procs public --- .../java/net/snowflake/client/core/SFChildResult.java | 10 ++++++---- .../java/net/snowflake/client/core/SFStatement.java | 4 ++-- .../net/snowflake/client/jdbc/SFAsyncResultSet.java | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/snowflake/client/core/SFChildResult.java b/src/main/java/net/snowflake/client/core/SFChildResult.java index bc74440fc..4418e80d1 100644 --- a/src/main/java/net/snowflake/client/core/SFChildResult.java +++ b/src/main/java/net/snowflake/client/core/SFChildResult.java @@ -3,20 +3,22 @@ /** Data class to wrap information about child job results */ public class SFChildResult { // query id of child query, to look up child result - String id; + private final String id; // statement type of child query, to properly interpret result - SFStatementType type; + private final SFStatementType type; public SFChildResult(String id, SFStatementType type) { this.id = id; this.type = type; } - String getId() { + // For Snowflake internal use + public String getId() { return id; } - SFStatementType getType() { + // For Snowflake internal use + public SFStatementType getType() { return type; } } diff --git a/src/main/java/net/snowflake/client/core/SFStatement.java b/src/main/java/net/snowflake/client/core/SFStatement.java index b251d2f25..10f9c9559 100644 --- a/src/main/java/net/snowflake/client/core/SFStatement.java +++ b/src/main/java/net/snowflake/client/core/SFStatement.java @@ -238,7 +238,7 @@ SFBaseResultSet executeQueryInternal( // current result to the first child's result. // we still construct the first result set for its side effects. if (!childResults.isEmpty()) { - SFStatementType type = childResults.get(0).type; + SFStatementType type = childResults.get(0).getType(); // ensure first query type matches the calling JDBC method, if exists if (caller == CallingMethod.EXECUTE_QUERY && !type.isGenerateResultSet()) { @@ -661,7 +661,7 @@ public String[] getChildQueryIds(String queryID) throws SQLException { List childResults = ResultUtil.getChildResults(session, requestId, jsonResult); List resultList = new ArrayList<>(); for (int i = 0; i < childResults.size(); i++) { - resultList.add(childResults.get(i).id); + resultList.add(childResults.get(i).getId()); } if (resultList.isEmpty()) { resultList.add(queryID); diff --git a/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java b/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java index 7fe9ecbbe..77662cbd8 100644 --- a/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java +++ b/src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java @@ -18,8 +18,9 @@ import net.snowflake.client.core.SFSession; import net.snowflake.common.core.SqlState; -/** SFAsyncResultSet implementation */ -class SFAsyncResultSet extends SnowflakeBaseResultSet implements SnowflakeResultSet, ResultSet { +/** SFAsyncResultSet implementation. Note: For Snowflake internal use */ +public class SFAsyncResultSet extends SnowflakeBaseResultSet + implements SnowflakeResultSet, ResultSet { private final SFBaseResultSet sfBaseResultSet; private ResultSet resultSetForNext = new SnowflakeResultSetV1.EmptyResultSet(); private boolean resultSetForNextInitialized = false;