There could be inconsistent results:
https://issues.apache.org/jira/browse/DRILL-4007
On Mon, Nov 2, 2015 at 8:17 AM, Andries Engelbrecht <
aengelbre...@maprtech.com> wrote:
> Currently in 1.2 I observe the following.
>
> 0: jdbc:drill:> select a from dfs.json.`/test.json`;
> +---+
> | a
Currently in 1.2 I observe the following.
0: jdbc:drill:> select a from dfs.json.`/test.json`;
+---+
| a |
+---+
| null |
+———+
But then flatten produces an error
0: jdbc:drill:> select flatten(a) from dfs.json.`/test.json`;
Error: SYSTEM ERROR: ClassCastException: Cannot cast
Sounds to me that FLATTEN over an empty list NULL should produce 0 row.
That's actually the behavior of UNNEST of empty array, or NULL, in Postgres.
Unless we have a strong reason that FLATTEN should behavior
differently than UNNEST, I think it makes sense for FLATTEN to produce
0 row over empty
Seems empty list is getting the vote for select. For consistency would it then
make sense to have flatten produce a single row with an empty list in the
result?
—Andries
> On Nov 2, 2015, at 12:55 PM, Neeraja Rentachintala
> wrote:
>
> Empty list sounds like