format/src/main/java/com/github/sadikovi/riff/Converters.java
/**
   * Select value converter for Spark SQL type. Throws exception if type is not supported.
   */
Select value converter for Spark SQL type. Throws exception if type is not supported.
Select value converter for Spark SQL type . Throws exception if type is not supported .
public static RowValueConverter sqlTypeToConverter(DataType dataType) {
    if (dataType instanceof IntegerType) {
      return new IndexedRowIntConverter();
    } else if (dataType instanceof LongType) {
      return new IndexedRowLongConverter();
    } else if (dataType instanceof StringType) {
      return new IndexedRowUTF8Converter();
    } else if (dataType instanceof DateType) {
      return new IndexedRowIntConverter();
    } else if (dataType instanceof TimestampType) {
      return new IndexedRowLongConverter();
    } else if (dataType instanceof BooleanType) {
      return new IndexedRowBooleanConverter();
    } else if (dataType instanceof ShortType) {
      return new IndexedRowShortConverter();
    } else if (dataType instanceof ByteType) {
      return new IndexedRowByteConverter();
    } else {
      throw new RuntimeException("No converter registered for type " + dataType);
    }
  }
public static RowValueConverter sqlTypeToConverter ( DataType dataType ) { if ( dataType instanceof IntegerType ) { return new IndexedRowIntConverter ( ) ; } else if ( dataType instanceof LongType ) { return new IndexedRowLongConverter ( ) ; } else if ( dataType instanceof StringType ) { return new IndexedRowUTF8Converter ( ) ; } else if ( dataType instanceof DateType ) { return new IndexedRowIntConverter ( ) ; } else if ( dataType instanceof TimestampType ) { return new IndexedRowLongConverter ( ) ; } else if ( dataType instanceof BooleanType ) { return new IndexedRowBooleanConverter ( ) ; } else if ( dataType instanceof ShortType ) { return new IndexedRowShortConverter ( ) ; } else if ( dataType instanceof ByteType ) { return new IndexedRowByteConverter ( ) ; } else { throw new RuntimeException ( "No converter registered for type " + dataType ) ; } }
Select value converter for Spark SQL type.
Select value converter for Spark SQL type .