src/main/java/org/embulk/output/BigqueryWriter.java in embulk-output-bigquery-0.1.6 vs src/main/java/org/embulk/output/BigqueryWriter.java in embulk-output-bigquery-0.1.7
- old
+ new
@@ -55,10 +55,11 @@
private final boolean preventDuplicateInsert;
private final long jobStatusMaxPollingTime;
private final long jobStatusPollingInterval;
private final boolean isSkipJobResultCheck;
private final boolean ignoreUnknownValues;
+ private final boolean allowQuotedNewlines;
private final Bigquery bigQueryClient;
public BigqueryWriter(Builder builder) throws FileNotFoundException, IOException, GeneralSecurityException
{
this.project = builder.project;
@@ -73,10 +74,11 @@
this.preventDuplicateInsert = builder.preventDuplicateInsert;
this.jobStatusMaxPollingTime = builder.jobStatusMaxPollingTime;
this.jobStatusPollingInterval = builder.jobStatusPollingInterval;
this.isSkipJobResultCheck = builder.isSkipJobResultCheck;
this.ignoreUnknownValues = builder.ignoreUnknownValues;
+ this.allowQuotedNewlines = builder.allowQuotedNewlines;
BigqueryAuthentication auth = new BigqueryAuthentication(builder.authMethod, builder.serviceAccountEmail, builder.p12KeyFilePath, builder.applicationName);
this.bigQueryClient = auth.getBigqueryClient();
checkConfig();
@@ -156,11 +158,11 @@
String jobId = createJobId(localFilePath);
jobRef.setJobId(jobId);
job.setJobReference(jobRef);
}
- loadConfig.setAllowQuotedNewlines(false);
+ loadConfig.setAllowQuotedNewlines(allowQuotedNewlines);
loadConfig.setEncoding(encoding);
loadConfig.setMaxBadRecords(maxBadrecords);
if (sourceFormat.equals("NEWLINE_DELIMITED_JSON")) {
loadConfig.setSourceFormat("NEWLINE_DELIMITED_JSON");
} else {
@@ -351,10 +353,11 @@
private boolean preventDuplicateInsert;
private int jobStatusMaxPollingTime;
private int jobStatusPollingInterval;
private boolean isSkipJobResultCheck;
private boolean ignoreUnknownValues;
+ private boolean allowQuotedNewlines;
public Builder(String authMethod)
{
this.authMethod = authMethod;
}
@@ -456,9 +459,15 @@
}
public Builder setIgnoreUnknownValues(boolean ignoreUnknownValues)
{
this.ignoreUnknownValues = ignoreUnknownValues;
+ return this;
+ }
+
+ public Builder setAllowQuotedNewlines(boolean allowQuotedNewlines)
+ {
+ this.allowQuotedNewlines = allowQuotedNewlines;
return this;
}
public BigqueryWriter build() throws IOException, GeneralSecurityException
{
\ No newline at end of file