Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-957349: Make some API/classes needed in stored procs public #1570

Merged
merged 5 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() {
sfc-gh-smirzaei marked this conversation as resolved.
Show resolved Hide resolved
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
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