Package smile.io
Class Avro
java.lang.Object
smile.io.Avro
Apache Avro is a data serialization system.
Avro provides rich data structures, a compact, fast, binary data format, a container file, to store persistent data, and remote procedure call (RPC).
Avro relies on schemas. When Avro data is stored in a file, its schema is stored with it. Avro schemas are defined with JSON.
-
Constructor Summary
ConstructorsConstructorDescriptionAvro(InputStream schema) Constructor.Constructor.Avro(org.apache.avro.Schema schema) Constructor. -
Method Summary
-
Constructor Details
-
Avro
public Avro(org.apache.avro.Schema schema) Constructor.- Parameters:
schema- the data schema.
-
Avro
Constructor.- Parameters:
schema- the input stream of schema.- Throws:
IOException- when fails to read the file.
-
Avro
Constructor.- Parameters:
schema- the path to Avro schema file.- Throws:
IOException- when fails to read the file.
-
-
Method Details
-
read
Reads an avro file.- Parameters:
path- the input file path.- Returns:
- the data frame.
- Throws:
IOException- when fails to read the file.
-
read
Reads an avro file.- Parameters:
path- the input file path.- Returns:
- the data frame.
- Throws:
IOException- when fails to read the file.URISyntaxException- when the file path syntax is wrong.
-
read
Reads a limited number of records from an avro file.- Parameters:
input- the input stream of data file.limit- the number of records to read.- Returns:
- the data frame.
- Throws:
IOException- when fails to read the file.
-