public class ManifestReader extends CloseableGroup implements Filterable<FilteredManifest>
Readers are created using the builder from read(InputFile, Function).
CloseableIterable.ConcatCloseableIterable<E>| Modifier and Type | Method and Description |
|---|---|
java.util.List<org.apache.iceberg.ManifestEntry> |
addedFiles() |
FilteredManifest |
caseSensitive(boolean caseSensitive)
Sets case sensitivity.
|
java.util.List<org.apache.iceberg.ManifestEntry> |
deletedFiles() |
InputFile |
file() |
FilteredManifest |
filterPartitions(Expression expr)
Adds a filter expression on partition data for matching files.
|
FilteredManifest |
filterRows(Expression expr)
Adds a filter expression on data rows for matching files.
|
java.util.Iterator<DataFile> |
iterator() |
FilteredManifest |
project(Schema fileProjection)
Set the projection from a schema.
|
static ManifestReader |
read(InputFile file)
Returns a new
ManifestReader for an InputFile. |
static ManifestReader |
read(InputFile file,
java.util.function.Function<java.lang.Integer,PartitionSpec> specLookup)
Returns a new
ManifestReader for an InputFile. |
Schema |
schema() |
FilteredManifest |
select(java.util.Collection<java.lang.String> columns)
Selects the columns of a file manifest to read.
|
PartitionSpec |
spec() |
addCloseable, closeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcaseInsensitive, caseSensitive, selectcombine, concat, empty, filter, transform, withNoopClose, withNoopClosepublic static ManifestReader read(InputFile file)
ManifestReader for an InputFile.
Note: Most callers should use read(InputFile, Function) to ensure that the
schema used by filters is the latest table schema. This should be used only when reading a
manifest without filters.
file - an InputFilepublic static ManifestReader read(InputFile file, java.util.function.Function<java.lang.Integer,PartitionSpec> specLookup)
ManifestReader for an InputFile.file - an InputFilespecLookup - a function to look up the manifest's partition spec by IDpublic InputFile file()
public Schema schema()
public PartitionSpec spec()
public FilteredManifest select(java.util.Collection<java.lang.String> columns)
FilterableIf columns are set multiple times, the last set of columns will be read.
If the Filterable object has partition filters, they will be added to the returned partial.
For a list of column names, see the table format specification.
select in interface Filterable<FilteredManifest>columns - String column names to load from the manifest filepublic FilteredManifest project(Schema fileProjection)
Filterableproject in interface Filterable<FilteredManifest>fileProjection - a projection of the DataFile schemapublic FilteredManifest filterPartitions(Expression expr)
FilterableIf the Filterable object already has partition filters, the new filter will be added as an additional requirement. The result filter expression will be the result of expr and any existing filters.
If the Filterable object has columns selected, they will be added to the returned partial.
filterPartitions in interface Filterable<FilteredManifest>expr - An expression for filtering this Filterable using partition datapublic FilteredManifest filterRows(Expression expr)
FilterableExpressions passed to this function will be converted to partition expressions before they are used to filter data files.
If the Filterable object already has partition filters, the new filter will be added as an additional requirement. The result filter expression will be the result of expr and any existing filters.
If the Filterable object has columns selected, they will be added to the returned partial.
filterRows in interface Filterable<FilteredManifest>expr - An expression for filtering this Filterable using row datapublic FilteredManifest caseSensitive(boolean caseSensitive)
FilterablecaseSensitive in interface Filterable<FilteredManifest>caseSensitive - true if expression binding and schema projection should be case sensitivepublic java.util.List<org.apache.iceberg.ManifestEntry> addedFiles()
public java.util.List<org.apache.iceberg.ManifestEntry> deletedFiles()