Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.8.0
-
None
Description
For operations involving the date datatype, when one of the operands is a DATE literal without a cast, query fails.
The following query fails to validate:
SELECT * FROM date_dim WHERE d_date BETWEEN '2002-3-01' AND cast('2002-3-01' AS DATE) LIMIT 1;
Query failed: SqlValidatorException: Cannot apply 'BETWEEN' to arguments of type '<ANY> BETWEEN <CHAR(9)> AND <DATE>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
The following query executes fine:
SELECT * FROM date_dim WHERE d_date BETWEEN '2002-3-01' AND '2002-3-01' LIMIT 1;
Both the queries execute fine on postgres
Attachments
Issue Links
- relates to
-
DRILL-2332 Drill should be consistent with Implicit casting rules across data formats
- Closed