On Tue, Feb 09, 2016 at 11:52:12AM -0800, Hsuan Yi Chu wrote:
The reason you are seeing this is because the types are known to Drill at the planning time.The planning engine Drill uses is Calcite which does not allow this operation to happen. (as the error message suggests). One workaround you could take is to cover up the type information by cast(... as ANY), such as: SELECT cast(DATE '2009-01-01' as any) - cast(DATE '2009-05-05' as any) FROM (values(1)); On the other hand, the community is doing some work to relax the type constraints (a component of Drill-4372). Hopefully, you could run your original query in the near future. On Tue, Feb 9, 2016 at 6:47 AM, Oscar Morante <[email protected]> wrote:Hi there, I'm new to both the list and Drill. I'm doing some tests using Tableau and when I use the `DATEDIFF` function in a calculated field Tableau generates queries that contain stuff like this: SELECT DATE '2009-01-01' - DATE '2009-05-05' FROM (values(1)); ...which throws this error: ExampleExceptionFormatter: exception message was: VALIDATION ERROR: From line 1, column 8 to line 1, column 44: Cannot apply '-' to arguments of type '<DATE> - <DATE>'. Supported form(s): '<NUMERIC> - <NUMERIC>' '<DATETIME_INTERVAL> - <DATETIME_INTERVAL>' '<DATETIME> - <DATETIME_INTERVAL>' I was looking around and according to the original task (DRILL-549) that kind of query should be supported. Is this a regression? Am I doing something wrong? Thanks,
--
Oscar Morante
"Self-education is, I firmly believe, the only kind of education there is."
-- Isaac Asimov.
signature.asc
Description: Digital signature
