public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { // Set the sorted properties: ascending/descending for ( int i = 0; i < fieldName.length; i++ ) { int idx = inputRowMeta.indexOfValue( fieldName[i] ); if ( idx >= 0 ) { ValueMetaInterface valueMeta = inputRowMeta.getValueMeta( idx ); valueMeta.setSortedDescending( !ascending[i] ); // TODO: add case insensivity } } }
public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException { // Clear the sortedDescending flag on fields used within the condition - otherwise the comparisons will be // inverted!! String[] conditionField = condition.getUsedFields(); for ( int i = 0; i < conditionField.length; i++ ) { int idx = rowMeta.indexOfValue( conditionField[i] ); if ( idx >= 0 ) { ValueMetaInterface valueMeta = rowMeta.getValueMeta( idx ); valueMeta.setSortedDescending( false ); } } }
@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 ); } } }
data.rowMeta.getValueMeta( data.fieldIndices[f] ).setSortedDescending( !meta.getAscending()[f] );
valueMeta.setSortedDescending( sortingDescending );