public final class CsvSchema extends java.lang.Object implements TableSchema
| Constructor and Description |
|---|
CsvSchema(@NotNull java.util.ArrayList<FieldSchema> schema)
CsvReader uses AvroCSVReader to read records from
CSV. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.util.ArrayList<FieldSchema> |
getAlluxioSchema() |
org.apache.avro.Schema |
getReadSchema() |
org.apache.avro.Schema |
getWriteSchema() |
int |
hashCode() |
ParquetSchema |
toParquet() |
public CsvSchema(@NotNull
@NotNull java.util.ArrayList<FieldSchema> schema)
throws java.io.IOException
CsvReader uses AvroCSVReader to read records from
CSV. AvroCSVReader internally uses
RecordBuilder, which does not support BYTES, and some
logical types such as DECIMAL. So we use readSchema to let AvroCSVReader be able to read the
record, then when writing out the record, we interpret the record according to
writeSchema.
For example, if a column is of type DECIMAL, in readSchema, the type will be STRING,
but in writeSchema, it's logical type DECIMAL backed by BYTES.schema - the schema from Alluxio table masterjava.io.IOException - when failed to initialize schemapublic java.util.ArrayList<FieldSchema> getAlluxioSchema()
public org.apache.avro.Schema getReadSchema()
public org.apache.avro.Schema getWriteSchema()
public ParquetSchema toParquet()
toParquet in interface TableSchemapublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.ObjectCopyright © 2022. All Rights Reserved.