Java Code Examples for org.pentaho.di.core.row.value.ValueMetaFactory#getValueMetaName()

The following examples show how to use org.pentaho.di.core.row.value.ValueMetaFactory#getValueMetaName() . 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: DataGrid_EmptyStringVsNull_Test.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private void executeAndAssertResults( List<Object[]> expected ) throws Exception {
  final String stringType = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING );
  final String numberType = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_NUMBER );

  DataGridMeta meta = new DataGridMeta();
  meta.allocate( 5 );
  meta.setFieldName( new String[] { "string", "string-setEmpty", "string-NullIf", "string-setEmptyAndNullIf", "number" } );
  meta.setFieldType( new String[] { stringType, stringType, stringType, stringType, numberType } );
  meta.setEmptyString( new boolean[] { false, true, false, true, false } );
  meta.setFieldNullIf( new String[] { "", "", "-", "-", "" } );

  List<List<String>> dataRows = Arrays.asList(
    Arrays.asList( " ", " ", " ", " ", " " ),
    Arrays.asList( "", "", "", "", "" ),
    Arrays.asList( (String) null, null, null, null, null )
  );
  meta.setDataLines( dataRows );

  DataGridData data = new DataGridData();
  DataGrid step = createAndInitStep( meta, data );

  List<Object[]> actual = TransTestingUtil.execute( step, meta, data, 3, true );
  TransTestingUtil.assertResult( expected, actual );
}
 
Example 2
Source File: StepInjectionMetaEntry.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public String toString() {
  return "{"
    + key + ":" + ValueMetaFactory.getValueMetaName( valueType )
    + ( value == null ? "" : "(" + value.toString() + ")" )
    + "}";
}
 
Example 3
Source File: CarteIT.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public static Trans generateTestTransformation() {
  RowGeneratorMeta A = new RowGeneratorMeta();
  A.allocate( 3 );
  A.setRowLimit( "10000000" );

  A.getFieldName()[0] = "ID";
  A.getFieldType()[0] = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_INTEGER );
  A.getFieldLength()[0] = 7;
  A.getValue()[0] = "1234";

  A.getFieldName()[1] = "Name";
  A.getFieldType()[1] = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_STRING );
  A.getFieldLength()[1] = 35;
  A.getValue()[1] = "Some name";

  A.getFieldName()[2] = "Last updated";
  A.getFieldType()[2] = ValueMetaFactory.getValueMetaName( ValueMetaInterface.TYPE_DATE );
  A.getFieldFormat()[2] = "yyyy/MM/dd";
  A.getValue()[2] = "2010/02/09";

  TransMeta transMeta = TransPreviewFactory.generatePreviewTransformation( null, A, "A" );
  transMeta.setName( "CarteUnitTest" );
  transMeta.setSizeRowset( 2500 );
  transMeta.setFeedbackSize( 50000 );
  transMeta.setUsingThreadPriorityManagment( false );

  return new Trans( transMeta );
}
 
Example 4
Source File: DimensionLookupMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public static final String getUpdateType( boolean upd, int t ) {
  if ( !upd ) {
    return ValueMetaFactory.getValueMetaName( t );
  } else {
    return typeDesc[t];
  }
}
 
Example 5
Source File: TypeFieldDefinition.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public String getTypeDescription() {
  switch ( type ) {
    case ValueMetaInterface.TYPE_BOOLEAN:
      return "boolean";
    case ValueMetaInterface.TYPE_INTEGER:
      return "int";
    default:
      return ValueMetaFactory.getValueMetaName( type );
  }
}
 
Example 6
Source File: RssInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 7
Source File: FlattenerTargetField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
/**
 * @return The description of the target Value type
 */
public String getTargetTypeDesc() {
  return ValueMetaFactory.getValueMetaName( targetType );
}
 
Example 8
Source File: LDAPInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 9
Source File: ExcelWriterStepField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 10
Source File: ExcelField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 11
Source File: DenormaliserTargetField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
/**
 * @return The description of the target Value type
 */
public String getTargetTypeDesc() {
  return ValueMetaFactory.getValueMetaName( targetType );
}
 
Example 12
Source File: FixedFileImportWizardPage2.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void showInfo() {
  int idx = wFields.getSelectionIndex();
  if ( idx >= 0 ) {
    int position = 0;
    for ( int i = 0; i < idx; i++ ) {
      position += fields.get( i ).getWidth();
    }
    FixedFileInputField field = fields.get( idx );

    String name = field.getName();
    int width = field.getWidth();
    int length = field.getLength();
    String type = ValueMetaFactory.getValueMetaName( field.getType() );
    String format = field.getFormat();
    int precision = field.getPrecision();
    String currency = field.getCurrency();
    String decimal = field.getDecimal();
    String group = field.getGrouping();

    if ( name != null ) {
      wFieldname.setText( name );
    }
    wWidth.setText( "" + width );
    wLength.setText( "" + length );
    if ( type != null ) {
      wFieldtype.setText( type );
    }
    if ( format != null ) {
      wFormat.setText( format );
    }
    wPrecision.setText( "" + precision );
    if ( currency != null ) {
      wCurrency.setText( currency );
    }
    if ( decimal != null ) {
      wDecimal.setText( decimal );
    }
    if ( group != null ) {
      wGroup.setText( group );
    }

    // Clear the sample list...
    wSamples.removeAll();
    String[] samples = getRowSamples( position, width );
    for ( int i = 0; i < samples.length; i++ ) {
      wSamples.add( samples[i] );
    }
  }
}
 
Example 13
Source File: OrcInputField.java    From pentaho-hadoop-shims with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( getPentahoType() );
}
 
Example 14
Source File: AccessInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 15
Source File: LDIFInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 16
Source File: MetaInjectOutputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDescription() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 17
Source File: YamlInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 18
Source File: LoadFileInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 19
Source File: SalesforceInputField.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( type );
}
 
Example 20
Source File: ParquetInputField.java    From pentaho-hadoop-shims with Apache License 2.0 4 votes vote down vote up
public String getTypeDesc() {
  return ValueMetaFactory.getValueMetaName( getPentahoType() );
}