[ 
https://issues.apache.org/jira/browse/HIVE-30187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Denys Kuzmenko updated HIVE-30187:
----------------------------------
    Description: 
- SELECT id, v FROM t UNION ALL SELECT 0, NULL fails:
  {{SemanticException Schema of both sides of setop should match: Column v is 
of type variant on first table and type void on second table}}.
  NULL on the left fails the same way.
- INSERT INTO t VALUES (1, parse_json('{"a":1}')), (2, NULL) fails: Argument 
type mismatch 'TOK_NULL'.
Cause: FunctionRegistry.getCommonClassForUnionAll returns null for any 
non-primitive side before it handles void.
Struct columns behave the same.
Workaround: CAST(NULL AS VARIANT).

> UNION ALL / multi-row VALUES of a variant with a bare NULL fails at compile 
> time
> --------------------------------------------------------------------------------
>
>                 Key: HIVE-30187
>                 URL: https://issues.apache.org/jira/browse/HIVE-30187
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Denys Kuzmenko
>            Priority: Major
>
> - SELECT id, v FROM t UNION ALL SELECT 0, NULL fails:
>   {{SemanticException Schema of both sides of setop should match: Column v is 
> of type variant on first table and type void on second table}}.
>   NULL on the left fails the same way.
> - INSERT INTO t VALUES (1, parse_json('{"a":1}')), (2, NULL) fails: Argument 
> type mismatch 'TOK_NULL'.
> Cause: FunctionRegistry.getCommonClassForUnionAll returns null for any 
> non-primitive side before it handles void.
> Struct columns behave the same.
> Workaround: CAST(NULL AS VARIANT).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to