diff --git a/src/main/java/io/cdap/plugin/gcp/bigquery/action/BigQueryExecute.java b/src/main/java/io/cdap/plugin/gcp/bigquery/action/BigQueryExecute.java index 4be9c2208..1566fe4fb 100644 --- a/src/main/java/io/cdap/plugin/gcp/bigquery/action/BigQueryExecute.java +++ b/src/main/java/io/cdap/plugin/gcp/bigquery/action/BigQueryExecute.java @@ -58,9 +58,11 @@ import java.io.IOException; import java.time.Duration; +import java.util.Arrays; import java.util.Collections; import java.util.Map; import java.util.Set; +import java.util.stream.Collectors; import javax.annotation.Nullable; /** @@ -292,11 +294,8 @@ public static final class Config extends AbstractBigQueryActionConfig { // Sn = a * (1 - r^n) / (r - 1) public static final long DEFULT_MAX_RETRY_DURATION_SECONDS = 63L; public static final int DEFAULT_READ_TIMEOUT = 120; - public static final Set VALID_WRITE_PREFERENCES = ImmutableSet.of( - JobInfo.WriteDisposition.WRITE_EMPTY.name(), - JobInfo.WriteDisposition.WRITE_APPEND.name(), - JobInfo.WriteDisposition.WRITE_TRUNCATE.name() - ); + public static final Set VALID_WRITE_PREFERENCES = Arrays.stream(JobInfo.WriteDisposition.values()) + .map(Enum::name).collect(Collectors.toSet()); @Description("Dialect of the SQL command. The value must be 'legacy' or 'standard'. " + "If set to 'standard', the query will use BigQuery's standard SQL: " +