-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Normalization: Snowflake doesn't identify 2021-04-04T22:54:29+0000 as valid timestamp #5439
Comments
After some investigation, it seems like Snowflake just doesn't accept this format. See this list: https://docs.snowflake.com/en/user-guide/date-time-input-output.html#timestamp-formats -- this format is not listed there. I also tried entering it by hand in the Snowflake UI -- got a failure.
|
ISO8601 possible date & datetime formatsGeneral InformationBased on the official documentation for JSONSchema about Date & Time formats: VALID DATE-TIME formatsTable with
|
Format | Data Type | JsonSchema Type | JsonSchema Format | Example |
---|---|---|---|---|
YYYY-M-D |
string |
string |
date |
"2021-1-1" |
YYYY-M-D hh:mm:ss |
string |
string |
date-time |
"2021-1-1 01:01:01" |
YYYY-M-D hh:mm:ss Z |
string |
string |
date-time |
"2021-1-1 01:01:01 +1" |
YYYY-M-DThh:mm:ss Z |
string |
string |
date-time |
"2021-1-1T01:01:01 +1:00" |
======= | ======= | ======= | ======= | ======= |
YYYY-MM-DD |
string |
string |
date |
"2021-01-01" |
YYYY-MM-DD hh:mm:ss |
string |
string |
date-time |
"2021-01-01 01:01:01" |
YYYY-MM-DD hh:mm:ss Z |
string |
string |
date-time |
"2021-01-01 01:01:01 +0000" |
YYYY-MM-DDThh:mm:ssZ |
string |
string |
date-time |
"2021-01-01T01:01:01Z" "2021-01-01T01:01:01-01:00" |
YYYY-MM-DDThh:mm:ss Z |
string |
string |
date-time |
"2021-01-01T01:01:01 +1:00" |
INVALID DATE-TIME formats
Table with INVALID Date-Time formats
for JsonSchema
This examples will lead to validation error
in json schema, as well as Timestamp 'your_timestamp' is not recognized
inside Snowflake
as a destination.
Format | Data Type | JsonSchema Type | JsonSchema Format | Example |
---|---|---|---|---|
YYYY-MM-DD hh:mm:ss Z |
string |
string |
date-time |
"2021-01-01 01:01:01 UTC" |
YYYY-MM-DDThh:mm:ss Z |
string |
string |
date-time |
"2021-01-01T01:01:01 UTC" "2021-01-01T01:01:01 +1" "2021-01-01T01:01:01 +0000" |
YYYY-MM-DDThh:mm:ssZ |
string |
string |
date-time |
"2021-01-01T01:01:01+0000" "2021-01-01T01:01:01UTC" "2021-01-01T01:01:01+1" |
TESTS ON Snowflake Destination
The tests are made with the single conversion statement:
SELECT to_timestamp_tz('input_string_with_possible_datetime')
and the output is the result of the test, indicated in the tables bellow.
Table with tests on Snowflake
as a destination
VALID DATE-TIME formats
Input String | Format | Snowflake Output |
---|---|---|
"2021-1-1" |
YYYY-M-D |
2021-01-01 00:00:00.000 -0800 |
"2021-1-1 01:01:01" |
YYYY-M-D hh:mm:ss |
2021-01-01 01:01:01.000 -0800 |
"2021-1-1 01:01:01 +1" |
YYYY-M-D hh:mm:ss Z |
2021-01-01 01:01:01.000 +0100 |
"2021-1-1T01:01:01 +1:00" |
YYYY-M-DThh:mm:ss Z |
2021-01-01 01:01:01.000 +0100 |
"2021-01-01" |
YYYY-MM-DD |
2021-01-01 00:00:00.000 -0800 |
"2021-01-01 01:01:01" |
YYYY-MM-DD hh:mm:ss |
2021-01-01 01:01:01.000 -0800 |
"2021-01-01 01:01:01 +0000" |
YYYY-MM-DD hh:mm:ss Z |
2021-01-01 01:01:01.000 +0000 |
"2021-01-01T01:01:01Z" |
YYYY-MM-DDThh:mm:ssZ |
2021-01-01 01:01:01.000 +0000 |
"2021-01-01T01:01:01-01:00" |
YYYY-MM-DDThh:mm:ssZ |
2021-01-01 01:01:01.000 -0100 |
"2021-01-01T01:01:01 +1:00" |
YYYY-MM-DDThh:mm:ss Z |
2021-01-01 01:01:01.000 +0100 |
INVALID DATE-TIME formats
Input String | Format | Snowflake Output |
---|---|---|
"2021-01-01 01:01:01 UTC" |
YYYY-MM-DD hh:mm:ss Z |
Timestamp '2021-01-01 01:01:01 UTC' is not recognized |
"2021-01-01T01:01:01 UTC" |
YYYY-MM-DDThh:mm:ss Z |
Timestamp '2021-01-01T01:01:01 UTC' is not recognized |
"2021-01-01T01:01:01 +1" |
YYYY-MM-DDThh:mm:ss Z |
Timestamp '2021-01-01T01:01:01 +1' is not recognized |
"2021-01-01T01:01:01 +0000" |
YYYY-MM-DDThh:mm:ss Z |
Timestamp '2021-01-01T01:01:01 +0000' is not recognized |
"2021-01-01T01:01:01+0000" |
YYYY-MM-DDThh:mm:ssZ |
Timestamp '2021-01-01T01:01:01+0000' is not recognized |
"2021-01-01T01:01:01UTC" |
YYYY-MM-DDThh:mm:ssZ |
Timestamp '2021-01-01T01:01:01UTC' is not recognized |
"2021-01-01T01:01:01+1" |
YYYY-MM-DDThh:mm:ssZ |
Timestamp '2021-01-01T01:01:01+1' is not recognized |
I believe I've also encountered the same issue, when using a Marketo Source --> Snowflake Destination. I've added context below. Environment
Current BehaviorSync job fails during Normalization stage and does not go further. Logs
|
@pdulapalli Thanks for the info about the Marketo bug, created an #8296 related to your issue. |
Closed with #5712 |
@sherifnada @subodh1810 I'm guessing you found a solution already, but this is how I'm handling it, in case this helps anyone:
This Stack Overflow answer was helpful to me. |
Slack : https://airbytehq.slack.com/archives/C01MFR03D5W/p1629094676136200
For some reason snowflake doesn't identify
2021-04-04T22:54:29+0000
as valid timestamp and because of it the normalisation fails. It does seem like a valid ISO-8601 format but for reasons we dont understand Snowflake doesnt accept it.The funny thing is that if we add colon to the value i.e. change it to
2021-04-04T22:54:29+00:00
snowflake accepts it.The exact same behaviour is observed in JAVA as well i.e.
Instant.parse("2021-04-04T22:54:29+0000");
fails butInstant.parse("2021-04-04T22:54:29+00:00");
passes.In order to fix this we could add an extra step in the Snowflake consumer and transform the such values before writing it to the warehouse, it would work.
We should also add a test case in acceptance tests to see which other destinations cant handle it
Acceptance Criteria
Implementation guide
See the individual tickets for guidance.
The text was updated successfully, but these errors were encountered: