Fix error uploading offset datetime #263
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes metabase/metabase#47007
Description
Without this change Metabase will throw the following error when uploading a CSV with a datetime with an offset value:
This is because we were missing a case in the insert method, and it was falling through the the catch all case. The first fix is to add an explicit case for this type to fix the JDBC integration.
The second fix is to update the config for how we map CSV columns to database types in particular. Since Clickhouse does not preserve the input offset, we made the product choice to keep these values as their raw input string. By returning
nil
for this type we can trigger this behavior.Testing
I am not sure how to get this tested (incl the CSV upload path) in CI.
I have tested manually in my local dev environment, and it works.