outrauk / dataiku-plugin-snowflake-hdfs

DSS plugin for fast loading between Snowflake and HDFS
https://github.com/outrauk/dataiku-plugin-snowflake-hdfs
MIT License
0 stars 0 forks source link

fix(AOBS-491): Handle TIMESTAMP and separate tests #13

Closed mklaber closed 4 years ago

mklaber commented 4 years ago

Following @czen88 's identification of a CLIENT_TIMESTAMP_TYPE_MAPPING edge case, this pull request addresses the case where a user may have set TIMESTAMP to mean TIMESTAMP_TZ via CLIENT_TIMESTAMP_TYPE_MAPPING.

Additionally, following the existing HDFS → SF tests' pattern, this PR separates the get_snowflake_to_hdfs_query tests in to a query creation test and a column casting test.

czen88 commented 4 years ago

It would be good to simplify unit test logic a bit. As a hint - I would count number of 'TIMESTAMP_NTZ' literals in SQL to check that we are doing conversion for right number of columns.

mklaber commented 4 years ago

It would be good to simplify unit test logic a bit. As a hint - I would count number of 'TIMESTAMP_NTZ' literals in SQL to check that we are doing conversion for right number of columns.

What happens if we accidentally start casting DATE and stop casting TIMESTAMP? Count doesn't change and the test would not detect that kind of failure. Explicit test cases are important here.