forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
š Source Snowflake: Fixed parsing of extreme values for FLOAT and NUMā¦
ā¦BER data types (airbytehq#7257) * Fixed parsing of extreme values for FLOAT and NUMBER data types
- Loading branch information
Showing
10 changed files
with
65 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...ake/src/main/java/io.airbyte.integrations.source.snowflake/SnowflakeSourceOperations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
*/ | ||
|
||
package io.airbyte.integrations.source.snowflake; | ||
|
||
import com.fasterxml.jackson.databind.node.ObjectNode; | ||
import io.airbyte.db.jdbc.JdbcSourceOperations; | ||
import java.math.BigDecimal; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
public class SnowflakeSourceOperations extends JdbcSourceOperations { | ||
|
||
@Override | ||
protected void putDouble(final ObjectNode node, final String columnName, final ResultSet resultSet, final int index) { | ||
try { | ||
final double value = resultSet.getDouble(index); | ||
node.put(columnName, value); | ||
} catch (final SQLException e) { | ||
node.put(columnName, (Double) null); | ||
} | ||
} | ||
|
||
@Override | ||
protected void putBigInt(final ObjectNode node, final String columnName, final ResultSet resultSet, int index) { | ||
try { | ||
final var value = resultSet.getBigDecimal(index); | ||
node.put(columnName, value); | ||
} catch (final SQLException e) { | ||
node.put(columnName, (BigDecimal) null); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters