Skip to content

Commit

Permalink
SNOW-957349: Make some API/classes needed in stored procs public (#1570)
Browse files Browse the repository at this point in the history
Make some API/classes needed in stored procs public
  • Loading branch information
sfc-gh-smirzaei committed Dec 1, 2023
1 parent dcb74ed commit dacea07
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/main/java/net/snowflake/client/core/SFChildResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions src/main/java/net/snowflake/client/core/SFStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -661,7 +661,7 @@ public String[] getChildQueryIds(String queryID) throws SQLException {
List<SFChildResult> childResults = ResultUtil.getChildResults(session, requestId, jsonResult);
List<String> 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);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/snowflake/client/jdbc/SFAsyncResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dacea07

Please sign in to comment.