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

ASF GitHub Bot commented on DRILL-5033:
---------------------------------------

cgivre commented on PR #2731:
URL: https://github.com/apache/drill/pull/2731#issuecomment-1367977377

   > Thanks @cgivre for the clarification, but suppose the assumption that 
considering nulls as strings would solve the issue, were the changes i made 
(over the class JSONReader.java) adequate (should the methods be changed as i 
did)? i see that some tests didn't pass.
   
   For us to merge a pull request, all the unit tests have to pass.  (Or be 
modified with an explanation of why they are being modified)  Drill is a very 
complex beast with a lot of dependencies so even small changes can break things 
you didn't intend to.  Believe me... I know from experience ;-)
   
   One other thing to note is that there is another option 
`drill.exec.functions.cast_empty_string_to_null`.  Setting this to true forces 
empty strings to be treated as `null`.  This can have some unintended side 
effects,  but might also help you out. 




> Query on JSON that has null as value for each key
> -------------------------------------------------
>
>                 Key: DRILL-5033
>                 URL: https://issues.apache.org/jira/browse/DRILL-5033
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - JSON
>    Affects Versions: 1.9.0
>            Reporter: Khurram Faraaz
>            Priority: Major
>
> Drill 1.9.0 git commit ID : 83513daf
> Drill returns same result with or without `store.json.all_text_mode`=true
> Note that each key in the JSON has null as its value.
> [root@cent01 null_eq_joins]# cat right_all_nulls.json
> {
>      "intKey" : null,
>      "bgintKey": null,
>      "strKey": null,
>      "boolKey": null,
>      "fltKey": null,
>      "dblKey": null,
>      "timKey": null,
>      "dtKey": null,
>      "tmstmpKey": null,
>      "intrvldyKey": null,
>      "intrvlyrKey": null
> }
> [root@cent01 null_eq_joins]#
> Querying the above JSON file results in null as query result.
>  -  We should see each of the keys in the JSON as a column in query result.
>  -  And in each column the value should be a null value. 
> Current behavior does not look right.
> {noformat}
> 0: jdbc:drill:schema=dfs.tmp> select * from `right_all_nulls.json`;
> +-------+
> |   *   |
> +-------+
> | null  |
> +-------+
> 1 row selected (0.313 seconds)
> {noformat}
> Adding comment from [~julianhyde] 
> IMHO it is similar but not the same as DRILL-1256. Worth logging an issue and 
> let [~jnadeau] (or someone) put on the record what should be the behavior of 
> an empty record (empty JSON map) when it is top-level (as in this case) or in 
> a collection.



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

Reply via email to