[ 
https://issues.apache.org/jira/browse/CALCITE-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16797637#comment-16797637
 ] 

Julian Hyde commented on CALCITE-2926:
--------------------------------------

Those queries don't look valid. In each case, {{table_2.plural_columns}} has to 
be an expression, which means that {{table_2}} has to be a table alias, which 
means that it has to occur in a FROM clause. So, I think this would be valid:

{code}SELECT * FROM table_1
WHERE table_1.singular_column IN (
  SELECT u.c
  FROM table_2, UNNEST(table_2.plural_columns) AS u(c)){code}

> IN operator type validation failure
> -----------------------------------
>
>                 Key: CALCITE-2926
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2926
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.18.0
>            Reporter: Will Yu
>            Priority: Major
>
> There are two columns in my table. Column A's type is VARCHAR while column 
> B's type is VARCHAR ARRAY.
> When validating the SQL call `A IN B` the validation failed. 
> The root cause seems to be in checkTypes functions in SqlInOperator. 
>  # Not sure whether UNORDERED comparator is a good candidate because IN 
> operands should have order.
>  # During being checked in the checker, `canConvertStringInCompare` will give 
> a `false` when family is ARRAY and cause this failure. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to