Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.9.0
-
None
-
None
-
Drill 1.9.0
Description
We need a better error message , rather than DrillRuntimeException
0: jdbc:drill:schema=dfs.tmp> SELECT case res1 WHEN true THEN res1 ELSE null END . . . . . . . . . . . . . . > FROM . . . . . . . . . . . . . . > ( . . . . . . . . . . . . . . > SELECT . . . . . . . . . . . . . . > (CASE WHEN (false) THEN null ELSE 1 end) res1 . . . . . . . . . . . . . . > FROM (values(1)) . . . . . . . . . . . . . . > ); Error: SYSTEM ERROR: DrillRuntimeException: Failure while materializing expression in constant expression evaluator [CASE(=(CASE(false, null, 1), true), CASE(false, null, 1), null)]. Errors: Error in expression at index -1. Error: Missing function implementation: [castINT(BIT-REQUIRED)]. Full expression: --UNKNOWN EXPRESSION--. [Error Id: 1fba5a4e-89b6-415c-8982-97bf841869ef on centos-01.qa.lab:31010] (state=,code=0)
Calcite gives a very easy to understand message
0: jdbc:calcite:model=target/test-classes/mod> SELECT case res1 WHEN true THEN res1 ELSE null END . . . . . . . . . . . . . . . . . . . . . . .> FROM . . . . . . . . . . . . . . . . . . . . . . .> ( . . . . . . . . . . . . . . . . . . . . . . .> SELECT . . . . . . . . . . . . . . . . . . . . . . .> (CASE WHEN (false) THEN null ELSE 1 end) res1 . . . . . . . . . . . . . . . . . . . . . . .> FROM (values(1)) foo . . . . . . . . . . . . . . . . . . . . . . .> ) foobar ; Error: Error while executing SQL "SELECT case res1 WHEN true THEN res1 ELSE null END FROM ( SELECT (CASE WHEN (false) THEN null ELSE 1 end) res1 FROM (values(1)) foo ) foobar ": From line 1, column 8 to line 1, column 50: Cannot apply '=' to arguments of type '<INTEGER> = <BOOLEAN>'. Supported form(s): '<COMPARABLE_TYPE> = <COMPARABLE_TYPE>' (state=,code=0)