embulk-output-bigquery 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37643ccea137f84b59a056d75826b54c8548c0b6
4
- data.tar.gz: 1eafbf6ab69c81039c22712cda93ceb099ec9d92
3
+ metadata.gz: 418d0bed433bae894e7ca324919eeff6d1a40079
4
+ data.tar.gz: fcb3127b2e24413539ff4ef43c125b02f45fcd1e
5
5
  SHA512:
6
- metadata.gz: 3f8e1a7b70fb1a71060338b5aa2c4676a02ee56289fe5f0470fda09081ae2cec3b5c4fece89993beab298b43fb3769b3db8d28b485a4abacca40b57fdb6f3759
7
- data.tar.gz: d4b1aab992230a263642b6eb0cac08d1981d6cf54728ef76fec84da323888172ba6c6ed891f1cb7914f95dc9887ee21856d43e0fb044fa3c8e1aafd7cc8ab428
6
+ metadata.gz: 46a4f0af383a0d4eaf809c78914ddb608dbae76a0950568b768d8233713c3bddef2782a4e3dd39a35166770d236d719bf8b5019a3cb5e2a0d41a51f50a7b708d
7
+ data.tar.gz: 3d850afb378eb8b6668b8d592947be8cd8510517fdc2c2d89c0e159f941d11d11a23f1b472cc4828aa2e8a68c0e210e72b1e5528c67ead5b707bad3b583006af
data/README.md CHANGED
@@ -45,6 +45,7 @@ OAuth flow for installed applications.
45
45
  - **field_delimiter**: (string, optional, default is ",")
46
46
  - **max_bad_records**: (int, optional, default is 0)
47
47
  - **encoding**: (UTF-8 or ISO-8859-1) (string, optional, default is UTF-8)
48
+ - **ignore_unknown_values**: (boolean, optional, default is 0)
48
49
 
49
50
  ### Example
50
51
 
data/build.gradle CHANGED
@@ -15,7 +15,7 @@ configurations {
15
15
  sourceCompatibility = 1.7
16
16
  targetCompatibility = 1.7
17
17
 
18
- version = "0.1.4"
18
+ version = "0.1.5"
19
19
 
20
20
  dependencies {
21
21
  compile "org.embulk:embulk-core:0.5.1"
@@ -112,6 +112,10 @@ public class BigqueryOutputPlugin
112
112
  @Config("is_skip_job_result_check")
113
113
  @ConfigDefault("false")
114
114
  public boolean getIsSkipJobResultCheck();
115
+
116
+ @Config("ignore_unknown_values")
117
+ @ConfigDefault("false")
118
+ public boolean getIgnoreUnknownValues();
115
119
  }
116
120
 
117
121
  private final Logger log = Exec.getLogger(BigqueryOutputPlugin.class);
@@ -140,6 +144,7 @@ public class BigqueryOutputPlugin
140
144
  .setJobStatusMaxPollingTime(task.getJobStatusMaxPollingTime())
141
145
  .setJobStatusPollingInterval(task.getJobStatusPollingInterval())
142
146
  .setIsSkipJobResultCheck(task.getIsSkipJobResultCheck())
147
+ .setIgnoreUnknownValues(task.getIgnoreUnknownValues())
143
148
  .build();
144
149
  } catch (FileNotFoundException ex) {
145
150
  throw new ConfigException(ex);
@@ -56,6 +56,7 @@ public class BigqueryWriter
56
56
  private final long jobStatusMaxPollingTime;
57
57
  private final long jobStatusPollingInterval;
58
58
  private final boolean isSkipJobResultCheck;
59
+ private final boolean ignoreUnknownValues;
59
60
  private final Bigquery bigQueryClient;
60
61
 
61
62
  public BigqueryWriter(Builder builder) throws FileNotFoundException, IOException, GeneralSecurityException
@@ -73,6 +74,7 @@ public class BigqueryWriter
73
74
  this.jobStatusMaxPollingTime = builder.jobStatusMaxPollingTime;
74
75
  this.jobStatusPollingInterval = builder.jobStatusPollingInterval;
75
76
  this.isSkipJobResultCheck = builder.isSkipJobResultCheck;
77
+ this.ignoreUnknownValues = builder.ignoreUnknownValues;
76
78
 
77
79
  BigqueryAuthentication auth = new BigqueryAuthentication(builder.authMethod, builder.serviceAccountEmail, builder.p12KeyFilePath, builder.applicationName);
78
80
  this.bigQueryClient = auth.getBigqueryClient();
@@ -172,6 +174,7 @@ public class BigqueryWriter
172
174
  } else {
173
175
  loadConfig.setCreateDisposition("CREATE_NEVER");
174
176
  }
177
+ loadConfig.setIgnoreUnknownValues(ignoreUnknownValues);
175
178
 
176
179
  loadConfig.setDestinationTable(createTableReference());
177
180
 
@@ -348,6 +351,7 @@ public class BigqueryWriter
348
351
  private int jobStatusMaxPollingTime;
349
352
  private int jobStatusPollingInterval;
350
353
  private boolean isSkipJobResultCheck;
354
+ private boolean ignoreUnknownValues;
351
355
 
352
356
  public Builder(String authMethod)
353
357
  {
@@ -450,6 +454,12 @@ public class BigqueryWriter
450
454
  return this;
451
455
  }
452
456
 
457
+ public Builder setIgnoreUnknownValues(boolean ignoreUnknownValues)
458
+ {
459
+ this.ignoreUnknownValues = ignoreUnknownValues;
460
+ return this;
461
+ }
462
+
453
463
  public BigqueryWriter build() throws IOException, GeneralSecurityException
454
464
  {
455
465
  return new BigqueryWriter(this);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -62,7 +62,7 @@ files:
62
62
  - src/test/java/org/embulk/output/TestBigqueryWriter.java
63
63
  - classpath/commons-codec-1.3.jar
64
64
  - classpath/commons-logging-1.1.1.jar
65
- - classpath/embulk-output-bigquery-0.1.4.jar
65
+ - classpath/embulk-output-bigquery-0.1.5.jar
66
66
  - classpath/google-api-client-1.20.0.jar
67
67
  - classpath/google-api-services-bigquery-v2-rev205-1.20.0.jar
68
68
  - classpath/google-http-client-1.20.0.jar