avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1433104 - in /avro/trunk: CHANGES.txt lang/java/trevni/avro/src/main/java/org/apache/trevni/avro/AvroColumnator.java lang/java/trevni/avro/src/test/java/org/apache/trevni/avro/TestShredder.java
Date Mon, 14 Jan 2013 20:29:20 GMT
Author: cutting
Date: Mon Jan 14 20:29:19 2013
New Revision: 1433104

URL: http://svn.apache.org/viewvc?rev=1433104&view=rev
Log:
AVRO-1231. Java: Fix Trevni shredder to work on non-recursive schemas with multiple references.
 Contributed by Mark Wagner.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/trevni/avro/src/main/java/org/apache/trevni/avro/AvroColumnator.java
    avro/trunk/lang/java/trevni/avro/src/test/java/org/apache/trevni/avro/TestShredder.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1433104&r1=1433103&r2=1433104&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Mon Jan 14 20:29:19 2013
@@ -17,6 +17,9 @@ Trunk (not yet released)
 
   BUG FIXES
 
+    AVRO-1231. Java: Fix Trevni shredder to work on non-recursive
+    schemas with multiple references. (Mark Wagner via cutting)
+
 Avro 1.7.3 (6 December 2012)
 
   NEW FEATURES

Modified: avro/trunk/lang/java/trevni/avro/src/main/java/org/apache/trevni/avro/AvroColumnator.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/trevni/avro/src/main/java/org/apache/trevni/avro/AvroColumnator.java?rev=1433104&r1=1433103&r2=1433104&view=diff
==============================================================================
--- avro/trunk/lang/java/trevni/avro/src/main/java/org/apache/trevni/avro/AvroColumnator.java
(original)
+++ avro/trunk/lang/java/trevni/avro/src/main/java/org/apache/trevni/avro/AvroColumnator.java
Mon Jan 14 20:29:19 2013
@@ -97,6 +97,7 @@ class AvroColumnator {
     default:
       throw new TrevniRuntimeException("Unknown schema: "+s);
     }
+    seen.remove(s);
   }
 
   private String p(String parent, Schema child, String sep) {

Modified: avro/trunk/lang/java/trevni/avro/src/test/java/org/apache/trevni/avro/TestShredder.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/trevni/avro/src/test/java/org/apache/trevni/avro/TestShredder.java?rev=1433104&r1=1433103&r2=1433104&view=diff
==============================================================================
--- avro/trunk/lang/java/trevni/avro/src/test/java/org/apache/trevni/avro/TestShredder.java
(original)
+++ avro/trunk/lang/java/trevni/avro/src/test/java/org/apache/trevni/avro/TestShredder.java
Mon Jan 14 20:29:19 2013
@@ -86,6 +86,19 @@ public class TestShredder {
           new ColumnMetaData("y", ValueType.STRING));
   }
 
+  @Test public void testNamedRecord() throws Exception {
+	    String s = 
+	      "{\"type\":\"record\",\"name\":\"S\",\"fields\":["
+	      +"{\"name\":\"R1\",\"type\":"+SIMPLE_RECORD+"},"
+	      +"{\"name\":\"R2\",\"type\":\"R\"}"
+	      +"]}";
+	    check(Schema.parse(s),
+	          new ColumnMetaData("R1#x", ValueType.INT),
+	          new ColumnMetaData("R1#y", ValueType.STRING),
+	          new ColumnMetaData("R2#x", ValueType.INT),
+	          new ColumnMetaData("R2#y", ValueType.STRING));
+	  }
+  
   @Test public void testSimpleArray() throws Exception {
     String s = "{\"type\":\"array\",\"items\":\"long\"}";
     check(Schema.parse(s),



Mime
View raw message