Skip to content

Commit 55048ca

Browse files
authored
feat: add ICEBERG format options (#2662)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary)
1 parent 5c10a48 commit 55048ca

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FormatOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class FormatOptions implements Serializable {
4343
static final String GOOGLE_SHEETS = "GOOGLE_SHEETS";
4444
static final String PARQUET = "PARQUET";
4545
static final String ORC = "ORC";
46+
static final String ICEBERG = "ICEBERG";
4647

4748
private static final long serialVersionUID = -443376052020423691L;
4849

@@ -115,6 +116,11 @@ public static FormatOptions orc() {
115116
return new FormatOptions(ORC);
116117
}
117118

119+
/** Default options for the Apache Iceberg table format. */
120+
public static FormatOptions iceberg() {
121+
return new FormatOptions(ICEBERG);
122+
}
123+
118124
/** Default options for the provided format. */
119125
public static FormatOptions of(String format) {
120126
checkArgument(!isNullOrEmpty(format), "Provided format is null or empty");
@@ -130,6 +136,8 @@ public static FormatOptions of(String format) {
130136
return bigtable();
131137
} else if (format.equals(PARQUET)) {
132138
return parquet();
139+
} else if (format.equals(ICEBERG)) {
140+
return iceberg();
133141
}
134142
return new FormatOptions(format);
135143
}

google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/FormatOptionsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public void testFactoryMethods() {
4141
assertEquals(FormatOptions.DATASTORE_BACKUP, FormatOptions.datastoreBackup().getType());
4242
assertEquals(FormatOptions.AVRO, FormatOptions.avro().getType());
4343
assertEquals(FormatOptions.GOOGLE_SHEETS, FormatOptions.googleSheets().getType());
44+
assertEquals(FormatOptions.ICEBERG, FormatOptions.iceberg().getType());
4445
}
4546

4647
@Test
@@ -53,5 +54,6 @@ public void testEquals() {
5354
assertEquals(
5455
FormatOptions.datastoreBackup().hashCode(), FormatOptions.datastoreBackup().hashCode());
5556
assertEquals(FormatOptions.googleSheets(), FormatOptions.googleSheets());
57+
assertEquals(FormatOptions.iceberg(), FormatOptions.iceberg());
5658
}
5759
}

0 commit comments

Comments
 (0)