Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
Here is the same JSON I am trying to query and use kvgen function with.
{
"name":"test",
"myarray":
}{
"name":"mytest",
"myarray":
}
Currently , when I apply kvgen a list of 'unioned' columns are returned as keys in the result. For ex: both the result rows below have keys 1-6.
The expected result is only the keys that actually have values associated with them.
0: jdbc:drill:zk=local> SELECT name, kvgen(myarray) FROM dfs.`default`.`/Users/nrentachintala/Downloads/apache-drill-0.7.0-incubating-SNAPSHOT/sample-data/mytest.json`;
----------------------+
name | EXPR$1 |
----------------------+
test | [{"key":"key1","value":2},{"key":"key4","value":3},{"key":"key2","value":4},{"key":"key3"},{"key":"key5"},{"key":"key6"}] |
mytest | [{"key":"key1"},{"key":"key4"},{"key":"key2"},{"key":"key3","value":2},{"key":"key5","value":3},{"key":"key6","value":4}] |
----------------------+