Description
Drill doesn't seem to accept subtracting a time from a time (which should yield an interval):
0: jdbc:drill:> VALUES CURRENT_TIME - CURRENT_TIME;
Error: PARSE ERROR: From line 1, column 8 to line 1, column 34: Cannot apply '-' to arguments of type '<TIME(0)> - <TIME(0)>'. Supported form(s): '<NUMERIC> - <NUMERIC>'
'<DATETIME_INTERVAL> - <DATETIME_INTERVAL>'
'<DATETIME> - <DATETIME_INTERVAL>'
[Error Id: ede6c073-ca82-4359-8adb-db413e051e29 on dev-linux2:31010] (state=,code=0)
0: jdbc:drill:>
See ISO/IEC 9075-2:2011(E) section 4.6, Datetimes and intervals, whose Table 7, Valid operators involving datetimes and intervals, starts like this:
Operand 1 | Operator | Operand 2 | Result Type |
Datetime | – | Datetime | Interval |