Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Create Result Set User defined java class

  1. #1
    Join Date
    Oct 2010
    Posts
    21

    Post Create Result Set User defined java class

    Hi, i have a hashmap<String,List> created from input rows, and i need create the new result set... i am blocked here:

    Code:
    public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
    {
    	Object[] r = getRow();
    
    
    	if (r == null) {
      logError("the last time");
      // Create new result set
      for (int i = 0; i < size; i++){ 
        // i need add one new row for one old column
        // add column
        //logError("new row for ".concat(columnas[i])); //workfine
        Iterator it=((ArrayList) traspuesta.get(columnas[i])).iterator();
         while(it.hasNext()) { //Por cada fila antigua creo una columna ahora, con el nombre del día +1
          logError(Long.toString((Long) it.next())); //workfine
          // add new column to the new row
        }
      }
      //setOutputRowSets(newResultSet);  I think put here the new resulset, and after it will be the output step??...
      setOutputDone();
    
      ....
    
      //putRow(data.outputRowMeta, r); I have commented this, because i only need the new result set
    Anybody have one example??, i have tried all... (i need dinamically, i can't use the tab Fields of UI)

    Thanks.

  2. #2
    Join Date
    Oct 2010
    Posts
    21

    Default

    Resolved, i have a great idea, i have used the same resulset, clear, resaize, put new columns and put new rows.
    Thanks for the reads!!

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.