@Test( expected = KettleException.class ) public void testConvertToKettleValuesPartsMapMalformed() throws KettleException { AvroInputMeta.AvroField avroField = new AvroInputMeta.AvroField(); avroField.m_fieldName = "a"; avroField.m_fieldPath = "c.b.a"; avroField.init( 0 ); RowMeta rowMeta = new RowMeta(); ValueMetaInterface valueMeta = new ValueMetaString(); valueMeta.setName( avroField.m_fieldName ); avroField.m_kettleType = valueMeta.getTypeDesc(); rowMeta.addValueMeta( valueMeta ); AvroInputData.AvroArrayExpansion avroArrayExpansion = new AvroInputData.AvroArrayExpansion( Arrays.asList( avroField ) ); avroArrayExpansion.m_outputRowMeta = rowMeta; avroArrayExpansion.m_expansionPath = "c"; avroArrayExpansion.init(); assertNull( avroArrayExpansion .convertToKettleValues( new HashMap<Utf8, Object>(), null, null, null, true ) ); }
protected void init() throws KettleException { if ( m_schemaToUse != null ) { initTopLevelStructure( m_schemaToUse, true ); if ( m_normalFields == null || m_normalFields.size() == 0 ) { m_normalFields = getLeafFields( m_schemaToUse ); } } if ( m_normalFields == null || m_normalFields.size() == 0 ) { throw new KettleException( BaseMessages.getString( AvroInputMeta.PKG, "AvroInput.Error.NoFieldPathsDefined" ) ); } m_expansionHandler = checkFieldPaths( m_normalFields, m_outputRowMeta ); for ( AvroInputMeta.AvroField f : m_normalFields ) { int outputIndex = m_outputRowMeta.indexOfValue( f.m_fieldName ); f.init( outputIndex ); } if ( m_expansionHandler != null ) { m_expansionHandler.init(); } }
AvroInputData extends BaseStepData implements StepDataInterface { protected void init() throws KettleException { if ( m_schemaToUse != null ) { initTopLevelStructure( m_schemaToUse, true ); if ( m_normalFields == null || m_normalFields.size() == 0 ) { m_normalFields = getLeafFields( m_schemaToUse ); } } if ( m_normalFields == null || m_normalFields.size() == 0 ) { throw new KettleException( BaseMessages.getString( AvroInputMeta.PKG, "AvroInput.Error.NoFieldPathsDefined" ) ); } m_expansionHandler = checkFieldPaths( m_normalFields, m_outputRowMeta ); for ( AvroInputMeta.AvroField f : m_normalFields ) { int outputIndex = m_outputRowMeta.indexOfValue( f.m_fieldName ); f.init( outputIndex ); } if ( m_expansionHandler != null ) { m_expansionHandler.init(); } } }
AvroInputData extends BaseStepData implements StepDataInterface { protected void init() throws KettleException { if ( m_schemaToUse != null ) { initTopLevelStructure( m_schemaToUse, true ); if ( m_normalFields == null || m_normalFields.size() == 0 ) { m_normalFields = getLeafFields( m_schemaToUse ); } } if ( m_normalFields == null || m_normalFields.size() == 0 ) { throw new KettleException( BaseMessages.getString( AvroInputMeta.PKG, "AvroInput.Error.NoFieldPathsDefined" ) ); } m_expansionHandler = checkFieldPaths( m_normalFields, m_outputRowMeta ); for ( AvroInputMeta.AvroField f : m_normalFields ) { int outputIndex = m_outputRowMeta.indexOfValue( f.m_fieldName ); f.init( outputIndex ); } if ( m_expansionHandler != null ) { m_expansionHandler.init(); } }  }
AvroInputData extends BaseStepData implements StepDataInterface { protected void init() throws KettleException { if ( m_schemaToUse != null ) { initTopLevelStructure( m_schemaToUse, true ); if ( m_normalFields == null || m_normalFields.size() == 0 ) { m_normalFields = getLeafFields( m_schemaToUse ); } } if ( m_normalFields == null || m_normalFields.size() == 0 ) { throw new KettleException( BaseMessages.getString( AvroInputMeta.PKG, "AvroInput.Error.NoFieldPathsDefined" ) ); } m_expansionHandler = checkFieldPaths( m_normalFields, m_outputRowMeta ); for ( AvroInputMeta.AvroField f : m_normalFields ) { int outputIndex = m_outputRowMeta.indexOfValue( f.m_fieldName ); f.init( outputIndex ); } if ( m_expansionHandler != null ) { m_expansionHandler.init(); } }  static String cleansePath( String path ); RowMetaInterface getOutputRowMeta(); void setOutputRowMeta( RowMetaInterface rmi ); void initializeFromFieldDecoding( String fieldNameToDecode, String readerSchemaFile,
      List<AvroInputMeta.AvroField> fields, boolean jsonEncoded, int newFieldOffset, boolean schemaInField,
      String schemaFieldName, boolean schemaFieldIsPath, boolean cacheSchemas, boolean ignoreMissing,
      LogChannelInterface log ); void establishFileType( FileObject avroFile, String readerSchemaFile, List<AvroInputMeta.AvroField> fields,
      boolean jsonEncoded, int newFieldOffset, boolean ignoreMissing, LogChannelInterface log ); Object[][] avroObjectToKettle( Object[] incoming, VariableSpace space ); void close(); }
AvroInputData extends BaseStepData implements StepDataInterface { protected void init() throws KettleException { if ( m_schemaToUse != null ) { initTopLevelStructure( m_schemaToUse, true ); if ( m_normalFields == null || m_normalFields.size() == 0 ) { m_normalFields = getLeafFields( m_schemaToUse ); } } if ( m_normalFields == null || m_normalFields.size() == 0 ) { throw new KettleException( BaseMessages.getString( AvroInputMeta.PKG, "AvroInput.Error.NoFieldPathsDefined" ) ); } m_expansionHandler = checkFieldPaths( m_normalFields, m_outputRowMeta ); for ( AvroInputMeta.AvroField f : m_normalFields ) { int outputIndex = m_outputRowMeta.indexOfValue( f.m_fieldName ); f.init( outputIndex ); } if ( m_expansionHandler != null ) { m_expansionHandler.init(); } }  static String cleansePath( String path ); RowMetaInterface getOutputRowMeta(); void setOutputRowMeta( RowMetaInterface rmi ); void initializeFromFieldDecoding( String fieldNameToDecode, String readerSchemaFile,
      List<AvroInputMeta.AvroField> fields, boolean jsonEncoded, int newFieldOffset, boolean schemaInField,
      String schemaFieldName, boolean schemaFieldIsPath, boolean cacheSchemas, boolean ignoreMissing,
      LogChannelInterface log ); void establishFileType( FileObject avroFile, String readerSchemaFile, List<AvroInputMeta.AvroField> fields,
      boolean jsonEncoded, int newFieldOffset, boolean ignoreMissing, LogChannelInterface log ); Object[][] avroObjectToKettle( Object[] incoming, VariableSpace space ); void close();  }