avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From th...@apache.org
Subject svn commit: r1382397 - in /avro/trunk: CHANGES.txt lang/c++/impl/avrogencpp.cc lang/c++/jsonschemas/union_array_union
Date Sun, 09 Sep 2012 04:45:51 GMT
Author: thiru
Date: Sun Sep  9 04:45:51 2012
New Revision: 1382397

URL: http://svn.apache.org/viewvc?rev=1382397&view=rev
Log:
AVRO-1143. avrogencpp generates $Undefined$ for some union types

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/c++/impl/avrogencpp.cc
    avro/trunk/lang/c++/jsonschemas/union_array_union

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1382397&r1=1382396&r2=1382397&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Sun Sep  9 04:45:51 2012
@@ -23,6 +23,8 @@ Avro 1.7.2 (unreleased)
 
     AVRO-1141. Avro data files are created without O_TRUNC (Martin Nagy via thiru)
 
+    AVRO-1143. avrogencpp generates $Undefined$ for some union types (thiru)
+
 Avro 1.7.1 (16 July 2012)
 
   NEW FEATURES

Modified: avro/trunk/lang/c++/impl/avrogencpp.cc
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c%2B%2B/impl/avrogencpp.cc?rev=1382397&r1=1382396&r2=1382397&view=diff
==============================================================================
--- avro/trunk/lang/c++/impl/avrogencpp.cc (original)
+++ avro/trunk/lang/c++/impl/avrogencpp.cc Sun Sep  9 04:45:51 2012
@@ -171,6 +171,8 @@ string CodeGen::cppTypeOf(const NodePtr&
             lexical_cast<string>(n->fixedSize()) + ">";
     case avro::AVRO_SYMBOLIC:
         return cppTypeOf(resolveSymbol(n));
+    case avro::AVRO_UNION:
+        return fullname(done[n]);
     default:
         return "$Undefined$";
     }

Modified: avro/trunk/lang/c++/jsonschemas/union_array_union
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c%2B%2B/jsonschemas/union_array_union?rev=1382397&r1=1382396&r2=1382397&view=diff
==============================================================================
--- avro/trunk/lang/c++/jsonschemas/union_array_union (original)
+++ avro/trunk/lang/c++/jsonschemas/union_array_union Sun Sep  9 04:45:51 2012
@@ -1,8 +1,14 @@
 {
-  "type": "record",
-  "name": "r1",
-  "fields" : [
-    {"name": "id", "type": "string"},
-    {"name": "val", "type": [{"type": "array", "items": {"name": "r3", "type": "record",
"fields": [{"name": "name", "type": "string"}, {"name": "data", "type": "bytes"}, {"name":
"rev", "type": ["string", "null"]}]}}, "null"]}
-  ]
+    "type": "record",
+    "name": "r1",
+    "fields" : [
+        {
+            "name": "f1",
+            "type":
+            [
+                "null",
+                { "type":"array", "items":[ "null", "int" ] }
+            ]
+        }
+    ]
 }



Mime
View raw message