You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Daniel Becker (Jira)" <ji...@apache.org> on 2022/11/15 09:35:00 UTC

[jira] [Resolved] (IMPALA-11719) Inconsistency in printing NULL values

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

Daniel Becker resolved IMPALA-11719.
------------------------------------
    Resolution: Fixed

> Inconsistency in printing NULL values
> -------------------------------------
>
>                 Key: IMPALA-11719
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11719
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>            Reporter: Daniel Becker
>            Assignee: Daniel Becker
>            Priority: Major
>
> If they are top level or in collections, null values are printed as "NULL":
> {code:java}
> select int_array from functional_parquet.complextypestbl;
> +------------------------+
> | int_array              |
> +------------------------+
> | [-1]                   |
> | [1,2,3]                |
> | [NULL,1,2,NULL,3,NULL] |
> | []                     |
> | NULL                   |
> | NULL                   |
> | NULL                   |
> | NULL                   |
> +------------------------+{code}
> If they are in a struct, they are printed as "null":
> {code:java}
> select small_struct from functional_parquet.complextypes_structs;
> +------------------------------------+
> | small_struct                       |
> +------------------------------------+
> | NULL                               |
> | {"i":19191,"s":"small_struct_str"} |
> | {"i":98765,"s":null}               |
> | {"i":null,"s":"str"}               |
> | {"i":98765,"s":"abcde f"}          |
> | {"i":null,"s":null}                |
> +------------------------------------+{code}
> In Hive the situation is a bit different: "NULL" is used only for top level values and "null" is printed in both collections and structs.
> {code:java}
> select int_array from functional_parquet.complextypestbl;
> +-------------------------+
> |        int_array        |
> +-------------------------+
> | [-1]                    |
> | [1,2,3]                 |
> | [null,1,2,null,3,null]  |
> | []                      |
> | NULL                    |
> | NULL                    |
> | NULL                    |
> | NULL                    |
> +-------------------------+{code}
> {code:java}
> select small_struct from functional_parquet.complextypes_structs;
> +-------------------------------------+
> |            small_struct             |
> +-------------------------------------+
> | NULL                                |
> | {"i":19191,"s":"small_struct_str"}  |
> | {"i":98765,"s":null}                |
> | {"i":null,"s":"str"}                |
> | {"i":98765,"s":"abcde f"}           |
> | {"i":null,"s":null}                 |
> +-------------------------------------+{code}
> Officially we print collections and structs in JSON form. In JSON the relevant keyword is "null".
> We should decide how we handle this situation.
>  # Have a uniform NULL representation everywhere: top level, collections and structs
>  ** either "NULL" or "null" everywhere
>  # Have "NULL" on the top level and "null" in collections and structs, like Hive
>  # Leave everything as it is now: "NULL" at the top level and in collections, "null" in structs.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org