Package org.apache.iceberg.spark
Class SparkDataFile
- java.lang.Object
-
- org.apache.iceberg.spark.SparkDataFile
-
- All Implemented Interfaces:
ContentFile<DataFile>,DataFile
public class SparkDataFile extends java.lang.Object implements DataFile
-
-
Field Summary
-
Fields inherited from interface org.apache.iceberg.DataFile
COLUMN_SIZES, CONTENT, FILE_FORMAT, FILE_PATH, FILE_SIZE, KEY_METADATA, LOWER_BOUNDS, NULL_VALUE_COUNTS, PARTITION_DOC, PARTITION_ID, PARTITION_NAME, RECORD_COUNT, SPLIT_OFFSETS, UPPER_BOUNDS, VALUE_COUNTS
-
-
Constructor Summary
Constructors Constructor Description SparkDataFile(Types.StructType type, org.apache.spark.sql.types.StructType sparkType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.Integer,java.lang.Long>columnSizes()DataFilecopy()Copies this file.DataFilecopyWithoutStats()Copies this file without file stats.longfileSizeInBytes()FileFormatformat()java.nio.ByteBufferkeyMetadata()java.util.Map<java.lang.Integer,java.nio.ByteBuffer>lowerBounds()java.util.Map<java.lang.Integer,java.lang.Long>nullValueCounts()StructLikepartition()java.lang.CharSequencepath()longrecordCount()java.util.List<java.lang.Long>splitOffsets()java.util.Map<java.lang.Integer,java.nio.ByteBuffer>upperBounds()java.util.Map<java.lang.Integer,java.lang.Long>valueCounts()SparkDataFilewrap(org.apache.spark.sql.Row row)
-
-
-
Constructor Detail
-
SparkDataFile
public SparkDataFile(Types.StructType type, org.apache.spark.sql.types.StructType sparkType)
-
-
Method Detail
-
wrap
public SparkDataFile wrap(org.apache.spark.sql.Row row)
-
path
public java.lang.CharSequence path()
- Specified by:
pathin interfaceContentFile<DataFile>- Returns:
- fully qualified path to the file, suitable for constructing a Hadoop Path
-
format
public FileFormat format()
- Specified by:
formatin interfaceContentFile<DataFile>- Returns:
- format of the file
-
partition
public StructLike partition()
- Specified by:
partitionin interfaceContentFile<DataFile>- Returns:
- partition for this file as a
StructLike
-
recordCount
public long recordCount()
- Specified by:
recordCountin interfaceContentFile<DataFile>- Returns:
- the number of top-level records in the file
-
fileSizeInBytes
public long fileSizeInBytes()
- Specified by:
fileSizeInBytesin interfaceContentFile<DataFile>- Returns:
- the file size in bytes
-
columnSizes
public java.util.Map<java.lang.Integer,java.lang.Long> columnSizes()
- Specified by:
columnSizesin interfaceContentFile<DataFile>- Returns:
- if collected, map from column ID to the size of the column in bytes, null otherwise
-
valueCounts
public java.util.Map<java.lang.Integer,java.lang.Long> valueCounts()
- Specified by:
valueCountsin interfaceContentFile<DataFile>- Returns:
- if collected, map from column ID to the count of its non-null values, null otherwise
-
nullValueCounts
public java.util.Map<java.lang.Integer,java.lang.Long> nullValueCounts()
- Specified by:
nullValueCountsin interfaceContentFile<DataFile>- Returns:
- if collected, map from column ID to its null value count, null otherwise
-
lowerBounds
public java.util.Map<java.lang.Integer,java.nio.ByteBuffer> lowerBounds()
- Specified by:
lowerBoundsin interfaceContentFile<DataFile>- Returns:
- if collected, map from column ID to value lower bounds, null otherwise
-
upperBounds
public java.util.Map<java.lang.Integer,java.nio.ByteBuffer> upperBounds()
- Specified by:
upperBoundsin interfaceContentFile<DataFile>- Returns:
- if collected, map from column ID to value upper bounds, null otherwise
-
keyMetadata
public java.nio.ByteBuffer keyMetadata()
- Specified by:
keyMetadatain interfaceContentFile<DataFile>- Returns:
- metadata about how this file is encrypted, or null if the file is stored in plain text.
-
copy
public DataFile copy()
Description copied from interface:ContentFileCopies this file. Manifest readers can reuse file instances; use this method to copy data when collecting files from tasks.- Specified by:
copyin interfaceContentFile<DataFile>- Returns:
- a copy of this data file
-
copyWithoutStats
public DataFile copyWithoutStats()
Description copied from interface:ContentFileCopies this file without file stats. Manifest readers can reuse file instances; use this method to copy data without stats when collecting files.- Specified by:
copyWithoutStatsin interfaceContentFile<DataFile>- Returns:
- a copy of this data file, without lower bounds, upper bounds, value counts, or null value counts
-
splitOffsets
public java.util.List<java.lang.Long> splitOffsets()
- Specified by:
splitOffsetsin interfaceContentFile<DataFile>- Returns:
- List of recommended split locations, if applicable, null otherwise. When available, this information is used for planning scan tasks whose boundaries are determined by these offsets. The returned list must be sorted in ascending order.
-
-