You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jason Altekruse (JIRA)" <ji...@apache.org> on 2015/11/13 22:07:11 UTC

[jira] [Commented] (DRILL-4087) Error parsing JSON - Invalid numeric value: Leading zeroes not allowed

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

Jason Altekruse commented on DRILL-4087:
----------------------------------------

JSON does not consider numbers with leading zeros to be valid. You can try to work around this by using Drill's all text mode for JSON. This will read all of the data into varchar columns, you will need to cast to get any specific types like integer, double or boolean. You may need to strip of the leading zeros before casting, but I'm not sure about the accepted format of the cast function.

To set this option run: alter session set `store.json.all_text_mode` = 'true';

This site has nice diagrams to show the accepted values in JSON.
http://www.json.org/

> Error parsing JSON - Invalid numeric value: Leading zeroes not allowed
> ----------------------------------------------------------------------
>
>                 Key: DRILL-4087
>                 URL: https://issues.apache.org/jira/browse/DRILL-4087
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>         Environment: Hadoop 2.7.1 cluster running on AWS staging instance t4.medium 
> Apahe Dril - 1.2.0
>            Reporter: Shankar
>
> jdbc:drill:> SELECT count(`timestamp`) FROM dfs.`/tmp/drill-s/` limit 10;
> Error: DATA_READ ERROR: Error parsing JSON - Invalid numeric value: Leading zeroes not allowed
> is there any solution for this error ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)