parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ziva...@apache.org
Subject [parquet-mr] branch master updated: PARQUET-1557: Replace deprecated Apache Avro methods (#636)
Date Thu, 09 May 2019 06:21:30 GMT
This is an automated email from the ASF dual-hosted git repository.

zivanfi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/parquet-mr.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c257f0  PARQUET-1557: Replace deprecated Apache Avro methods (#636)
2c257f0 is described below

commit 2c257f055f0ef30b2a200a7a2e471425534a7010
Author: Fokko Driesprong <fokko@driesprong.frl>
AuthorDate: Thu May 9 08:21:24 2019 +0200

    PARQUET-1557: Replace deprecated Apache Avro methods (#636)
    
    Some methods are deprecated in Avro 1.8.2 and are being removed in Avro 1.9.0. This commit
removes references to these methods from Parquet.
---
 .../src/main/java/org/apache/parquet/cli/json/AvroJson.java       | 2 +-
 .../src/main/java/org/apache/parquet/cli/util/Schemas.java        | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/parquet-cli/src/main/java/org/apache/parquet/cli/json/AvroJson.java b/parquet-cli/src/main/java/org/apache/parquet/cli/json/AvroJson.java
index f17ee83..9da6fc6 100644
--- a/parquet-cli/src/main/java/org/apache/parquet/cli/json/AvroJson.java
+++ b/parquet-cli/src/main/java/org/apache/parquet/cli/json/AvroJson.java
@@ -309,7 +309,7 @@ public class AvroJson {
           // check that each field is present or has a default
           boolean missingField = false;
           for (Schema.Field field : schema.getFields()) {
-            if (!datum.has(field.name()) && field.defaultValue() == null) {
+            if (!datum.has(field.name()) && field.defaultVal() == null) {
               missingField = true;
               break;
             }
diff --git a/parquet-cli/src/main/java/org/apache/parquet/cli/util/Schemas.java b/parquet-cli/src/main/java/org/apache/parquet/cli/util/Schemas.java
index 72f3f86..aa16986 100644
--- a/parquet-cli/src/main/java/org/apache/parquet/cli/util/Schemas.java
+++ b/parquet-cli/src/main/java/org/apache/parquet/cli/util/Schemas.java
@@ -419,10 +419,10 @@ public class Schemas {
             leftField.name(),
             mergeOrUnion(leftField.schema(), rightField.schema()),
             coalesce(leftField.doc(), rightField.doc()),
-            coalesce(leftField.defaultValue(), rightField.defaultValue())
+            coalesce(leftField.defaultVal(), rightField.defaultVal())
         ));
       } else {
-        if (leftField.defaultValue() != null) {
+        if (leftField.defaultVal() != null) {
           fields.add(copy(leftField));
         } else {
           fields.add(new Schema.Field(
@@ -435,7 +435,7 @@ public class Schemas {
 
     for (Schema.Field rightField : right.getFields()) {
       if (left.getField(rightField.name()) == null) {
-        if (rightField.defaultValue() != null) {
+        if (rightField.defaultVal() != null) {
           fields.add(copy(rightField));
         } else {
           fields.add(new Schema.Field(
@@ -460,7 +460,7 @@ public class Schemas {
    */
   public static Schema.Field copy(Schema.Field field) {
     return new Schema.Field(
-        field.name(), field.schema(), field.doc(), field.defaultValue());
+        field.name(), field.schema(), field.doc(), field.defaultVal());
   }
 
   private static float fieldSimilarity(Schema left, Schema right) {


Mime
View raw message