I'm not sure what is happening here. In general, I can write a query with a
similar clause without issue. Can you confirm what the complete query was
that was being run when this error occurred?

This worked fine for me:

select CASE WHEN 1000 = 0 THEN NULL ELSE CAST(xxx.`Clip Duration Ms` AS
FLOAT) / 1000 END from cp.`employee.json` xxx;

Note that your example is missing the select and from clauses which is why
I am asking for the complete query.

thanks,
Jacques




--
Jacques Nadeau
CTO and Co-Founder, Dremio

On Tue, Mar 8, 2016 at 1:34 PM, Kashmar, Ali <[email protected]> wrote:

> Hi,
>
> I’m encountering this error while using Tableau with Drill:
>
> (org.apache.drill.exec.work.foreman.ForemanException) Unexpected exception
> during fragment initialization: Internal error: while converting CASE WHEN
> 1000 = 0 THEN NULL ELSE CAST(`Custom_SQL_Query`.`Clip Duration Ms` AS
> FLOAT) / 1000 END
>
>  Caused By (java.lang.UnsupportedOperationException) class
> org.apache.calcite.sql.SqlLiteral: NULL
>     org.apache.calcite.util.Util.needToImplement():920
>
> org.apache.calcite.sql.validate.SqlValidatorImpl.getValidatedNodeType():1420
>
> org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertLiteral():90
>     org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit():4153
>     org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit():3598
>     org.apache.calcite.sql.SqlLiteral.accept():404
>
> org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression():4057
>     org.apache.calcite.sql2rel.StandardConvertletTable.convertCase():303
>     sun.reflect.GeneratedMethodAccessor162.invoke():-1
>     sun.reflect.DelegatingMethodAccessorImpl.invoke():43
>     java.lang.reflect.Method.invoke():606
>
> I’m trying to understand what it means exactly. Is NULL not supported? Is
> there a property I can set to enable it? I didn’t find anything to help me
> in the docs.
>
> Maybe worth mentioning that I didn’t actually see the error in Tableau. I
> enabled verbose errors in drill console and actually copied the query and
> ran it in the console.
>
> Thanks,
>
> Ali Kashmar
> EMC| Open Innovation Lab
> O: 613.321.1334 | M: 613.219.9361
>

Reply via email to