Java Code Examples for org.pentaho.di.core.row.ValueMetaInterface#setStorageMetadata()

The following examples show how to use org.pentaho.di.core.row.ValueMetaInterface#setStorageMetadata() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StringOperationsMetaTest.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetFields() throws Exception {
  StringOperationsMeta meta = new StringOperationsMeta();
  meta.allocate( 1 );
  meta.setFieldInStream( new String[] { "field1" } );

  RowMetaInterface rowMetaInterface = new RowMeta();
  ValueMetaInterface valueMeta = new ValueMetaString( "field1" );
  valueMeta.setStorageMetadata( new ValueMetaString( "field1" ) );
  valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
  rowMetaInterface.addValueMeta( valueMeta );

  VariableSpace space = mock( VariableSpace.class );
  meta.getFields( rowMetaInterface, "STRING_OPERATIONS", null, null, space, null, null );
  RowMetaInterface expectedRowMeta = new RowMeta();
  expectedRowMeta.addValueMeta( new ValueMetaString( "field1" ) );
  assertEquals( expectedRowMeta.toString(), rowMetaInterface.toString() );
}
 
Example 2
Source File: TableInputMetaTest.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Test
public void testGetFields() throws Exception {
  TableInputMetaHandler meta = new TableInputMetaHandler();
  meta.setLazyConversionActive( true );
  DatabaseMeta dbMeta = mock( DatabaseMeta.class );
  meta.setDatabaseMeta( dbMeta );
  Database mockDB = meta.getDatabase();
  when( mockDB.getQueryFields( anyString(), anyBoolean() ) ).thenReturn( createMockFields() );

  RowMetaInterface expectedRowMeta = new RowMeta();
  ValueMetaInterface valueMeta = new ValueMetaString( "field1" );
  valueMeta.setStorageMetadata( new ValueMetaString( "field1" ) );
  valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
  expectedRowMeta.addValueMeta( valueMeta );

  VariableSpace space = mock( VariableSpace.class );
  RowMetaInterface rowMetaInterface = new RowMeta();
  meta.getFields( rowMetaInterface, "TABLE_INPUT_META", null, null, space, null, null );

  assertEquals( expectedRowMeta.toString(), rowMetaInterface.toString() );
}
 
Example 3
Source File: GoogleSpreadsheetInputMeta.java    From pdi-google-spreadsheet-plugin with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
    try {
        inputRowMeta.clear(); // Start with a clean slate, eats the input

        for (TextFileInputField field : inputFields) {
            ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta(field.getName(), field.getType());
            valueMeta.setConversionMask(field.getFormat());
            valueMeta.setLength(field.getLength());
            valueMeta.setPrecision(field.getPrecision());
            valueMeta.setConversionMask(field.getFormat());
            valueMeta.setDecimalSymbol(field.getDecimalSymbol());
            valueMeta.setGroupingSymbol(field.getGroupSymbol());
            valueMeta.setCurrencySymbol(field.getCurrencySymbol());
            valueMeta.setTrimType(field.getTrimType());
            valueMeta.setStorageType(ValueMetaInterface.STORAGE_TYPE_BINARY_STRING);
            valueMeta.setDateFormatLenient(true);
            valueMeta.setStringEncoding("UTF-8");

            ValueMetaInterface storageMetadata = ValueMetaFactory.cloneValueMeta(valueMeta, ValueMetaInterface.TYPE_STRING);
            storageMetadata.setStorageType(ValueMetaInterface.STORAGE_TYPE_NORMAL);
            storageMetadata.setLength(-1, -1); // we don't really know the lengths of the strings read in advance.
            valueMeta.setStorageMetadata(storageMetadata);

            valueMeta.setOrigin(name);

            inputRowMeta.addValueMeta(valueMeta);
        }
    } catch (Exception e) {

    }
}
 
Example 4
Source File: FixedInputMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
  VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  try {
    for ( int i = 0; i < fieldDefinition.length; i++ ) {
      FixedFileInputField field = fieldDefinition[i];

      ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( field.getName(), field.getType() );
      valueMeta.setConversionMask( field.getFormat() );
      valueMeta.setTrimType( field.getTrimType() );
      valueMeta.setLength( field.getLength() );
      valueMeta.setPrecision( field.getPrecision() );
      valueMeta.setConversionMask( field.getFormat() );
      valueMeta.setDecimalSymbol( field.getDecimal() );
      valueMeta.setGroupingSymbol( field.getGrouping() );
      valueMeta.setCurrencySymbol( field.getCurrency() );
      valueMeta.setStringEncoding( space.environmentSubstitute( encoding ) );
      if ( lazyConversionActive ) {
        valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
      }

      // In case we want to convert Strings...
      //
      ValueMetaInterface storageMetadata =
        ValueMetaFactory.cloneValueMeta( valueMeta, ValueMetaInterface.TYPE_STRING );
      storageMetadata.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );

      valueMeta.setStorageMetadata( storageMetadata );

      valueMeta.setOrigin( origin );

      rowMeta.addValueMeta( valueMeta );
    }
  } catch ( Exception e ) {
    throw new KettleStepException( e );
  }
}
 
Example 5
Source File: SortRowsMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings( "WeakerAccess" )
public void assignSortingCriteria( RowMetaInterface inputRowMeta ) {
  for ( int i = 0; i < fieldName.length; i++ ) {
    int idx = inputRowMeta.indexOfValue( fieldName[i] );
    if ( idx >= 0 ) {
      ValueMetaInterface valueMeta = inputRowMeta.getValueMeta( idx );
      // On all these valueMetas, check to see if the value actually exists before we try to
      // set them.
      if ( ascending.length > i ) {
        valueMeta.setSortedDescending( !ascending[i] );
      }
      if ( caseSensitive.length > i ) {
        valueMeta.setCaseInsensitive( !caseSensitive[i] );
      }
      if ( collatorEnabled.length > i ) {
        valueMeta.setCollatorDisabled( !collatorEnabled[i] );
      }
      if ( collatorStrength.length > i ) {
        valueMeta.setCollatorStrength( collatorStrength[i] );
      }
      // Also see if lazy conversion is active on these key fields.
      // If so we want to automatically convert them to the normal storage type.
      // This will improve performance, see also: PDI-346
      //
      valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
      valueMeta.setStorageMetadata( null );
    }
  }
}
 
Example 6
Source File: FuzzyMatchTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Test
public void testLookupValuesWhenMainFieldIsNull() throws Exception {
  FuzzyMatchData data = spy( new FuzzyMatchData() );
  FuzzyMatchMeta meta = spy( new FuzzyMatchMeta() );
  data.readLookupValues = false;
  fuzzyMatch =
          new FuzzyMatchHandler( mockHelper.stepMeta, mockHelper.stepDataInterface, 0, mockHelper.transMeta,
                  mockHelper.trans );
  fuzzyMatch.init( meta, data );
  fuzzyMatch.first = false;
  data.indexOfMainField = 1;
  Object[] inputRow = { "test input", null };
  RowSet lookupRowSet = mockHelper.getMockInputRowSet( new Object[]{ "test lookup" } );
  fuzzyMatch.addRowSetToInputRowSets( mockHelper.getMockInputRowSet( inputRow ) );
  fuzzyMatch.addRowSetToInputRowSets( lookupRowSet );
  fuzzyMatch.rowset = lookupRowSet;

  RowMetaInterface rowMetaInterface = new RowMeta();
  ValueMetaInterface valueMeta = new ValueMetaString( "field1" );
  valueMeta.setStorageMetadata( new ValueMetaString( "field1" ) );
  valueMeta.setStorageType( ValueMetaInterface.TYPE_STRING );
  rowMetaInterface.addValueMeta( valueMeta );
  when( lookupRowSet.getRowMeta() ).thenReturn( rowMetaInterface );
  fuzzyMatch.setInputRowMeta( rowMetaInterface.clone() );
  data.outputRowMeta = rowMetaInterface.clone();

  fuzzyMatch.processRow( meta, data );
  Assert.assertEquals( inputRow[0], fuzzyMatch.resultRow[0] );
  Assert.assertNull( fuzzyMatch.resultRow[1] );
  Assert.assertTrue( Arrays.stream( fuzzyMatch.resultRow, 3, fuzzyMatch.resultRow.length ).allMatch( val ->  val == null ) );
}
 
Example 7
Source File: ValueMetaFactory.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public static void cloneInfo( ValueMetaInterface source, ValueMetaInterface target ) throws KettlePluginException {
  target.setConversionMask( source.getConversionMask() );
  target.setDecimalSymbol( source.getDecimalSymbol() );
  target.setGroupingSymbol( source.getGroupingSymbol() );
  target.setStorageType( source.getStorageType() );
  if ( source.getStorageMetadata() != null ) {
    target.setStorageMetadata( cloneValueMeta( source.getStorageMetadata(), source
      .getStorageMetadata().getType() ) );
  }
  target.setStringEncoding( source.getStringEncoding() );
  target.setTrimType( source.getTrimType() );
  target.setDateFormatLenient( source.isDateFormatLenient() );
  target.setDateFormatLocale( source.getDateFormatLocale() );
  target.setDateFormatTimeZone( source.getDateFormatTimeZone() );
  target.setLenientStringToNumber( source.isLenientStringToNumber() );
  target.setLargeTextField( source.isLargeTextField() );
  target.setComments( source.getComments() );
  target.setCaseInsensitive( source.isCaseInsensitive() );
  target.setCollatorDisabled( source.isCollatorDisabled() );
  target.setCollatorStrength( source.getCollatorStrength() );
  target.setIndex( source.getIndex() );

  target.setOrigin( source.getOrigin() );

  target.setOriginalAutoIncrement( source.isOriginalAutoIncrement() );
  target.setOriginalColumnType( source.getOriginalColumnType() );
  target.setOriginalColumnTypeName( source.getOriginalColumnTypeName() );
  target.setOriginalNullable( source.isOriginalNullable() );
  target.setOriginalPrecision( source.getOriginalPrecision() );
  target.setOriginalScale( source.getOriginalScale() );
  target.setOriginalSigned( source.isOriginalSigned() );
}
 
Example 8
Source File: ParGzipCsvInputMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
  VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  try {
    rowMeta.clear(); // Start with a clean slate, eats the input

    for ( int i = 0; i < inputFields.length; i++ ) {
      TextFileInputField field = inputFields[i];

      ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( field.getName(), field.getType() );
      valueMeta.setConversionMask( field.getFormat() );
      valueMeta.setLength( field.getLength() );
      valueMeta.setPrecision( field.getPrecision() );
      valueMeta.setConversionMask( field.getFormat() );
      valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
      valueMeta.setGroupingSymbol( field.getGroupSymbol() );
      valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
      valueMeta.setTrimType( field.getTrimType() );
      if ( lazyConversionActive ) {
        valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
      }
      valueMeta.setStringEncoding( space.environmentSubstitute( encoding ) );

      // In case we want to convert Strings...
      // Using a copy of the valueMeta object means that the inner and outer representation format is the same.
      // Preview will show the data the same way as we read it.
      // This layout is then taken further down the road by the metadata through the transformation.
      //
      ValueMetaInterface storageMetadata =
        ValueMetaFactory.cloneValueMeta( valueMeta, ValueMetaInterface.TYPE_STRING );
      storageMetadata.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
      storageMetadata.setLength( -1, -1 ); // we don't really know the lengths of the strings read in advance.
      valueMeta.setStorageMetadata( storageMetadata );

      valueMeta.setOrigin( origin );

      rowMeta.addValueMeta( valueMeta );
    }

    if ( !Utils.isEmpty( filenameField ) && includingFilename ) {
      ValueMetaInterface filenameMeta = new ValueMetaString( filenameField );
      filenameMeta.setOrigin( origin );
      if ( lazyConversionActive ) {
        filenameMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
        filenameMeta.setStorageMetadata( new ValueMetaString( filenameField ) );
      }
      rowMeta.addValueMeta( filenameMeta );
    }

    if ( !Utils.isEmpty( rowNumField ) ) {
      ValueMetaInterface rowNumMeta = new ValueMetaInteger( rowNumField );
      rowNumMeta.setLength( 10 );
      rowNumMeta.setOrigin( origin );
      rowMeta.addValueMeta( rowNumMeta );
    }
  } catch ( Exception e ) {
    throw new KettleStepException( e );
  }

}
 
Example 9
Source File: TableInputMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void getFields( RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep,
  VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  if ( databaseMeta == null ) {
    return; // TODO: throw an exception here
  }

  if ( cachedRowMetaActive ) {
    row.addRowMeta( cachedRowMeta );
    return;
  }

  boolean param = false;

  Database db = getDatabase();
  super.databases = new Database[] { db }; // keep track of it for canceling purposes...

  // First try without connecting to the database... (can be S L O W)
  String sNewSQL = sql;
  if ( isVariableReplacementActive() ) {
    sNewSQL = db.environmentSubstitute( sql );
    if ( space != null ) {
      sNewSQL = space.environmentSubstitute( sNewSQL );
    }
  }

  RowMetaInterface add = null;
  try {
    add = db.getQueryFields( sNewSQL, param );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleStepException( "Unable to get queryfields for SQL: " + Const.CR + sNewSQL, dbe );
  }

  if ( add != null ) {
    attachOrigin( add, origin );
    row.addRowMeta( add );
  } else {
    try {
      db.connect();

      RowMetaInterface paramRowMeta = null;
      Object[] paramData = null;

      StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );
      if ( !Utils.isEmpty( infoStream.getStepname() ) ) {
        param = true;
        if ( info.length > 0 && info[ 0 ] != null ) {
          paramRowMeta = info[ 0 ];
          paramData = RowDataUtil.allocateRowData( paramRowMeta.size() );
        }
      }

      add = db.getQueryFields( sNewSQL, param, paramRowMeta, paramData );

      if ( add == null ) {
        return;
      }
      attachOrigin( add, origin );
      row.addRowMeta( add );
    } catch ( KettleException ke ) {
      throw new KettleStepException( "Unable to get queryfields for SQL: " + Const.CR + sNewSQL, ke );
    } finally {
      db.disconnect();
    }
  }
  if ( isLazyConversionActive() ) {
    for ( int i = 0; i < row.size(); i++ ) {
      ValueMetaInterface v = row.getValueMeta( i );
      try {
        if ( v.getType() == ValueMetaInterface.TYPE_STRING ) {
          ValueMetaInterface storageMeta = ValueMetaFactory.cloneValueMeta( v );
          storageMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
          v.setStorageMetadata( storageMeta );
          v.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
        }
      } catch ( KettlePluginException e ) {
        throw new KettleStepException( "Unable to clone meta for lazy conversion: " + Const.CR + v, e );
      }
    }
  }
}
 
Example 10
Source File: CsvInputMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
  VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  try {
    rowMeta.clear(); // Start with a clean slate, eats the input

    for ( int i = 0; i < inputFields.length; i++ ) {
      TextFileInputField field = inputFields[i];

      ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( field.getName(), field.getType() );
      valueMeta.setConversionMask( field.getFormat() );
      valueMeta.setLength( field.getLength() );
      valueMeta.setPrecision( field.getPrecision() );
      valueMeta.setConversionMask( field.getFormat() );
      valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
      valueMeta.setGroupingSymbol( field.getGroupSymbol() );
      valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
      valueMeta.setTrimType( field.getTrimType() );
      if ( lazyConversionActive ) {
        valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
      }
      valueMeta.setStringEncoding( space.environmentSubstitute( encoding ) );

      // In case we want to convert Strings...
      // Using a copy of the valueMeta object means that the inner and outer representation format is the same.
      // Preview will show the data the same way as we read it.
      // This layout is then taken further down the road by the metadata through the transformation.
      //
      ValueMetaInterface storageMetadata =
        ValueMetaFactory.cloneValueMeta( valueMeta, ValueMetaInterface.TYPE_STRING );
      storageMetadata.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
      storageMetadata.setLength( -1, -1 ); // we don't really know the lengths of the strings read in advance.
      valueMeta.setStorageMetadata( storageMetadata );

      valueMeta.setOrigin( origin );

      rowMeta.addValueMeta( valueMeta );
    }

    if ( !Utils.isEmpty( filenameField ) && includingFilename ) {
      ValueMetaInterface filenameMeta = new ValueMetaString( filenameField );
      filenameMeta.setOrigin( origin );
      if ( lazyConversionActive ) {
        filenameMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
        filenameMeta.setStorageMetadata( new ValueMetaString( filenameField ) );
      }
      rowMeta.addValueMeta( filenameMeta );
    }

    if ( !Utils.isEmpty( rowNumField ) ) {
      ValueMetaInterface rowNumMeta = new ValueMetaInteger( rowNumField );
      rowNumMeta.setLength( 10 );
      rowNumMeta.setOrigin( origin );
      rowMeta.addValueMeta( rowNumMeta );
    }
  } catch ( Exception e ) {
    throw new KettleStepException( e );
  }

}
 
Example 11
Source File: FuzzyMatchTest.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Test
public void testReadLookupValues() throws Exception {
  FuzzyMatchData data = spy( new FuzzyMatchData() );
  data.indexOfCachedFields = new int[2];
  data.minimalDistance = 0;
  data.maximalDistance = 5;
  FuzzyMatchMeta meta = spy( new FuzzyMatchMeta() );
  meta.setOutputMatchField( "I don't want NPE here!" );
  data.readLookupValues = true;
  fuzzyMatch =
      new FuzzyMatchHandler( mockHelper.stepMeta, mockHelper.stepDataInterface, 0, mockHelper.transMeta,
          mockHelper.trans );

  fuzzyMatch.init( meta, data );
  RowSet lookupRowSet = mockHelper.getMockInputRowSet( binaryLookupRows );
  fuzzyMatch.addRowSetToInputRowSets( mockHelper.getMockInputRowSet( binaryRows ) );
  fuzzyMatch.addRowSetToInputRowSets( lookupRowSet );
  fuzzyMatch.rowset = lookupRowSet;

  RowMetaInterface rowMetaInterface = new RowMeta();
  ValueMetaInterface valueMeta = new ValueMetaString( "field1" );
  valueMeta.setStorageMetadata( new ValueMetaString( "field1" ) );
  valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
  rowMetaInterface.addValueMeta( valueMeta );
  when( lookupRowSet.getRowMeta() ).thenReturn( rowMetaInterface );
  when( meta.getLookupField() ).thenReturn( "field1" );
  when( meta.getMainStreamField() ).thenReturn( "field1" );
  fuzzyMatch.setInputRowMeta( rowMetaInterface.clone() );

  when( meta.getAlgorithmType() ).thenReturn( 1 );
  StepIOMetaInterface stepIOMetaInterface = mock( StepIOMetaInterface.class );
  when( meta.getStepIOMeta() ).thenReturn( stepIOMetaInterface );
  StreamInterface streamInterface = mock( StreamInterface.class );
  List<StreamInterface> streamInterfaceList = new ArrayList<StreamInterface>();
  streamInterfaceList.add( streamInterface );
  when( streamInterface.getStepMeta() ).thenReturn( mockHelper.stepMeta );

  when( stepIOMetaInterface.getInfoStreams() ).thenReturn( streamInterfaceList );

  fuzzyMatch.processRow( meta, data );
  Assert.assertEquals( rowMetaInterface.getString( row3B, 0 ),
      data.outputRowMeta.getString( fuzzyMatch.resultRow, 1 ) );
}
 
Example 12
Source File: S3CsvInputMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  rowMeta.clear(); // Start with a clean slate, eats the input

  for ( int i = 0; i < inputFields.length; i++ ) {
    TextFileInputField field = inputFields[i];

    ValueMetaInterface valueMeta = new ValueMeta( field.getName(), field.getType() );
    valueMeta.setConversionMask( field.getFormat() );
    valueMeta.setLength( field.getLength() );
    valueMeta.setPrecision( field.getPrecision() );
    valueMeta.setConversionMask( field.getFormat() );
    valueMeta.setDecimalSymbol( field.getDecimalSymbol() );
    valueMeta.setGroupingSymbol( field.getGroupSymbol() );
    valueMeta.setCurrencySymbol( field.getCurrencySymbol() );
    valueMeta.setTrimType( field.getTrimType() );
    if ( lazyConversionActive ) {
      valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
    }

    // In case we want to convert Strings...
    // Using a copy of the valueMeta object means that the inner and outer representation format is the same.
    // Preview will show the data the same way as we read it.
    // This layout is then taken further down the road by the metadata through the transformation.
    //
    ValueMetaInterface storageMetadata = valueMeta.clone();
    storageMetadata.setType( ValueMetaInterface.TYPE_STRING );
    storageMetadata.setStorageType( ValueMetaInterface.STORAGE_TYPE_NORMAL );
    storageMetadata.setLength( -1, -1 ); // we don't really know the lengths of the strings read in advance.
    valueMeta.setStorageMetadata( storageMetadata );

    valueMeta.setOrigin( origin );

    rowMeta.addValueMeta( valueMeta );
  }

  if ( !Utils.isEmpty( filenameField ) && includingFilename ) {
    ValueMetaInterface filenameMeta = new ValueMetaString( filenameField );
    filenameMeta.setOrigin( origin );
    if ( lazyConversionActive ) {
      filenameMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_BINARY_STRING );
      filenameMeta.setStorageMetadata( new ValueMetaString( filenameField ) );
    }
    rowMeta.addValueMeta( filenameMeta );
  }

  if ( !Utils.isEmpty( rowNumField ) ) {
    ValueMetaInterface rowNumMeta = new ValueMetaInteger( rowNumField );
    rowNumMeta.setLength( 10 );
    rowNumMeta.setOrigin( origin );
    rowMeta.addValueMeta( rowNumMeta );
  }
}