Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Error parsing string when using Json input step

  1. #1
    Join Date
    Mar 2014
    Posts
    181

    Default Error parsing string when using Json input step

    I have a transformation that takes an attributes field using the JSON step and processes it and extracts multiple fields out of it.
    When I process transformation, I get an error which is not clear to me.

    I have attached the sample Ktrs, log file and sample data.

    Can you please explain to me what is going on?


    Thanks,

    Ron

  2. #2
    Join Date
    Nov 2008
    Posts
    777

    Default

    Hmmm. You don't seem to have JSON-formatted data (basically, name-value pairs separated by colons and enclosed in curly braces) so it stands to reason that the Json input step won't handle it very well. What exactly are you trying to accomplish?
    Last edited by darrell.nelson; 04-23-2014 at 09:57 AM.
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  3. #3
    Join Date
    Mar 2014
    Posts
    181

    Default

    Quote Originally Posted by darrell.nelson View Post
    Hmmm. You don't seem to have JSON-formatted data (basically, name-value pairs separated by colons and enclosed in curly braces) so it stands to reason that the Json input step won't handle it very well. What exactly are you trying to accomplish?

    I wanted to extract out all the fields I specified in the JSON input step.

    Thanks,

    Ron

  4. #4
    Join Date
    Nov 2008
    Posts
    777

    Default

    I have attached a modified version of your transformation that parses your attributes field using the Split fields to rows and Split fields steps. Here is a preview of the output. If you want the name/value pairs put back into columns, try adding a Row denormalizer step.

    Name:  preview.jpg
Views: 165
Size:  32.2 KB
    Attached Files Attached Files
    Last edited by darrell.nelson; 04-23-2014 at 10:16 AM.
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

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.