public List<? extends IAvroInputField> getDefaultFields() throws Exception {
    ArrayList<AvroInputField> fields = new ArrayList<>();

    Schema avroSchema = readAvroSchema();
    for ( Schema.Field f : avroSchema.getFields() ) {
      AvroSpec.DataType actualAvroType = findActualDataType( f );
      AvroSpec.DataType supportedAvroType = null;
      if ( actualAvroType != null && isSupported( actualAvroType ) ) {
        supportedAvroType = actualAvroType;
      }

      if ( supportedAvroType == null ) {
        // Todo: log a message about skipping unsupported fields
        continue;
      }

      int pentahoType = 0;
      switch ( supportedAvroType ) {
        case DATE:
          pentahoType = ValueMetaInterface.TYPE_DATE;
          break;
        case DOUBLE:
          pentahoType = ValueMetaInterface.TYPE_NUMBER;
          break;
        case FLOAT:
          pentahoType = ValueMetaInterface.TYPE_NUMBER;
          break;
        case LONG:
          pentahoType = ValueMetaInterface.TYPE_INTEGER;
          break;
        case BOOLEAN:
          pentahoType = ValueMetaInterface.TYPE_BOOLEAN;
          break;
        case INTEGER:
          pentahoType = ValueMetaInterface.TYPE_INTEGER;
          break;
        case STRING:
          pentahoType = ValueMetaInterface.TYPE_STRING;
          break;
        case BYTES:
          pentahoType = ValueMetaInterface.TYPE_BINARY;
          break;
        case DECIMAL:
          pentahoType = ValueMetaInterface.TYPE_BIGNUMBER;
          break;
        case TIMESTAMP_MILLIS:
          pentahoType = ValueMetaInterface.TYPE_TIMESTAMP;
          break;
      }

      // If this is a Pentaho 8 Avro field name, use the ValueMetaInterface type encoded in the Avro field name instead
      FieldName fieldName = parseFieldName( f.name() );
      if ( fieldName != null ) {
        pentahoType = fieldName.type;
      }

      AvroInputField avroInputField = new AvroInputField();
      avroInputField.setFormatFieldName( f.name() );
      avroInputField.setPentahoFieldName( avroInputField.getDisplayableAvroFieldName() );
      avroInputField.setFormatFieldName( f.name() );
      avroInputField.setPentahoType( pentahoType );
      avroInputField.setAvroType( actualAvroType );
      fields.add( avroInputField );
    }

    return fields;
  }
@Test
  public void testGetDefaultFields() throws Exception {
    PentahoAvroInputFormat format = Mockito.spy( new PentahoAvroInputFormat( ) );
    Schema.Parser parser = new Schema.Parser();
    Schema schema = parser.parse( new File( getFilePath( TYPES_SCHEMA_AVRO ) ) );
    doReturn( schema ).when( format ).readAvroSchema();

    List<? extends IAvroInputField> defaultFields = format.getDefaultFields();

    List<String> expectedFields = Arrays.asList(
      "boolean_field", "int_field", "long_field", "float_field",
      "double_field", "bytes_field", "string_field", "union_string_field",
      "decimal_bytes_field", "decimal_fixed_field", "date_field", "timestamp_millis_field",
      "address", "zip_code", "double", "date", "time", "active", "cost"
    );
    List<String> actualFields =
      defaultFields.stream().map( IAvroInputField::getAvroFieldName ).collect( Collectors.toList() );
    assertEquals( 19, defaultFields.size() );
    assertTrue( expectedFields.equals( actualFields ) );
  }