avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject avro git commit: AVRO-1907: Java: Add debug logging for invalid logical types.
Date Sat, 05 Nov 2016 19:38:08 GMT
Repository: avro
Updated Branches:
  refs/heads/master b2cd78d54 -> bf7f3934c


AVRO-1907: Java: Add debug logging for invalid logical types.

Contributed by Gabor Szadovszky.


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/bf7f3934
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/bf7f3934
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/bf7f3934

Branch: refs/heads/master
Commit: bf7f3934c3f33bbd1d8923bf3c33e0fe45831ec5
Parents: b2cd78d
Author: Gabor Szadovszky <gabor.szadovszky@cloudera.com>
Authored: Mon Sep 26 13:44:25 2016 +0200
Committer: Ryan Blue <blue@apache.org>
Committed: Sat Nov 5 12:38:00 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                   | 3 +++
 .../java/avro/src/main/java/org/apache/avro/LogicalTypes.java | 7 +++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/bf7f3934/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index cd02bf5..9225c16 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -34,6 +34,9 @@ Trunk (not yet released)
 
     AVRO-1918: Improve logical type documentation. (Gabor Szadovszky via cutting)
 
+    AVRO-1907: Java: Add debug logging for invalid logical types.
+    (Gabor Szadovszky via blue)
+
   BUG FIXES
 
     AVRO-1741: Python3: Fix error when codec is not in the header.

http://git-wip-us.apache.org/repos/asf/avro/blob/bf7f3934/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
----------------------------------------------------------------------
diff --git a/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java b/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
index fb8f17b..742b2fc 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
@@ -21,8 +21,13 @@ package org.apache.avro;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class LogicalTypes {
 
+  private static final Logger LOG = LoggerFactory.getLogger(LogicalTypes.class);
+
   public interface LogicalTypeFactory {
     LogicalType fromSchema(Schema schema);
   }
@@ -81,9 +86,11 @@ public class LogicalTypes {
         logicalType.validate(schema);
       }
     } catch (RuntimeException e) {
+      LOG.debug("Invalid logical type found", e);
       if (throwErrors) {
         throw e;
       }
+      LOG.warn("Ignoring invalid logical type for name: {}", typeName);
       // ignore invalid types
       logicalType = null;
     }


Mime
View raw message