'Why does snowflake allow implicit truncation of time into a DATE column instead of forcing explicit conversion by default?
The documentation is quite clear that time will be implicitly truncated when setting a DATE attribute with a valid timestamp value.
DATE Snowflake supports a single DATE data type for storing dates (with no time elements). DATE accepts dates in the most common forms (YYYY-MM-DD, DD-MON-YYYY, etc.). In addition, all accepted timestamps are valid inputs for dates; however, the TIME information is truncated.
The question is why?
Or why not default it to not allow, and/or provide an account/session/object parameter to configure it.
The question is raised by customers often, I haven't found an answer on the advantage of current implementation. It is considered a bug in many use cases, since it so easily allows the implicit conversion which and appears to corrupt the data. Instead of implicitly converting why not explicitly require use of the to_date function.
Of course there is testing and datatype choices to consider to handle this, but the question remains.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
