-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Destination Snowflake - support reserved column names (#30319)
Co-authored-by: cynthiaxyin <[email protected]>
- Loading branch information
1 parent
6b48ecf
commit 839fb26
Showing
18 changed files
with
318 additions
and
38 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
2 changes: 2 additions & 0 deletions
2
...ing-deduping-test/src/main/resources/sqlgenerator/reservedkeywords_inputrecords_raw.jsonl
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,2 @@ | ||
// A column name that is a reserved keyword should be added for each typing & deduping destination. | ||
{"_airbyte_raw_id": "b2e0efc4-38a8-47ba-970c-8103f09f08d5", "_airbyte_extracted_at": "2023-01-01T00:00:00Z", "_airbyte_data": {"current_date": "foo", "join": "bar"}} |
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
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
113 changes: 113 additions & 0 deletions
113
.../src/main/java/io/airbyte/integrations/destination/bigquery/BigQueryReservedKeywords.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,113 @@ | ||
package io.airbyte.integrations.destination.bigquery; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import java.util.List; | ||
|
||
/** | ||
* NOTE: This class is not used, but is created for completeness. | ||
* See https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#reserved_keywords | ||
* Copied from https://github.com/airbytehq/airbyte/blob/f226503bd1d4cd9c7412b04d47de584523988443/airbyte-integrations/bases/base-normalization/normalization/transform_catalog/reserved_keywords.py | ||
*/ | ||
public class BigQueryReservedKeywords { | ||
|
||
public static final List<String> RESERVED_KEYWORDS = ImmutableList.of( | ||
"ALL", | ||
"AND", | ||
"ANY", | ||
"ARRAY", | ||
"AS", | ||
"ASC", | ||
"ASSERT_ROWS_MODIFIED", | ||
"AT", | ||
"BETWEEN", | ||
"BY", | ||
"CASE", | ||
"CAST", | ||
"COLLATE", | ||
"CONTAINS", | ||
"CREATE", | ||
"CROSS", | ||
"CUBE", | ||
"CURRENT", | ||
"CURRENT_DATE", | ||
"CURRENT_TIME", | ||
"CURRENT_TIMESTAMP", | ||
"DEFAULT", | ||
"DEFINE", | ||
"DESC", | ||
"DISTINCT", | ||
"ELSE", | ||
"END", | ||
"ENUM", | ||
"ESCAPE", | ||
"EXCEPT", | ||
"EXCLUDE", | ||
"EXISTS", | ||
"EXTRACT", | ||
"FALSE", | ||
"FETCH", | ||
"FOLLOWING", | ||
"FOR", | ||
"FROM", | ||
"FULL", | ||
"GROUP", | ||
"GROUPING", | ||
"GROUPS", | ||
"HASH", | ||
"HAVING", | ||
"IF", | ||
"IGNORE", | ||
"IN", | ||
"INNER", | ||
"INTERSECT", | ||
"INTERVAL", | ||
"INTO", | ||
"IS", | ||
"JOIN", | ||
"LATERAL", | ||
"LEFT", | ||
"LIKE", | ||
"LIMIT", | ||
"LOOKUP", | ||
"MERGE", | ||
"NATURAL", | ||
"NEW", | ||
"NO", | ||
"NOT", | ||
"NULL", | ||
"NULLS", | ||
"OF", | ||
"ON", | ||
"OR", | ||
"ORDER", | ||
"OUTER", | ||
"OVER", | ||
"PARTITION", | ||
"PRECEDING", | ||
"PROTO", | ||
"RANGE", | ||
"RECURSIVE", | ||
"RESPECT", | ||
"RIGHT", | ||
"ROLLUP", | ||
"ROWS", | ||
"SELECT", | ||
"SET", | ||
"SOME", | ||
"STRUCT", | ||
"TABLESAMPLE", | ||
"THEN", | ||
"TO", | ||
"TREAT", | ||
"TRUE", | ||
"UNBOUNDED", | ||
"UNION", | ||
"UNNEST", | ||
"USING", | ||
"WHEN", | ||
"WHERE", | ||
"WINDOW", | ||
"WITH", | ||
"WITHIN"); | ||
|
||
} |
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
1 change: 1 addition & 0 deletions
1
.../src/test-integration/resources/sqlgenerator/reservedkeywords_expectedrecords_final.jsonl
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 @@ | ||
{"_airbyte_raw_id":"b2e0efc4-38a8-47ba-970c-8103f09f08d5","_airbyte_extracted_at":"2023-01-01T00:00:00Z","_airbyte_meta":{"errors":[]}, "current_date": "foo", "join": "bar"} |
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
Oops, something went wrong.