Skip to content

Instantly share code, notes, and snippets.

@prodeezy
Last active September 30, 2019 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prodeezy/459422d1b7d388a0d225292a62817b19 to your computer and use it in GitHub Desktop.
Save prodeezy/459422d1b7d388a0d225292a62817b19 to your computer and use it in GitHub Desktop.
Timestamp Day Transform Partition Read Example
import org.apache.iceberg.types.Types.NestedField._
import org.apache.iceberg.types._
import org.apache.iceberg._
val timestampSchema = new Schema(optional(1, "timestamp", Types.TimestampType.withoutZone()))
val partitionByDate = PartitionSpec.builderFor(timestampSchema).day("timestamp", "date").build
DataFiles.builder(partitionByDate).withPath("/path/to/data-1.parquet").withFileSizeInBytes(0).withRecordCount(0).withPartitionPath("date=2018-06-08").build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment