[
https://issues.apache.org/jira/browse/CALCITE-3155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16875840#comment-16875840
]
Musbah EL FIL commented on CALCITE-3155:
----------------------------------------
Indeed. The fix was applied to the part of the code that was already using the
DUAL table.
I have update the PR with an additional commit to account for the non-Oracle
case. In such cases, i am building query of the form "*select * from (
VALUES(null, null, ..., null) ) as T(C1, C2 ... Cn) where 1=0* ".
The reason for choosing "_1=0_" is that "_where false_" is not supported on SQL
Server. And we need to build a sub-query that returns an empty result set since
we are trying to convert to an SQL string VALUES with no tuples.
> AssertionError in RelToSqlConverter when visiting empty Values node
> -------------------------------------------------------------------
>
> Key: CALCITE-3155
> URL: https://issues.apache.org/jira/browse/CALCITE-3155
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Musbah EL FIL
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Given the query:
> *select A."department_id" from "foodmart"."employee" A where
> A."department_id" = ( select min( A."department_id") from
> "foodmart"."department" B where 1=2 )*
> The conversion from SqlNode to RelNode is correct, however when going from
> RelNode to SqlNode, an exception was being thrown.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)