Skip to content

Commit eab0013

Browse files
🐛 Source snowflake: int columns should be discovered as ints (#15314)
* snowflake discovers ints as ints * version bump+changelog * bump version+changelog * auto-bump connector version [ci skip] Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
1 parent f506c60 commit eab0013

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
- name: Snowflake
914914
sourceDefinitionId: e2d65910-8c8b-40a1-ae7d-ee2416b2bfa2
915915
dockerRepository: airbyte/source-snowflake
916-
dockerImageTag: 0.1.15
916+
dockerImageTag: 0.1.17
917917
documentationUrl: https://docs.airbyte.io/integrations/sources/snowflake
918918
icon: snowflake.svg
919919
sourceType: database

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8914,7 +8914,7 @@
89148914
- - "client_secret"
89158915
oauthFlowOutputParameters:
89168916
- - "refresh_token"
8917-
- dockerImage: "airbyte/source-snowflake:0.1.15"
8917+
- dockerImage: "airbyte/source-snowflake:0.1.17"
89188918
spec:
89198919
documentationUrl: "https://docs.airbyte.io/integrations/sources/snowflake"
89208920
connectionSpecification:

airbyte-integrations/connectors/source-snowflake/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ ENV APPLICATION source-snowflake
1616

1717
COPY --from=build /airbyte /airbyte
1818

19-
LABEL io.airbyte.version=0.1.15
19+
LABEL io.airbyte.version=0.1.17
2020
LABEL io.airbyte.name=airbyte/source-snowflake

airbyte-integrations/connectors/source-snowflake/src/main/java/io.airbyte.integrations.source.snowflake/SnowflakeSourceOperations.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ protected void setTimestamp(final PreparedStatement preparedStatement, final int
4444
public JsonSchemaType getJsonType(JDBCType jdbcType) {
4545
return switch (jdbcType) {
4646
case BIT, BOOLEAN -> JsonSchemaType.BOOLEAN;
47-
case TINYINT, SMALLINT, REAL, FLOAT, DOUBLE, INTEGER, BIGINT, NUMERIC, DECIMAL -> JsonSchemaType.NUMBER;
47+
case REAL, FLOAT, DOUBLE, NUMERIC, DECIMAL -> JsonSchemaType.NUMBER;
48+
case TINYINT, SMALLINT, INTEGER, BIGINT -> JsonSchemaType.INTEGER;
4849
case CHAR, NCHAR, NVARCHAR, VARCHAR, LONGVARCHAR -> JsonSchemaType.STRING;
4950
case DATE -> JsonSchemaType.STRING_DATE;
5051
case TIME -> JsonSchemaType.STRING_TIME_WITHOUT_TIMEZONE;

airbyte-integrations/connectors/source-snowflake/src/test-integration/java/io/airbyte/integrations/io/airbyte/integration_tests/sources/SnowflakeJdbcSourceAcceptanceTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ protected AirbyteCatalog getCatalog(final String defaultNamespace) {
105105
CatalogHelpers.createAirbyteStream(
106106
TABLE_NAME,
107107
defaultNamespace,
108-
Field.of(COL_ID, JsonSchemaType.NUMBER),
108+
Field.of(COL_ID, JsonSchemaType.INTEGER),
109109
Field.of(COL_NAME, JsonSchemaType.STRING),
110110
Field.of(COL_UPDATED_AT, JsonSchemaType.STRING_DATE))
111111
.withSupportedSyncModes(List.of(SyncMode.FULL_REFRESH, SyncMode.INCREMENTAL))
112112
.withSourceDefinedPrimaryKey(List.of(List.of(COL_ID))),
113113
CatalogHelpers.createAirbyteStream(
114-
TABLE_NAME_WITHOUT_PK,
115-
defaultNamespace,
116-
Field.of(COL_ID, JsonSchemaType.NUMBER),
117-
Field.of(COL_NAME, JsonSchemaType.STRING),
118-
Field.of(COL_UPDATED_AT, JsonSchemaType.STRING_DATE))
114+
TABLE_NAME_WITHOUT_PK,
115+
defaultNamespace,
116+
Field.of(COL_ID, JsonSchemaType.INTEGER),
117+
Field.of(COL_NAME, JsonSchemaType.STRING),
118+
Field.of(COL_UPDATED_AT, JsonSchemaType.STRING_DATE))
119119
.withSupportedSyncModes(List.of(SyncMode.FULL_REFRESH, SyncMode.INCREMENTAL))
120120
.withSourceDefinedPrimaryKey(Collections.emptyList()),
121121
CatalogHelpers.createAirbyteStream(

docs/integrations/sources/snowflake.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ To read more please check official [Snowflake documentation](https://docs.snowfl
122122

123123
| Version | Date | Pull Request | Subject |
124124
|:----------| :--- | :--- | :--- |
125+
| 0.1.16 | 2022-08-09 | [15314](https://github.com/airbytehq/airbyte/pull/15314) | Discover integer columns as integers rather than floats |
126+
| 0.1.16 | 2022-08-04 | [15314](https://github.com/airbytehq/airbyte/pull/15314) | (broken, do not use) Discover integer columns as integers rather than floats |
125127
| 0.1.15 | 2022-07-22 | [14828](https://github.com/airbytehq/airbyte/pull/14828) | Source Snowflake: Source/Destination doesn't respect DATE data type |
126128
| 0.1.14 | 2022-07-22 | [14714](https://github.com/airbytehq/airbyte/pull/14714) | Clarified error message when invalid cursor column selected |
127129
| 0.1.13 | 2022-07-14 | [14574](https://github.com/airbytehq/airbyte/pull/14574) | Removed additionalProperties:false from JDBC source connectors |
@@ -135,4 +137,4 @@ To read more please check official [Snowflake documentation](https://docs.snowfl
135137
| 0.1.4 | 2021-12-30 | [9203](https://github.com/airbytehq/airbyte/pull/9203) | Update connector fields title/description |
136138
| 0.1.3 | 2021-01-11 | [9304](https://github.com/airbytehq/airbyte/pull/9304) | Upgrade version of JDBC driver |
137139
| 0.1.2 | 2021-10-21 | [7257](https://github.com/airbytehq/airbyte/pull/7257) | Fixed parsing of extreme values for FLOAT and NUMBER data types |
138-
| 0.1.1 | 2021-08-13 | [4699](https://github.com/airbytehq/airbyte/pull/4699) | Added json config validator |
140+
| 0.1.1 | 2021-08-13 | [4699](https://github.com/airbytehq/airbyte/pull/4699) | Added json config validator |

0 commit comments

Comments
 (0)