@Override public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space ) throws KettleStepException { rowMeta.clear(); // start afresh - eats the input if ( m_mapping != null ) { int kettleType; if ( m_mapping.getKeyType() == Mapping.KeyType.DATE || m_mapping.getKeyType() == Mapping.KeyType.UNSIGNED_DATE ) { kettleType = ValueMetaInterface.TYPE_DATE; } else if ( m_mapping.getKeyType() == Mapping.KeyType.STRING ) { kettleType = ValueMetaInterface.TYPE_STRING; } else if ( m_mapping.getKeyType() == Mapping.KeyType.BINARY ) { kettleType = ValueMetaInterface.TYPE_BINARY; } else { kettleType = ValueMetaInterface.TYPE_INTEGER; } ValueMetaInterface keyMeta = new ValueMeta( m_mapping.getKeyName(), kettleType ); keyMeta.setOrigin( origin ); rowMeta.addValueMeta( keyMeta ); // Add the rest of the fields in the mapping Map<String, HBaseValueMetaInterface> mappedColumnsByAlias = m_mapping.getMappedColumns(); Set<String> aliasSet = mappedColumnsByAlias.keySet(); for ( String alias : aliasSet ) { HBaseValueMetaInterface columnMeta = mappedColumnsByAlias.get( alias ); columnMeta.setOrigin( origin ); rowMeta.addValueMeta( columnMeta ); } } }
if ( m_cachedMapping.getKeyType() == Mapping.KeyType.DATE || m_cachedMapping.getKeyType() == Mapping.KeyType.UNSIGNED_DATE ) { kettleType = ValueMetaInterface.TYPE_DATE; } else if ( m_cachedMapping.getKeyType() == Mapping.KeyType.STRING ) { kettleType = ValueMetaInterface.TYPE_STRING; } else if ( m_cachedMapping.getKeyType() == Mapping.KeyType.BINARY ) { kettleType = ValueMetaInterface.TYPE_BINARY; } else {
byte[] keyUpperBound = null; org.pentaho.hbase.shim.api.Mapping.KeyType keyType = org.pentaho.hbase.shim.api.Mapping.KeyType.valueOf( tableMapping.getKeyType().name() ); String convM = dateOrNumberConversionMaskForKey; if ( tableMapping.getKeyType() == Mapping.KeyType.BINARY ) { } else if ( tableMapping.getKeyType() != Mapping.KeyType.STRING ) { if ( tableMapping.getKeyType() == Mapping.KeyType.DATE || tableMapping.getKeyType() == Mapping.KeyType.UNSIGNED_DATE ) { SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern( convM ); convM = dateOrNumberConversionMaskForKey; if ( tableMapping.getKeyType() == Mapping.KeyType.BINARY ) { } else if ( tableMapping.getKeyType() != Mapping.KeyType.STRING ) { if ( tableMapping.getKeyType() == Mapping.KeyType.DATE || tableMapping.getKeyType() == Mapping.KeyType.UNSIGNED_DATE ) { SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern( convM );
byte[] encodedKey = bu.encodeKeyValue( kettleRow[keyIndex], keyvm, tableMapping.getKeyType() );
Map<String, HBaseValueMetaInterface> mapping = theMapping.getMappedColumns(); String keyName = theMapping.getKeyName(); Mapping.KeyType keyType = theMapping.getKeyType(); boolean isTupleMapping = theMapping.isTupleMapping(); String tupleFamilies = theMapping.getTupleFamilies();
try { theMapping.setKeyTypeAsString( type ); vm.setType( HBaseInput.getKettleTypeByKeyType( theMapping.getKeyType() ) ); if ( includeKeyToColumns ) { theMapping.addMappedColumn( vm, isTupleMapping );
m_keyType = current.getKeyType(); m_keyInfo.setText( "HBase Key: " + m_keyName + " (" + m_keyType.toString() + ")" ); item.setText( 2, "Y" ); item.setText( 7, "N" ); if ( current.getKeyType() == Mapping.KeyType.DATE || current.getKeyType() == Mapping.KeyType.UNSIGNED_DATE ) { item.setText( 5, ValueMeta.getTypeDesc( ValueMetaInterface.TYPE_DATE ) ); } else if ( current.getKeyType() == Mapping.KeyType.STRING ) { item.setText( 5, ValueMeta.getTypeDesc( ValueMetaInterface.TYPE_STRING ) ); } else if ( current.getKeyType() == Mapping.KeyType.INTEGER || current.getKeyType() == Mapping.KeyType.UNSIGNED_INTEGER || current.getKeyType() == Mapping.KeyType.UNSIGNED_LONG || current.getKeyType() == Mapping.KeyType.LONG ) { item.setText( 5, ValueMeta.getTypeDesc( ValueMetaInterface.TYPE_INTEGER ) ); } else {
keyType = tupleMapping.getKeyType();
if ( mapping.getKeyType() != null && !Utils.isEmpty( mapping.getKeyType().toString() ) ) { keyItem.setText( 5, mapping.getKeyType().toString() );
byte[] encodedKeyBytes = m_bytesUtil.encodeKeyValue( r[m_incomingKeyIndex], m_incomingKeyValueMeta, m_tableMapping.getKeyType() ); HBaseDelete hBaseDelete = targetTableWriteOperationManager.createDelete( encodedKeyBytes ); hBaseDelete.execute();
getKettleTypeByKeyType( m_tableMapping.getKeyType() ), -1, -1 ); vm2.setKey( true ); try {
try { theMapping.setKeyTypeAsString( type ); valueMeta.setType( HBaseInput.getKettleTypeByKeyType( theMapping.getKeyType() ) ); } catch ( Exception ex ) {