Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8589563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:05:14+00:00 2026-06-11T23:05:14+00:00

I’m doing an ETL-process with Pentaho (Spoon / Kettle) where I’d like to read

  • 0

I’m doing an ETL-process with Pentaho (Spoon / Kettle) where I’d like to read XML-file and store element values to db.

This works just fine with “Get data from XML” -component…but the XML file is quite big, several giga bytes, and there fore reading the file takes too long.

Pentaho Wiki says:

The existing Get Data from XML step is easier to use but uses DOM
parsers that need in memory processing and even the purging of parts
of the file is not sufficient when these parts are very big.

The XML Input Stream (StAX) step uses a completely different approach
to solve use cases with very big and complex data stuctures and the
need for very fast data loads…

There fore I’m now trying to do the same with StAX, but it just doesn’t seem to work out like planned. I’m testing this with XML-file which only has one element group. The file is read and then mapped/inserted to table…but now I get multiple rows to table where all the values are “undefined” and some rows where I have the right values. In total I have 92 rows in the table, even though it should only have one row.

Flow goes like:

1) read with StAX

2) Modified Java Script Value

3) Output to DB

At step 2) I’m doing as follow:

var id;

if ( xml_data_type_description.equals(“CHARACTERS”) &&
xml_path.equals(“/labels/label/id”) ) {
id = xml_data_value; }
…

I’m using positional-staz.zip from http://forums.pentaho.com/showthread.php?83480-XPath-in-Get-data-from-XML-tool&p=261230#post261230 as an example.

How to use StAX for reading XML-file and storing the element values to DB?

I’ve been trying to look for examples but haven’t found much. The above example uses “Filter Rows” -component before inserting the rows. I don’t quite understand why it’s being used, can’t I just map the values I need? It might be that this problem occurs because I don’t use, or know how to use, Filter Rows -component.

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:05:16+00:00Added an answer on June 11, 2026 at 11:05 pm

    I posted a possible StAX-based solution on the forum listed above, but I’ll post the gist of it here since it is awaiting moderator approval.

    Using the StAX parser, you can select just those elements that you care about, namely those with a data type of CHARACTERS. For the forum example, you basically need to denormalize the rows in sets of 4 (EXPR, EXCH, DATE, ASK). To do this you add the row number to the stream (using an Add Sequence step) then use a Calculator to determine a “bucket number” = INT((rownum-1)/4). This will give you a grouping field for a Row Denormaliser step.

    When the post is approved, you’ll see a link to a transformation that uses StAX and the method I describe above.

    Is this what you’re looking for? If not please let me know where I misunderstood and maybe I can help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm parsing an XML file, the creators of it stuck in a bunch social
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.