Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Json Output

  1. #1
    Join Date
    Jun 2016
    Posts
    181

    Default Json Output

    Writing to Json Output produce file that is not proper Json. During validation generate error:

    Code:
    Error: Parse error on line 1:
    ...replacement":null}]}{"data":[{"producer"
    -----------------------^
    Expecting 'EOF', '}', ',', ']', got '{'
    This Joson does not looke like... Json. First of all for some weired reason this step produces as many Json as no of input rows ("append" option must be on or I will get just one row). I want sone combined Json.

    Any way to have valid Json?
    Regards

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Did you read the Wiki page on Json-Output?
    What is your setting for the number of rows in a block?
    Last edited by marabu; 10-21-2017 at 07:10 AM.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Jun 2016
    Posts
    181

    Default

    Quote Originally Posted by marabu View Post
    Did you read the Wiki page on Json-Output?
    What is your setting for the number or rows in a block?
    Yes, I was studing it.
    I've tested with "0", "1", "3"...even "4". Nothing helps. Json result is not a valid json.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    I ran the sample transformation provided on the Wiki page.
    The result was validated online via copy & paste.

    Important is "nr of rows in block" = 0 to cram everything in a single array, else you'll find a second data block as visible in the error message you provided.
    If you still get an error, enable us to reproduce the error.

  5. #5
    Join Date
    Jun 2016
    Posts
    181

    Default

    Thanks Marabu,

    tried what u suggest before - does not work

    See my test transformation - it is not able to produce valid Json.
    Attached Files Attached Files

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    I fed the output of your transformation to an online validator - and it validates alright.

  7. #7
    Join Date
    Jun 2016
    Posts
    181

    Default

    Thanks for your time Marabu.

    I think problem was because it APPENDS to the file. So I was having old content in file. Would be nice this wipe out existing file when process starts.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.