This is an automated email from the ASF dual-hosted git repository.

ijokarumawak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 639e81e  NIFI-6407 - added support for useAvroLogicalTypes in 
PutBigQueryBatch
639e81e is described below

commit 639e81e5a12f5fccb35a581e009eee5bcdb4bff6
Author: Pierre Villard <pierre.villard...@gmail.com>
AuthorDate: Fri Jul 19 14:20:27 2019 +0200

    NIFI-6407 - added support for useAvroLogicalTypes in PutBigQueryBatch
    
    fix Maven dep
    
    This closes #3592.
    
    Signed-off-by: Koji Kawamura <ijokaruma...@apache.org>
---
 .../nifi/processors/gcp/bigquery/BigQueryAttributes.java      |  5 +++++
 .../apache/nifi/processors/gcp/bigquery/PutBigQueryBatch.java | 11 +++++++++++
 .../nifi-gcp-bundle/nifi-gcp-services-api/pom.xml             |  2 +-
 nifi-nar-bundles/nifi-gcp-bundle/pom.xml                      |  2 +-
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/BigQueryAttributes.java
 
b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/BigQueryAttributes.java
index 842a176..81978eb 100644
--- 
a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/BigQueryAttributes.java
+++ 
b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/BigQueryAttributes.java
@@ -97,6 +97,11 @@ public class BigQueryAttributes {
             + "will skip when reading the data. The default value is 0. This 
property is useful if you have header rows in the "
             + "file that should be skipped.";
 
+    public static final String AVRO_USE_LOGICAL_TYPES_ATTR = 
"bq.avro.use.logical.types";
+    public static final String AVRO_USE_LOGICAL_TYPES_DESC = "If format is set 
to Avro and if this option is set to true, you "
+            + "can interpret logical types into their corresponding types 
(such as TIMESTAMP) instead of only using their raw "
+            + "types (such as INTEGER).";
+
 
 
     // Batch Attributes
diff --git 
a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQueryBatch.java
 
b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQueryBatch.java
index 5068ab5..5446c20 100644
--- 
a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQueryBatch.java
+++ 
b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-processors/src/main/java/org/apache/nifi/processors/gcp/bigquery/PutBigQueryBatch.java
@@ -214,6 +214,15 @@ public class PutBigQueryBatch extends 
AbstractBigQueryProcessor {
             
.expressionLanguageSupported(ExpressionLanguageScope.FLOWFILE_ATTRIBUTES)
             .build();
 
+    public static final PropertyDescriptor AVRO_USE_LOGICAL_TYPES = new 
PropertyDescriptor.Builder()
+            .name(BigQueryAttributes.AVRO_USE_LOGICAL_TYPES_ATTR)
+            .displayName("Avro Input - Use Logical Types")
+            .description(BigQueryAttributes.AVRO_USE_LOGICAL_TYPES_DESC)
+            .required(true)
+            .allowableValues("true", "false")
+            .defaultValue("false")
+            .build();
+
     @Override
     public List<PropertyDescriptor> getSupportedPropertyDescriptors() {
         return ImmutableList.<PropertyDescriptor>builder()
@@ -229,6 +238,7 @@ public class PutBigQueryBatch extends 
AbstractBigQueryProcessor {
                 .add(CSV_FIELD_DELIMITER)
                 .add(CSV_QUOTE)
                 .add(CSV_SKIP_LEADING_ROWS)
+                .add(AVRO_USE_LOGICAL_TYPES)
                 .build();
     }
 
@@ -280,6 +290,7 @@ public class PutBigQueryBatch extends 
AbstractBigQueryProcessor {
                     
.setCreateDisposition(JobInfo.CreateDisposition.valueOf(context.getProperty(CREATE_DISPOSITION).getValue()))
                     
.setWriteDisposition(JobInfo.WriteDisposition.valueOf(context.getProperty(WRITE_DISPOSITION).getValue()))
                     
.setIgnoreUnknownValues(context.getProperty(IGNORE_UNKNOWN).asBoolean())
+                    
.setUseAvroLogicalTypes(context.getProperty(AVRO_USE_LOGICAL_TYPES).asBoolean())
                     
.setMaxBadRecords(context.getProperty(MAXBAD_RECORDS).asInteger())
                     .setSchema(schema)
                     .setFormatOptions(formatOption)
diff --git a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-services-api/pom.xml 
b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-services-api/pom.xml
index 671474b..ea79c10 100644
--- a/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-services-api/pom.xml
+++ b/nifi-nar-bundles/nifi-gcp-bundle/nifi-gcp-services-api/pom.xml
@@ -33,7 +33,7 @@
         <dependency>
             <groupId>com.google.auth</groupId>
             <artifactId>google-auth-library-oauth2-http</artifactId>
-            <version>0.12.0</version>
+            <version>0.16.2</version>
             <exclusions>
                 <exclusion>
                     <groupId>com.google.code.findbugs</groupId>
diff --git a/nifi-nar-bundles/nifi-gcp-bundle/pom.xml 
b/nifi-nar-bundles/nifi-gcp-bundle/pom.xml
index c25a36f..2e8a65a 100644
--- a/nifi-nar-bundles/nifi-gcp-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-gcp-bundle/pom.xml
@@ -27,7 +27,7 @@
     <packaging>pom</packaging>
 
     <properties>
-        <google.cloud.sdk.version>0.71.0-alpha</google.cloud.sdk.version>
+        <google.cloud.sdk.version>0.101.0-alpha</google.cloud.sdk.version>
     </properties>
 
     <dependencyManagement>

Reply via email to