databricks-sql-cli
databricks-sql-cli copied to clipboard
"year 0 is out of range" error when reading `date` fields with zero value
I'm trying to read data from a table that has a column of type Date, as well as one of Timestamp, and if there are date or datetimes with the value 0, that is, 0000-01-01 for date, and 0000-01-01T00:00:00Z for timestamp, then the cli fails with the following error.
year 0 is out of range
I have verified that if I filter out zero values, it works:
dbsqlcli -e "SELECT id, datetime FROM my_table WHERE datetime > TIMESTAMP('0000-01-01T00:00:00Z');"
dbsqlcli -e "SELECT id, date FROM my_table WHERE date > DATE('0000-01-01');"