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

The following examples show how to use org.pentaho.di.core.row.ValueMetaInterface#setCollatorDisabled() . 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: 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 2
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() );
}