You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Pavel N. Savenkov (JIRA)" <ji...@apache.org> on 2013/08/02 09:17:50 UTC

[jira] [Created] (PIG-3407) JsonLoader strange results on incorrect type in json data

Pavel N. Savenkov created PIG-3407:
--------------------------------------

             Summary: JsonLoader strange results on incorrect type in json data
                 Key: PIG-3407
                 URL: https://issues.apache.org/jira/browse/PIG-3407
             Project: Pig
          Issue Type: Bug
    Affects Versions: 0.11.1
         Environment: java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Mac OS X 10.8.4
            Reporter: Pavel N. Savenkov


{code:title=test.pig}
test = load 'data1.json' using JsonLoader('
    val1: int,
    val2: int,
    val3: int
');
dump test;
{code}

{code:title=data1.json}
{"val1": 1, "val2": 2, "val3": 3}
{"val1": 1, "val2": "2", "val3": 3}
{"val1": 1, "val2": 2, "val3": "3"}
{"val1": 1, "val2": "2", "val3": "3"}
{code}

{code:title=result1}
(1,2,3)
(1,1,3)
(1,2,2)
(1,1,1)
{code}

{code:title=data2.json}
{"val1": "1", "val2": 2, "val3": 3}
{code}

{code:title=result2}
org.codehaus.jackson.JsonParseException: Current token (VALUE_STRING) not numeric, can not use numeric value accessors
 at [Source: java.io.ByteArrayInputStream@4ec2c12c; line: 1, column: 11]
	at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:943)
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira