Skip to content

Commit

Permalink
SNOW-974576 Extract type converters for JSON results (#1587)
Browse files Browse the repository at this point in the history
* SNOW-974576 Extract type converters for JSON result
Co-authored-by: Przemyslaw Motacki <[email protected]>
  • Loading branch information
sfc-gh-pfus authored Jan 3, 2024
1 parent 55e5b15 commit 6e6e5cd
Show file tree
Hide file tree
Showing 17 changed files with 1,367 additions and 547 deletions.
19 changes: 19 additions & 0 deletions src/main/java/net/snowflake/client/core/SFFixedViewResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@

import java.sql.SQLException;
import java.util.List;
import net.snowflake.client.core.json.Converters;
import net.snowflake.client.jdbc.*;
import net.snowflake.client.jdbc.SFBaseFileTransferAgent.CommandType;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import net.snowflake.common.core.SFBinaryFormat;
import net.snowflake.common.core.SqlState;

/**
* Fixed view result set. This class iterates through any fixed view implementation and return the
* objects as rows
*/
// Works only for strings, numbers, etc, does not work for timestamps, dates, times etc.
public class SFFixedViewResultSet extends SFJsonResultSet {
private static final SFLogger logger = SFLoggerFactory.getLogger(SFFixedViewResultSet.class);

Expand All @@ -26,6 +29,22 @@ public class SFFixedViewResultSet extends SFJsonResultSet {

public SFFixedViewResultSet(SnowflakeFixedView fixedView, CommandType commandType, String queryID)
throws SnowflakeSQLException {
super(
null,
new Converters(
null,
new SFSession(),
0,
false,
false,
false,
false,
SFBinaryFormat.BASE64,
null,
null,
null,
null,
null));
this.fixedView = fixedView;
this.commandType = commandType;
this.queryID = queryID;
Expand Down
Loading

0 comments on commit 6e6e5cd

Please sign in to comment.