public class Avro
extends java.lang.Object
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 and Description |
|---|
Avro(java.io.InputStream schema)
Constructor.
|
Avro(java.nio.file.Path schema)
Constructor.
|
Avro(org.apache.avro.Schema schema)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
smile.data.DataFrame |
read(java.io.InputStream input,
int limit)
Reads a limited number of records from an avro file.
|
smile.data.DataFrame |
read(java.nio.file.Path path)
Reads an avro file.
|
smile.data.DataFrame |
read(java.lang.String path)
Reads an avro file.
|
public Avro(org.apache.avro.Schema schema)
public Avro(java.io.InputStream schema)
throws java.io.IOException
schema - the input stream of schema.java.io.IOExceptionpublic Avro(java.nio.file.Path schema)
throws java.io.IOException
schema - Avro schema file path.java.io.IOExceptionpublic smile.data.DataFrame read(java.nio.file.Path path)
throws java.io.IOException
path - an Apache Avro file path.java.io.IOExceptionpublic smile.data.DataFrame read(java.lang.String path)
throws java.io.IOException,
java.net.URISyntaxException
path - an Apache Avro file path or URI.java.io.IOExceptionjava.net.URISyntaxExceptionpublic smile.data.DataFrame read(java.io.InputStream input,
int limit)
throws java.io.IOException
input - an Apache Avro file input stream.limit - reads a limited number of records.java.io.IOException