Skip to content

Commit c294f54

Browse files
committed
Docs: add DataFile helper snippet
1 parent 380cbde commit c294f54

20 files changed

+243
-0
lines changed

bug-bash-wap/QUICKSTART.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,21 @@ import liopenhouse.relocated.org.apache.iceberg.types.Types
131131
```
132132
Use `TableIdentifier.of("u_openhouse", tableName)` (instead of `Identifier.of`) whenever you load tables via the catalog.
133133

134+
### Build a DataFile (Iceberg helper snippet)
135+
```scala
136+
import org.apache.iceberg.DataFile
137+
import org.apache.iceberg.DataFiles
138+
import org.apache.iceberg.FileFormat
139+
140+
val dataFile: DataFile =
141+
DataFiles.builder(table.spec())
142+
.withPath("/fake/path/data.parquet")
143+
.withFileSizeInBytes(1024)
144+
.withRecordCount(100)
145+
.withFormat(FileFormat.PARQUET)
146+
.build()
147+
```
148+
134149
### Commit Snapshot S1 to `main`
135150
Before branching, follow the same pattern that `apps/spark/src/test/java/com/linkedin/openhouse/catalog/e2e/WapIdJavaTest.java` uses to create the first committed snapshot on `main`:
136151
```scala

bug-bash-wap/create-test-files.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
141141
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
142142
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
143143
import liopenhouse.relocated.org.apache.iceberg.types.Types
144+
import org.apache.iceberg.DataFile
145+
import org.apache.iceberg.DataFiles
146+
import org.apache.iceberg.FileFormat
147+
148+
// Build a DataFile for commits
149+
val dataFile: DataFile =
150+
DataFiles.builder(table.spec())
151+
.withPath("/fake/path/data.parquet")
152+
.withFileSizeInBytes(1024)
153+
.withRecordCount(100)
154+
.withFormat(FileFormat.PARQUET)
155+
.build()
144156
145157
// Setup
146158
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-08-rohit.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-09-selena.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-1-abhishek.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-10-shanthoosh.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-11-simbarashe.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-12-aastha.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-13-jiefan.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

bug-bash-wap/results/java-14-zhe.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import liopenhouse.relocated.org.apache.iceberg.SnapshotRef
1515
import liopenhouse.relocated.org.apache.iceberg.TableMetadata
1616
import liopenhouse.relocated.org.apache.iceberg.catalog.TableIdentifier
1717
import liopenhouse.relocated.org.apache.iceberg.types.Types
18+
import org.apache.iceberg.DataFile
19+
import org.apache.iceberg.DataFiles
20+
import org.apache.iceberg.FileFormat
21+
22+
// Build a DataFile for commits
23+
val dataFile: DataFile =
24+
DataFiles.builder(table.spec())
25+
.withPath("/fake/path/data.parquet")
26+
.withFileSizeInBytes(1024)
27+
.withRecordCount(100)
28+
.withFormat(FileFormat.PARQUET)
29+
.build()
1830

1931
// Setup
2032
val timestamp = System.currentTimeMillis()

0 commit comments

Comments
 (0)