public Object[] getRow( Object[] baseOutputRow, Object[] rawPartRow, JsonInputData data ) throws KettleException { if ( rawPartRow == null ) { return null; } for ( int i = 0; i < rawPartRow.length; i++ ) { int outIdx = data.totalpreviousfields + i; Object val = getValue( data.outputRowMeta.getValueMeta( outIdx ), data.convertRowMeta.getValueMeta( outIdx ), rawPartRow[i] ); rawPartRow[i] = val; if ( val == null && data.repeatedFields.get( i ) && data.previousRow != null ) { rawPartRow[i] = data.previousRow[outIdx]; } } data.previousRow = RowDataUtil.addRowData( baseOutputRow, data.totalpreviousfields, rawPartRow ); return data.previousRow; }
private Object[] buildResult( Object[] r ) throws KettleValueException { Object[] result = null; if ( r != null || meta.isAlwaysGivingBackOneRow() ) { result = RowDataUtil.allocateRowData( data.groupnrs.length ); if ( r != null ) { for ( int i = 0; i < data.groupnrs.length; i++ ) { result[ i ] = r[ data.groupnrs[ i ] ]; } } result = RowDataUtil.addRowData( result, data.groupnrs.length, getAggregateResult() ); } return result; }
public void mergeRowMetaAndData( RowMetaAndData rowMetaAndData, String originStepName ) { int originalMetaSize = rowMeta.size(); rowMeta.mergeRowMeta( rowMetaAndData.getRowMeta(), originStepName ); data = RowDataUtil.addRowData( data, originalMetaSize, rowMetaAndData.getData() ); } }
r = RowDataUtil.addRowData( (Object[]) data.currentInputRow.clone(), data.previousFieldsNumber, r );
outputRowData = RowDataUtil.addRowData( data.readrow, data.totalPreviousFields, outputRowData ); } else { outputRowData = RowDataUtil.resizeArray( outputRowData, data.totalOutStreamFields );
Object[] newRow = RowDataUtil.addRowData( (Object[]) rows[index], data.inputRowMeta.size(), fields );
@Override public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { Object[] r = null; r = getRow(); if ( r == null ) { // no more rows to be expected from the previous step(s) setOutputDone(); return false; } if ( data.firstRow ) { // The output meta is the original input meta + the // additional constant fields. data.firstRow = false; data.outputMeta = getInputRowMeta().clone(); meta.getFields( data.outputMeta, getStepname(), null, null, this, repository, metaStore ); } // Add the constant data to the end of the row. r = RowDataUtil.addRowData( r, getInputRowMeta().size(), data.getConstants().getData() ); putRow( data.outputMeta, r ); if ( log.isRowLevel() ) { logRowlevel( BaseMessages.getString( PKG, "Constant.Log.Wrote.Row", Long.toString( getLinesWritten() ), getInputRowMeta().getString( r ) ) ); } if ( checkFeedback( getLinesWritten() ) ) { if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "Constant.Log.LineNr", Long.toString( getLinesWritten() ) ) ); } } return true; }
while ( row != null ) { int size = data.inputRowMeta.size(); row = RowDataUtil.addRowData( row, size, data.groupResult ); size += data.groupResult.length; lineNr++;
private Object[] lookupValues( RowMetaInterface rowMeta, Object[] row ) throws KettleException { if ( first ) { first = false; data.outputRowMeta = getInputRowMeta().clone(); meta.getFields( data.outputRowMeta, getStepname(), new RowMetaInterface[] { data.infoMeta }, null, this, repository, metaStore ); // Check lookup field data.indexOfMainField = getInputRowMeta().indexOfValue( environmentSubstitute( meta.getMainStreamField() ) ); if ( data.indexOfMainField < 0 ) { // The field is unreachable ! throw new KettleException( BaseMessages.getString( PKG, "FuzzyMatch.Exception.CouldnotFindMainField", meta .getMainStreamField() ) ); } } Object[] add = null; if ( row[ data.indexOfMainField ] == null ) { add = buildEmptyRow(); } else { try { add = getFromCache( row ); } catch ( Exception e ) { throw new KettleStepException( e ); } } return RowDataUtil.addRowData( row, rowMeta.size(), add ); }
private RowMetaAndData readStartDate() throws KettleException { if ( log.isDetailed() ) { logDetailed( "Reading from step [" + data.infoStream.getStepname() + "]" ); } RowMetaInterface parametersMeta = new RowMeta(); Object[] parametersData = new Object[] {}; RowSet rowSet = findInputRowSet( data.infoStream.getStepname() ); if ( rowSet != null ) { Object[] rowData = getRowFrom( rowSet ); // rows are originating from "lookup_from" while ( rowData != null ) { parametersData = RowDataUtil.addRowData( parametersData, parametersMeta.size(), rowData ); parametersMeta.addRowMeta( rowSet.getRowMeta() ); rowData = getRowFrom( rowSet ); // take all input rows if needed! } if ( parametersMeta.size() == 0 ) { throw new KettleException( "Expected to read parameters from step [" + data.infoStream.getStepname() + "] but none were found." ); } } else { throw new KettleException( "Unable to find rowset to read from, perhaps step [" + data.infoStream.getStepname() + "] doesn't exist. (or perhaps you are trying a preview?)" ); } RowMetaAndData parameters = new RowMetaAndData( parametersMeta, parametersData ); return parameters; }
int size = data.inputRowMeta.size(); row = RowDataUtil.addRowData( row, size, data.groupResult ); size += data.groupResult.length;
.getReadField() ); row = RowDataUtil.addRowData( row, getInputRowMeta().size(), add.getData() );
outputRow = RowDataUtil.addRowData( previousRow, getInputRowMeta().size(), data.getTrueArray() ); } else { outputRow = previousRow; outputRow = RowDataUtil.addRowData( previousRow, getInputRowMeta().size(), data.getFalseArray() );
row = RowDataUtil.addRowData( rowIn, data.prevNrField, row );
return RowDataUtil.addRowData( row, rowMeta.size(), add );
outputRow = RowDataUtil.addRowData( outputRow, data.totalpreviousfields, extraData );
rowData = RowDataUtil.addRowData( rowData, data.inputRowMeta.size(), data.extraData );
row = RowDataUtil.addRowData( row, getInputRowMeta().size(), new Object[] { ranges } ); putRow( data.outputRowMeta, row ); if ( checkFeedback( getLinesRead() ) ) {
getResultRow( data.result, meta.getUpdateField(), meta.getInsertField(), meta.getDeleteField(), meta .getReadField() ); row = RowDataUtil.addRowData( row, getInputRowMeta().size(), add.getData() );
Object[] outputRowData = RowDataUtil.addRowData( r, getInputRowMeta().size(), fields );