diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_8167579962882089724_8167579962882089724.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_8167579962882089724_8167579962882089724.java new file mode 100644 index 000000000..4bfb09bae --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_8167579962882089724_8167579962882089724.java @@ -0,0 +1,114 @@ + +package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_4; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastDeserializer; +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericArray; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Decoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_8167579962882089724_8167579962882089724 + implements FastDeserializer +{ + + private final Schema readerSchema; + private final Schema testUnionString0; + private final Schema testStringArray0; + private final Schema testStringMap0; + + public FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_8167579962882089724_8167579962882089724(Schema readerSchema) { + this.readerSchema = readerSchema; + this.testUnionString0 = readerSchema.getField("testUnionString").schema(); + this.testStringArray0 = readerSchema.getField("testStringArray").schema(); + this.testStringMap0 = readerSchema.getField("testStringMap").schema(); + } + + public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) + throws IOException + { + return deserializeFastStringableTest_javaStringPropertyInReaderSchemaTest0((reuse), (decoder)); + } + + public IndexedRecord deserializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(Object reuse, Decoder decoder) + throws IOException + { + IndexedRecord FastStringableTest_javaStringPropertyInReaderSchemaTest; + if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { + FastStringableTest_javaStringPropertyInReaderSchemaTest = ((IndexedRecord)(reuse)); + } else { + FastStringableTest_javaStringPropertyInReaderSchemaTest = new org.apache.avro.generic.GenericData.Record(readerSchema); + } + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(0) instanceof Utf8) { + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(0, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(0)))); + } else { + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(0, (decoder).readString(null)); + } + int unionIndex0 = (decoder.readIndex()); + if (unionIndex0 == 0) { + decoder.readNull(); + } else { + if (unionIndex0 == 1) { + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(1) instanceof Utf8) { + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(1, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(1)))); + } else { + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(1, (decoder).readString(null)); + } + } + } + List testStringArray1 = null; + long chunkLen0 = (decoder.readArrayStart()); + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(2) instanceof List) { + testStringArray1 = ((List) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(2)); + testStringArray1 .clear(); + } else { + testStringArray1 = new org.apache.avro.generic.GenericData.Array(((int) chunkLen0), testStringArray0); + } + while (chunkLen0 > 0) { + for (int counter0 = 0; (counter0 testStringMap1 = null; + long chunkLen1 = (decoder.readMapStart()); + if (chunkLen1 > 0) { + Map testStringMapReuse0 = null; + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(3) instanceof Map) { + testStringMapReuse0 = ((Map) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(3)); + } + if (testStringMapReuse0 != (null)) { + testStringMapReuse0 .clear(); + testStringMap1 = testStringMapReuse0; + } else { + testStringMap1 = new HashMap(); + } + do { + for (int counter1 = 0; (counter1 0); + } else { + testStringMap1 = Collections.emptyMap(); + } + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(3, testStringMap1); + return FastStringableTest_javaStringPropertyInReaderSchemaTest; + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_6238557830396401576_6238557830396401576.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_6238557830396401576_6238557830396401576.java deleted file mode 100644 index be5ad91f4..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_6238557830396401576_6238557830396401576.java +++ /dev/null @@ -1,68 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_4; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastDeserializer; -import org.apache.avro.Schema; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Decoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_6238557830396401576_6238557830396401576 - implements FastDeserializer -{ - - private final Schema readerSchema; - private final Schema favorite_number0; - private final Schema favorite_color0; - - public FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_6238557830396401576_6238557830396401576(Schema readerSchema) { - this.readerSchema = readerSchema; - this.favorite_number0 = readerSchema.getField("favorite_number").schema(); - this.favorite_color0 = readerSchema.getField("favorite_color").schema(); - } - - public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) - throws IOException - { - return deserializeFastStringableTest_javaStringPropertyInsideUnionTest0((reuse), (decoder)); - } - - public IndexedRecord deserializeFastStringableTest_javaStringPropertyInsideUnionTest0(Object reuse, Decoder decoder) - throws IOException - { - IndexedRecord FastStringableTest_javaStringPropertyInsideUnionTest; - if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { - FastStringableTest_javaStringPropertyInsideUnionTest = ((IndexedRecord)(reuse)); - } else { - FastStringableTest_javaStringPropertyInsideUnionTest = new org.apache.avro.generic.GenericData.Record(readerSchema); - } - if (FastStringableTest_javaStringPropertyInsideUnionTest.get(0) instanceof Utf8) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(0, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyInsideUnionTest.get(0)))); - } else { - FastStringableTest_javaStringPropertyInsideUnionTest.put(0, (decoder).readString(null)); - } - int unionIndex0 = (decoder.readIndex()); - if (unionIndex0 == 0) { - decoder.readNull(); - } else { - if (unionIndex0 == 1) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(1, (decoder.readInt())); - } - } - int unionIndex1 = (decoder.readIndex()); - if (unionIndex1 == 0) { - decoder.readNull(); - } else { - if (unionIndex1 == 1) { - if (FastStringableTest_javaStringPropertyInsideUnionTest.get(2) instanceof Utf8) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(2, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyInsideUnionTest.get(2)))); - } else { - FastStringableTest_javaStringPropertyInsideUnionTest.put(2, (decoder).readString(null)); - } - } - } - return FastStringableTest_javaStringPropertyInsideUnionTest; - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericDeserializer_9103393295617573707_9103393295617573707.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericDeserializer_9103393295617573707_9103393295617573707.java new file mode 100644 index 000000000..5919930a0 --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericDeserializer_9103393295617573707_9103393295617573707.java @@ -0,0 +1,114 @@ + +package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_4; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastDeserializer; +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericArray; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Decoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyTest_GenericDeserializer_9103393295617573707_9103393295617573707 + implements FastDeserializer +{ + + private final Schema readerSchema; + private final Schema testUnionString0; + private final Schema testStringArray0; + private final Schema testStringMap0; + + public FastStringableTest_javaStringPropertyTest_GenericDeserializer_9103393295617573707_9103393295617573707(Schema readerSchema) { + this.readerSchema = readerSchema; + this.testUnionString0 = readerSchema.getField("testUnionString").schema(); + this.testStringArray0 = readerSchema.getField("testStringArray").schema(); + this.testStringMap0 = readerSchema.getField("testStringMap").schema(); + } + + public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) + throws IOException + { + return deserializeFastStringableTest_javaStringPropertyTest0((reuse), (decoder)); + } + + public IndexedRecord deserializeFastStringableTest_javaStringPropertyTest0(Object reuse, Decoder decoder) + throws IOException + { + IndexedRecord FastStringableTest_javaStringPropertyTest; + if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { + FastStringableTest_javaStringPropertyTest = ((IndexedRecord)(reuse)); + } else { + FastStringableTest_javaStringPropertyTest = new org.apache.avro.generic.GenericData.Record(readerSchema); + } + if (FastStringableTest_javaStringPropertyTest.get(0) instanceof Utf8) { + FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyTest.get(0)))); + } else { + FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString(null)); + } + int unionIndex0 = (decoder.readIndex()); + if (unionIndex0 == 0) { + decoder.readNull(); + } else { + if (unionIndex0 == 1) { + if (FastStringableTest_javaStringPropertyTest.get(1) instanceof Utf8) { + FastStringableTest_javaStringPropertyTest.put(1, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyTest.get(1)))); + } else { + FastStringableTest_javaStringPropertyTest.put(1, (decoder).readString(null)); + } + } + } + List testStringArray1 = null; + long chunkLen0 = (decoder.readArrayStart()); + if (FastStringableTest_javaStringPropertyTest.get(2) instanceof List) { + testStringArray1 = ((List) FastStringableTest_javaStringPropertyTest.get(2)); + testStringArray1 .clear(); + } else { + testStringArray1 = new org.apache.avro.generic.GenericData.Array(((int) chunkLen0), testStringArray0); + } + while (chunkLen0 > 0) { + for (int counter0 = 0; (counter0 testStringMap1 = null; + long chunkLen1 = (decoder.readMapStart()); + if (chunkLen1 > 0) { + Map testStringMapReuse0 = null; + if (FastStringableTest_javaStringPropertyTest.get(3) instanceof Map) { + testStringMapReuse0 = ((Map) FastStringableTest_javaStringPropertyTest.get(3)); + } + if (testStringMapReuse0 != (null)) { + testStringMapReuse0 .clear(); + testStringMap1 = testStringMapReuse0; + } else { + testStringMap1 = new HashMap(); + } + do { + for (int counter1 = 0; (counter1 0); + } else { + testStringMap1 = Collections.emptyMap(); + } + FastStringableTest_javaStringPropertyTest.put(3, testStringMap1); + return FastStringableTest_javaStringPropertyTest; + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericDeserializer_9185875457190242821_9185875457190242821.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericDeserializer_9185875457190242821_9185875457190242821.java deleted file mode 100644 index d2bb80796..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericDeserializer_9185875457190242821_9185875457190242821.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_4; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastDeserializer; -import org.apache.avro.Schema; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Decoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyTest_GenericDeserializer_9185875457190242821_9185875457190242821 - implements FastDeserializer -{ - - private final Schema readerSchema; - - public FastStringableTest_javaStringPropertyTest_GenericDeserializer_9185875457190242821_9185875457190242821(Schema readerSchema) { - this.readerSchema = readerSchema; - } - - public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) - throws IOException - { - return deserializeFastStringableTest_javaStringPropertyTest0((reuse), (decoder)); - } - - public IndexedRecord deserializeFastStringableTest_javaStringPropertyTest0(Object reuse, Decoder decoder) - throws IOException - { - IndexedRecord FastStringableTest_javaStringPropertyTest; - if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { - FastStringableTest_javaStringPropertyTest = ((IndexedRecord)(reuse)); - } else { - FastStringableTest_javaStringPropertyTest = new org.apache.avro.generic.GenericData.Record(readerSchema); - } - if (FastStringableTest_javaStringPropertyTest.get(0) instanceof Utf8) { - FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString(((Utf8) FastStringableTest_javaStringPropertyTest.get(0)))); - } else { - FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString(null)); - } - return FastStringableTest_javaStringPropertyTest; - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220.java new file mode 100644 index 000000000..09d6cdd3e --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220.java @@ -0,0 +1,101 @@ + +package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_7; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastDeserializer; +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericArray; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Decoder; + +public class FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220 + implements FastDeserializer +{ + + private final Schema readerSchema; + private final Schema testUnionString0; + private final Schema testStringArray0; + private final Schema testStringMap0; + + public FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220(Schema readerSchema) { + this.readerSchema = readerSchema; + this.testUnionString0 = readerSchema.getField("testUnionString").schema(); + this.testStringArray0 = readerSchema.getField("testStringArray").schema(); + this.testStringMap0 = readerSchema.getField("testStringMap").schema(); + } + + public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) + throws IOException + { + return deserializeFastStringableTest_javaStringPropertyInReaderSchemaTest0((reuse), (decoder)); + } + + public IndexedRecord deserializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(Object reuse, Decoder decoder) + throws IOException + { + IndexedRecord FastStringableTest_javaStringPropertyInReaderSchemaTest; + if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { + FastStringableTest_javaStringPropertyInReaderSchemaTest = ((IndexedRecord)(reuse)); + } else { + FastStringableTest_javaStringPropertyInReaderSchemaTest = new org.apache.avro.generic.GenericData.Record(readerSchema); + } + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(0, (decoder).readString()); + int unionIndex0 = (decoder.readIndex()); + if (unionIndex0 == 0) { + decoder.readNull(); + } else { + if (unionIndex0 == 1) { + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(1, (decoder).readString()); + } + } + List testStringArray1 = null; + long chunkLen0 = (decoder.readArrayStart()); + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(2) instanceof List) { + testStringArray1 = ((List) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(2)); + testStringArray1 .clear(); + } else { + testStringArray1 = new org.apache.avro.generic.GenericData.Array(((int) chunkLen0), testStringArray0); + } + while (chunkLen0 > 0) { + for (int counter0 = 0; (counter0 testStringMap1 = null; + long chunkLen1 = (decoder.readMapStart()); + if (chunkLen1 > 0) { + Map testStringMapReuse0 = null; + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(3) instanceof Map) { + testStringMapReuse0 = ((Map) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(3)); + } + if (testStringMapReuse0 != (null)) { + testStringMapReuse0 .clear(); + testStringMap1 = testStringMapReuse0; + } else { + testStringMap1 = new HashMap(); + } + do { + for (int counter1 = 0; (counter1 0); + } else { + testStringMap1 = Collections.emptyMap(); + } + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(3, testStringMap1); + return FastStringableTest_javaStringPropertyInReaderSchemaTest; + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418.java deleted file mode 100644 index 8c591413c..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418.java +++ /dev/null @@ -1,59 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_7; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastDeserializer; -import org.apache.avro.Schema; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Decoder; - -public class FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418 - implements FastDeserializer -{ - - private final Schema readerSchema; - private final Schema favorite_number0; - private final Schema favorite_color0; - - public FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418(Schema readerSchema) { - this.readerSchema = readerSchema; - this.favorite_number0 = readerSchema.getField("favorite_number").schema(); - this.favorite_color0 = readerSchema.getField("favorite_color").schema(); - } - - public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) - throws IOException - { - return deserializeFastStringableTest_javaStringPropertyInsideUnionTest0((reuse), (decoder)); - } - - public IndexedRecord deserializeFastStringableTest_javaStringPropertyInsideUnionTest0(Object reuse, Decoder decoder) - throws IOException - { - IndexedRecord FastStringableTest_javaStringPropertyInsideUnionTest; - if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { - FastStringableTest_javaStringPropertyInsideUnionTest = ((IndexedRecord)(reuse)); - } else { - FastStringableTest_javaStringPropertyInsideUnionTest = new org.apache.avro.generic.GenericData.Record(readerSchema); - } - FastStringableTest_javaStringPropertyInsideUnionTest.put(0, (decoder).readString()); - int unionIndex0 = (decoder.readIndex()); - if (unionIndex0 == 0) { - decoder.readNull(); - } else { - if (unionIndex0 == 1) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(1, (decoder.readInt())); - } - } - int unionIndex1 = (decoder.readIndex()); - if (unionIndex1 == 0) { - decoder.readNull(); - } else { - if (unionIndex1 == 1) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(2, (decoder).readString()); - } - } - return FastStringableTest_javaStringPropertyInsideUnionTest; - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759.java new file mode 100644 index 000000000..fc33692b7 --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759.java @@ -0,0 +1,101 @@ + +package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_7; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastDeserializer; +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericArray; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Decoder; + +public class FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759 + implements FastDeserializer +{ + + private final Schema readerSchema; + private final Schema testUnionString0; + private final Schema testStringArray0; + private final Schema testStringMap0; + + public FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759(Schema readerSchema) { + this.readerSchema = readerSchema; + this.testUnionString0 = readerSchema.getField("testUnionString").schema(); + this.testStringArray0 = readerSchema.getField("testStringArray").schema(); + this.testStringMap0 = readerSchema.getField("testStringMap").schema(); + } + + public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) + throws IOException + { + return deserializeFastStringableTest_javaStringPropertyTest0((reuse), (decoder)); + } + + public IndexedRecord deserializeFastStringableTest_javaStringPropertyTest0(Object reuse, Decoder decoder) + throws IOException + { + IndexedRecord FastStringableTest_javaStringPropertyTest; + if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { + FastStringableTest_javaStringPropertyTest = ((IndexedRecord)(reuse)); + } else { + FastStringableTest_javaStringPropertyTest = new org.apache.avro.generic.GenericData.Record(readerSchema); + } + FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString()); + int unionIndex0 = (decoder.readIndex()); + if (unionIndex0 == 0) { + decoder.readNull(); + } else { + if (unionIndex0 == 1) { + FastStringableTest_javaStringPropertyTest.put(1, (decoder).readString()); + } + } + List testStringArray1 = null; + long chunkLen0 = (decoder.readArrayStart()); + if (FastStringableTest_javaStringPropertyTest.get(2) instanceof List) { + testStringArray1 = ((List) FastStringableTest_javaStringPropertyTest.get(2)); + testStringArray1 .clear(); + } else { + testStringArray1 = new org.apache.avro.generic.GenericData.Array(((int) chunkLen0), testStringArray0); + } + while (chunkLen0 > 0) { + for (int counter0 = 0; (counter0 testStringMap1 = null; + long chunkLen1 = (decoder.readMapStart()); + if (chunkLen1 > 0) { + Map testStringMapReuse0 = null; + if (FastStringableTest_javaStringPropertyTest.get(3) instanceof Map) { + testStringMapReuse0 = ((Map) FastStringableTest_javaStringPropertyTest.get(3)); + } + if (testStringMapReuse0 != (null)) { + testStringMapReuse0 .clear(); + testStringMap1 = testStringMapReuse0; + } else { + testStringMap1 = new HashMap(); + } + do { + for (int counter1 = 0; (counter1 0); + } else { + testStringMap1 = Collections.emptyMap(); + } + FastStringableTest_javaStringPropertyTest.put(3, testStringMap1); + return FastStringableTest_javaStringPropertyTest; + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004.java deleted file mode 100644 index cea73d695..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004.java +++ /dev/null @@ -1,39 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_7; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastDeserializer; -import org.apache.avro.Schema; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Decoder; - -public class FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004 - implements FastDeserializer -{ - - private final Schema readerSchema; - - public FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004(Schema readerSchema) { - this.readerSchema = readerSchema; - } - - public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) - throws IOException - { - return deserializeFastStringableTest_javaStringPropertyTest0((reuse), (decoder)); - } - - public IndexedRecord deserializeFastStringableTest_javaStringPropertyTest0(Object reuse, Decoder decoder) - throws IOException - { - IndexedRecord FastStringableTest_javaStringPropertyTest; - if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { - FastStringableTest_javaStringPropertyTest = ((IndexedRecord)(reuse)); - } else { - FastStringableTest_javaStringPropertyTest = new org.apache.avro.generic.GenericData.Record(readerSchema); - } - FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString()); - return FastStringableTest_javaStringPropertyTest; - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220.java new file mode 100644 index 000000000..645b5f22b --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220.java @@ -0,0 +1,101 @@ + +package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_8; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastDeserializer; +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericArray; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Decoder; + +public class FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220 + implements FastDeserializer +{ + + private final Schema readerSchema; + private final Schema testUnionString0; + private final Schema testStringArray0; + private final Schema testStringMap0; + + public FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericDeserializer_5604497262207802220_5604497262207802220(Schema readerSchema) { + this.readerSchema = readerSchema; + this.testUnionString0 = readerSchema.getField("testUnionString").schema(); + this.testStringArray0 = readerSchema.getField("testStringArray").schema(); + this.testStringMap0 = readerSchema.getField("testStringMap").schema(); + } + + public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) + throws IOException + { + return deserializeFastStringableTest_javaStringPropertyInReaderSchemaTest0((reuse), (decoder)); + } + + public IndexedRecord deserializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(Object reuse, Decoder decoder) + throws IOException + { + IndexedRecord FastStringableTest_javaStringPropertyInReaderSchemaTest; + if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { + FastStringableTest_javaStringPropertyInReaderSchemaTest = ((IndexedRecord)(reuse)); + } else { + FastStringableTest_javaStringPropertyInReaderSchemaTest = new org.apache.avro.generic.GenericData.Record(readerSchema); + } + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(0, (decoder).readString()); + int unionIndex0 = (decoder.readIndex()); + if (unionIndex0 == 0) { + decoder.readNull(); + } else { + if (unionIndex0 == 1) { + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(1, (decoder).readString()); + } + } + List testStringArray1 = null; + long chunkLen0 = (decoder.readArrayStart()); + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(2) instanceof List) { + testStringArray1 = ((List) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(2)); + testStringArray1 .clear(); + } else { + testStringArray1 = new org.apache.avro.generic.GenericData.Array(((int) chunkLen0), testStringArray0); + } + while (chunkLen0 > 0) { + for (int counter0 = 0; (counter0 testStringMap1 = null; + long chunkLen1 = (decoder.readMapStart()); + if (chunkLen1 > 0) { + Map testStringMapReuse0 = null; + if (FastStringableTest_javaStringPropertyInReaderSchemaTest.get(3) instanceof Map) { + testStringMapReuse0 = ((Map) FastStringableTest_javaStringPropertyInReaderSchemaTest.get(3)); + } + if (testStringMapReuse0 != (null)) { + testStringMapReuse0 .clear(); + testStringMap1 = testStringMapReuse0; + } else { + testStringMap1 = new HashMap(); + } + do { + for (int counter1 = 0; (counter1 0); + } else { + testStringMap1 = Collections.emptyMap(); + } + FastStringableTest_javaStringPropertyInReaderSchemaTest.put(3, testStringMap1); + return FastStringableTest_javaStringPropertyInReaderSchemaTest; + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418.java deleted file mode 100644 index b66308979..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418.java +++ /dev/null @@ -1,59 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_8; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastDeserializer; -import org.apache.avro.Schema; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Decoder; - -public class FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418 - implements FastDeserializer -{ - - private final Schema readerSchema; - private final Schema favorite_number0; - private final Schema favorite_color0; - - public FastStringableTest_javaStringPropertyInsideUnionTest_GenericDeserializer_4476580127917956418_4476580127917956418(Schema readerSchema) { - this.readerSchema = readerSchema; - this.favorite_number0 = readerSchema.getField("favorite_number").schema(); - this.favorite_color0 = readerSchema.getField("favorite_color").schema(); - } - - public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) - throws IOException - { - return deserializeFastStringableTest_javaStringPropertyInsideUnionTest0((reuse), (decoder)); - } - - public IndexedRecord deserializeFastStringableTest_javaStringPropertyInsideUnionTest0(Object reuse, Decoder decoder) - throws IOException - { - IndexedRecord FastStringableTest_javaStringPropertyInsideUnionTest; - if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { - FastStringableTest_javaStringPropertyInsideUnionTest = ((IndexedRecord)(reuse)); - } else { - FastStringableTest_javaStringPropertyInsideUnionTest = new org.apache.avro.generic.GenericData.Record(readerSchema); - } - FastStringableTest_javaStringPropertyInsideUnionTest.put(0, (decoder).readString()); - int unionIndex0 = (decoder.readIndex()); - if (unionIndex0 == 0) { - decoder.readNull(); - } else { - if (unionIndex0 == 1) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(1, (decoder.readInt())); - } - } - int unionIndex1 = (decoder.readIndex()); - if (unionIndex1 == 0) { - decoder.readNull(); - } else { - if (unionIndex1 == 1) { - FastStringableTest_javaStringPropertyInsideUnionTest.put(2, (decoder).readString()); - } - } - return FastStringableTest_javaStringPropertyInsideUnionTest; - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759.java new file mode 100644 index 000000000..f7baa4eab --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759.java @@ -0,0 +1,101 @@ + +package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_8; + +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastDeserializer; +import org.apache.avro.Schema; +import org.apache.avro.generic.GenericArray; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Decoder; + +public class FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759 + implements FastDeserializer +{ + + private final Schema readerSchema; + private final Schema testUnionString0; + private final Schema testStringArray0; + private final Schema testStringMap0; + + public FastStringableTest_javaStringPropertyTest_GenericDeserializer_3411107869155152759_3411107869155152759(Schema readerSchema) { + this.readerSchema = readerSchema; + this.testUnionString0 = readerSchema.getField("testUnionString").schema(); + this.testStringArray0 = readerSchema.getField("testStringArray").schema(); + this.testStringMap0 = readerSchema.getField("testStringMap").schema(); + } + + public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) + throws IOException + { + return deserializeFastStringableTest_javaStringPropertyTest0((reuse), (decoder)); + } + + public IndexedRecord deserializeFastStringableTest_javaStringPropertyTest0(Object reuse, Decoder decoder) + throws IOException + { + IndexedRecord FastStringableTest_javaStringPropertyTest; + if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { + FastStringableTest_javaStringPropertyTest = ((IndexedRecord)(reuse)); + } else { + FastStringableTest_javaStringPropertyTest = new org.apache.avro.generic.GenericData.Record(readerSchema); + } + FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString()); + int unionIndex0 = (decoder.readIndex()); + if (unionIndex0 == 0) { + decoder.readNull(); + } else { + if (unionIndex0 == 1) { + FastStringableTest_javaStringPropertyTest.put(1, (decoder).readString()); + } + } + List testStringArray1 = null; + long chunkLen0 = (decoder.readArrayStart()); + if (FastStringableTest_javaStringPropertyTest.get(2) instanceof List) { + testStringArray1 = ((List) FastStringableTest_javaStringPropertyTest.get(2)); + testStringArray1 .clear(); + } else { + testStringArray1 = new org.apache.avro.generic.GenericData.Array(((int) chunkLen0), testStringArray0); + } + while (chunkLen0 > 0) { + for (int counter0 = 0; (counter0 testStringMap1 = null; + long chunkLen1 = (decoder.readMapStart()); + if (chunkLen1 > 0) { + Map testStringMapReuse0 = null; + if (FastStringableTest_javaStringPropertyTest.get(3) instanceof Map) { + testStringMapReuse0 = ((Map) FastStringableTest_javaStringPropertyTest.get(3)); + } + if (testStringMapReuse0 != (null)) { + testStringMapReuse0 .clear(); + testStringMap1 = testStringMapReuse0; + } else { + testStringMap1 = new HashMap(); + } + do { + for (int counter1 = 0; (counter1 0); + } else { + testStringMap1 = Collections.emptyMap(); + } + FastStringableTest_javaStringPropertyTest.put(3, testStringMap1); + return FastStringableTest_javaStringPropertyTest; + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004.java deleted file mode 100644 index 83c0bd2f6..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/deserialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004.java +++ /dev/null @@ -1,39 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.deserialization.AVRO_1_8; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastDeserializer; -import org.apache.avro.Schema; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Decoder; - -public class FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004 - implements FastDeserializer -{ - - private final Schema readerSchema; - - public FastStringableTest_javaStringPropertyTest_GenericDeserializer_713665344968052004_713665344968052004(Schema readerSchema) { - this.readerSchema = readerSchema; - } - - public IndexedRecord deserialize(IndexedRecord reuse, Decoder decoder) - throws IOException - { - return deserializeFastStringableTest_javaStringPropertyTest0((reuse), (decoder)); - } - - public IndexedRecord deserializeFastStringableTest_javaStringPropertyTest0(Object reuse, Decoder decoder) - throws IOException - { - IndexedRecord FastStringableTest_javaStringPropertyTest; - if ((((reuse)!= null)&&((reuse) instanceof IndexedRecord))&&(((IndexedRecord)(reuse)).getSchema() == readerSchema)) { - FastStringableTest_javaStringPropertyTest = ((IndexedRecord)(reuse)); - } else { - FastStringableTest_javaStringPropertyTest = new org.apache.avro.generic.GenericData.Record(readerSchema); - } - FastStringableTest_javaStringPropertyTest.put(0, (decoder).readString()); - return FastStringableTest_javaStringPropertyTest; - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_8167579962882089724.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_8167579962882089724.java new file mode 100644 index 000000000..ee38c5d24 --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_8167579962882089724.java @@ -0,0 +1,79 @@ + +package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_4; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastSerializer; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Encoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_8167579962882089724 + implements FastSerializer +{ + + + public void serialize(IndexedRecord data, Encoder encoder) + throws IOException + { + serializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(data, (encoder)); + } + + @SuppressWarnings("unchecked") + public void serializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(IndexedRecord data, Encoder encoder) + throws IOException + { + if (data.get(0) instanceof Utf8) { + (encoder).writeString(((Utf8) data.get(0))); + } else { + (encoder).writeString(data.get(0).toString()); + } + CharSequence testUnionString0 = ((CharSequence) data.get(1)); + if (testUnionString0 == null) { + (encoder).writeIndex(0); + (encoder).writeNull(); + } else { + (encoder).writeIndex(1); + if (testUnionString0 instanceof Utf8) { + (encoder).writeString(((Utf8) testUnionString0)); + } else { + (encoder).writeString(testUnionString0 .toString()); + } + } + List testStringArray0 = ((List ) data.get(2)); + (encoder).writeArrayStart(); + if ((testStringArray0 == null)||testStringArray0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringArray0 .size()); + for (int counter0 = 0; (counter0 testStringMap0 = ((Map ) data.get(3)); + (encoder).writeMapStart(); + if ((testStringMap0 == null)||testStringMap0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringMap0 .size()); + for (CharSequence key0 : ((Map ) testStringMap0).keySet()) { + (encoder).startItem(); + (encoder).writeString(key0); + if (testStringMap0 .get(key0) instanceof Utf8) { + (encoder).writeString(((Utf8) testStringMap0 .get(key0))); + } else { + (encoder).writeString(testStringMap0 .get(key0).toString()); + } + } + } + (encoder).writeMapEnd(); + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_6238557830396401576.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_6238557830396401576.java deleted file mode 100644 index e420d83f2..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_6238557830396401576.java +++ /dev/null @@ -1,52 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_4; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastSerializer; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Encoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_6238557830396401576 - implements FastSerializer -{ - - - public void serialize(IndexedRecord data, Encoder encoder) - throws IOException - { - serializeFastStringableTest_javaStringPropertyInsideUnionTest0(data, (encoder)); - } - - @SuppressWarnings("unchecked") - public void serializeFastStringableTest_javaStringPropertyInsideUnionTest0(IndexedRecord data, Encoder encoder) - throws IOException - { - if (data.get(0) instanceof Utf8) { - (encoder).writeString(((Utf8) data.get(0))); - } else { - (encoder).writeString(data.get(0).toString()); - } - Integer favorite_number0 = ((Integer) data.get(1)); - if (favorite_number0 == null) { - (encoder).writeIndex(0); - (encoder).writeNull(); - } else { - (encoder).writeIndex(1); - (encoder).writeInt(((Integer) favorite_number0)); - } - CharSequence favorite_color0 = ((CharSequence) data.get(2)); - if (favorite_color0 == null) { - (encoder).writeIndex(0); - (encoder).writeNull(); - } else { - (encoder).writeIndex(1); - if (favorite_color0 instanceof Utf8) { - (encoder).writeString(((Utf8) favorite_color0)); - } else { - (encoder).writeString(favorite_color0 .toString()); - } - } - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericSerializer_9103393295617573707.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericSerializer_9103393295617573707.java new file mode 100644 index 000000000..c7ccaf581 --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericSerializer_9103393295617573707.java @@ -0,0 +1,79 @@ + +package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_4; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastSerializer; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Encoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyTest_GenericSerializer_9103393295617573707 + implements FastSerializer +{ + + + public void serialize(IndexedRecord data, Encoder encoder) + throws IOException + { + serializeFastStringableTest_javaStringPropertyTest0(data, (encoder)); + } + + @SuppressWarnings("unchecked") + public void serializeFastStringableTest_javaStringPropertyTest0(IndexedRecord data, Encoder encoder) + throws IOException + { + if (data.get(0) instanceof Utf8) { + (encoder).writeString(((Utf8) data.get(0))); + } else { + (encoder).writeString(data.get(0).toString()); + } + CharSequence testUnionString0 = ((CharSequence) data.get(1)); + if (testUnionString0 == null) { + (encoder).writeIndex(0); + (encoder).writeNull(); + } else { + (encoder).writeIndex(1); + if (testUnionString0 instanceof Utf8) { + (encoder).writeString(((Utf8) testUnionString0)); + } else { + (encoder).writeString(testUnionString0 .toString()); + } + } + List testStringArray0 = ((List ) data.get(2)); + (encoder).writeArrayStart(); + if ((testStringArray0 == null)||testStringArray0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringArray0 .size()); + for (int counter0 = 0; (counter0 testStringMap0 = ((Map ) data.get(3)); + (encoder).writeMapStart(); + if ((testStringMap0 == null)||testStringMap0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringMap0 .size()); + for (CharSequence key0 : ((Map ) testStringMap0).keySet()) { + (encoder).startItem(); + (encoder).writeString(key0); + if (testStringMap0 .get(key0) instanceof Utf8) { + (encoder).writeString(((Utf8) testStringMap0 .get(key0))); + } else { + (encoder).writeString(testStringMap0 .get(key0).toString()); + } + } + } + (encoder).writeMapEnd(); + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericSerializer_9185875457190242821.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericSerializer_9185875457190242821.java deleted file mode 100644 index c42b7c7bb..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_4/FastStringableTest_javaStringPropertyTest_GenericSerializer_9185875457190242821.java +++ /dev/null @@ -1,32 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_4; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastSerializer; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Encoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyTest_GenericSerializer_9185875457190242821 - implements FastSerializer -{ - - - public void serialize(IndexedRecord data, Encoder encoder) - throws IOException - { - serializeFastStringableTest_javaStringPropertyTest0(data, (encoder)); - } - - @SuppressWarnings("unchecked") - public void serializeFastStringableTest_javaStringPropertyTest0(IndexedRecord data, Encoder encoder) - throws IOException - { - if (data.get(0) instanceof Utf8) { - (encoder).writeString(((Utf8) data.get(0))); - } else { - (encoder).writeString(data.get(0).toString()); - } - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220.java new file mode 100644 index 000000000..df743ee0f --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220.java @@ -0,0 +1,79 @@ + +package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_7; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastSerializer; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Encoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220 + implements FastSerializer +{ + + + public void serialize(IndexedRecord data, Encoder encoder) + throws IOException + { + serializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(data, (encoder)); + } + + @SuppressWarnings("unchecked") + public void serializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(IndexedRecord data, Encoder encoder) + throws IOException + { + if (data.get(0) instanceof Utf8) { + (encoder).writeString(((Utf8) data.get(0))); + } else { + (encoder).writeString(data.get(0).toString()); + } + CharSequence testUnionString0 = ((CharSequence) data.get(1)); + if (testUnionString0 == null) { + (encoder).writeIndex(0); + (encoder).writeNull(); + } else { + (encoder).writeIndex(1); + if (testUnionString0 instanceof Utf8) { + (encoder).writeString(((Utf8) testUnionString0)); + } else { + (encoder).writeString(testUnionString0 .toString()); + } + } + List testStringArray0 = ((List ) data.get(2)); + (encoder).writeArrayStart(); + if ((testStringArray0 == null)||testStringArray0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringArray0 .size()); + for (int counter0 = 0; (counter0 testStringMap0 = ((Map ) data.get(3)); + (encoder).writeMapStart(); + if ((testStringMap0 == null)||testStringMap0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringMap0 .size()); + for (CharSequence key0 : ((Map ) testStringMap0).keySet()) { + (encoder).startItem(); + (encoder).writeString(key0); + if (testStringMap0 .get(key0) instanceof Utf8) { + (encoder).writeString(((Utf8) testStringMap0 .get(key0))); + } else { + (encoder).writeString(testStringMap0 .get(key0).toString()); + } + } + } + (encoder).writeMapEnd(); + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418.java deleted file mode 100644 index 9ab6a69f6..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418.java +++ /dev/null @@ -1,52 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_7; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastSerializer; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Encoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418 - implements FastSerializer -{ - - - public void serialize(IndexedRecord data, Encoder encoder) - throws IOException - { - serializeFastStringableTest_javaStringPropertyInsideUnionTest0(data, (encoder)); - } - - @SuppressWarnings("unchecked") - public void serializeFastStringableTest_javaStringPropertyInsideUnionTest0(IndexedRecord data, Encoder encoder) - throws IOException - { - if (data.get(0) instanceof Utf8) { - (encoder).writeString(((Utf8) data.get(0))); - } else { - (encoder).writeString(data.get(0).toString()); - } - Integer favorite_number0 = ((Integer) data.get(1)); - if (favorite_number0 == null) { - (encoder).writeIndex(0); - (encoder).writeNull(); - } else { - (encoder).writeIndex(1); - (encoder).writeInt(((Integer) favorite_number0)); - } - CharSequence favorite_color0 = ((CharSequence) data.get(2)); - if (favorite_color0 == null) { - (encoder).writeIndex(0); - (encoder).writeNull(); - } else { - (encoder).writeIndex(1); - if (favorite_color0 instanceof Utf8) { - (encoder).writeString(((Utf8) favorite_color0)); - } else { - (encoder).writeString(favorite_color0 .toString()); - } - } - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759.java new file mode 100644 index 000000000..1722aee12 --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759.java @@ -0,0 +1,79 @@ + +package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_7; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastSerializer; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Encoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759 + implements FastSerializer +{ + + + public void serialize(IndexedRecord data, Encoder encoder) + throws IOException + { + serializeFastStringableTest_javaStringPropertyTest0(data, (encoder)); + } + + @SuppressWarnings("unchecked") + public void serializeFastStringableTest_javaStringPropertyTest0(IndexedRecord data, Encoder encoder) + throws IOException + { + if (data.get(0) instanceof Utf8) { + (encoder).writeString(((Utf8) data.get(0))); + } else { + (encoder).writeString(data.get(0).toString()); + } + CharSequence testUnionString0 = ((CharSequence) data.get(1)); + if (testUnionString0 == null) { + (encoder).writeIndex(0); + (encoder).writeNull(); + } else { + (encoder).writeIndex(1); + if (testUnionString0 instanceof Utf8) { + (encoder).writeString(((Utf8) testUnionString0)); + } else { + (encoder).writeString(testUnionString0 .toString()); + } + } + List testStringArray0 = ((List ) data.get(2)); + (encoder).writeArrayStart(); + if ((testStringArray0 == null)||testStringArray0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringArray0 .size()); + for (int counter0 = 0; (counter0 testStringMap0 = ((Map ) data.get(3)); + (encoder).writeMapStart(); + if ((testStringMap0 == null)||testStringMap0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringMap0 .size()); + for (CharSequence key0 : ((Map ) testStringMap0).keySet()) { + (encoder).startItem(); + (encoder).writeString(key0); + if (testStringMap0 .get(key0) instanceof Utf8) { + (encoder).writeString(((Utf8) testStringMap0 .get(key0))); + } else { + (encoder).writeString(testStringMap0 .get(key0).toString()); + } + } + } + (encoder).writeMapEnd(); + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004.java deleted file mode 100644 index 0ac58d31c..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_7/FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004.java +++ /dev/null @@ -1,32 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_7; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastSerializer; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Encoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004 - implements FastSerializer -{ - - - public void serialize(IndexedRecord data, Encoder encoder) - throws IOException - { - serializeFastStringableTest_javaStringPropertyTest0(data, (encoder)); - } - - @SuppressWarnings("unchecked") - public void serializeFastStringableTest_javaStringPropertyTest0(IndexedRecord data, Encoder encoder) - throws IOException - { - if (data.get(0) instanceof Utf8) { - (encoder).writeString(((Utf8) data.get(0))); - } else { - (encoder).writeString(data.get(0).toString()); - } - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220.java new file mode 100644 index 000000000..b041978e1 --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220.java @@ -0,0 +1,79 @@ + +package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_8; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastSerializer; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Encoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyInReaderSchemaTest_GenericSerializer_5604497262207802220 + implements FastSerializer +{ + + + public void serialize(IndexedRecord data, Encoder encoder) + throws IOException + { + serializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(data, (encoder)); + } + + @SuppressWarnings("unchecked") + public void serializeFastStringableTest_javaStringPropertyInReaderSchemaTest0(IndexedRecord data, Encoder encoder) + throws IOException + { + if (data.get(0) instanceof Utf8) { + (encoder).writeString(((Utf8) data.get(0))); + } else { + (encoder).writeString(data.get(0).toString()); + } + CharSequence testUnionString0 = ((CharSequence) data.get(1)); + if (testUnionString0 == null) { + (encoder).writeIndex(0); + (encoder).writeNull(); + } else { + (encoder).writeIndex(1); + if (testUnionString0 instanceof Utf8) { + (encoder).writeString(((Utf8) testUnionString0)); + } else { + (encoder).writeString(testUnionString0 .toString()); + } + } + List testStringArray0 = ((List ) data.get(2)); + (encoder).writeArrayStart(); + if ((testStringArray0 == null)||testStringArray0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringArray0 .size()); + for (int counter0 = 0; (counter0 testStringMap0 = ((Map ) data.get(3)); + (encoder).writeMapStart(); + if ((testStringMap0 == null)||testStringMap0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringMap0 .size()); + for (CharSequence key0 : ((Map ) testStringMap0).keySet()) { + (encoder).startItem(); + (encoder).writeString(key0); + if (testStringMap0 .get(key0) instanceof Utf8) { + (encoder).writeString(((Utf8) testStringMap0 .get(key0))); + } else { + (encoder).writeString(testStringMap0 .get(key0).toString()); + } + } + } + (encoder).writeMapEnd(); + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418.java deleted file mode 100644 index 223d526b4..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418.java +++ /dev/null @@ -1,52 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_8; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastSerializer; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Encoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyInsideUnionTest_GenericSerializer_4476580127917956418 - implements FastSerializer -{ - - - public void serialize(IndexedRecord data, Encoder encoder) - throws IOException - { - serializeFastStringableTest_javaStringPropertyInsideUnionTest0(data, (encoder)); - } - - @SuppressWarnings("unchecked") - public void serializeFastStringableTest_javaStringPropertyInsideUnionTest0(IndexedRecord data, Encoder encoder) - throws IOException - { - if (data.get(0) instanceof Utf8) { - (encoder).writeString(((Utf8) data.get(0))); - } else { - (encoder).writeString(data.get(0).toString()); - } - Integer favorite_number0 = ((Integer) data.get(1)); - if (favorite_number0 == null) { - (encoder).writeIndex(0); - (encoder).writeNull(); - } else { - (encoder).writeIndex(1); - (encoder).writeInt(((Integer) favorite_number0)); - } - CharSequence favorite_color0 = ((CharSequence) data.get(2)); - if (favorite_color0 == null) { - (encoder).writeIndex(0); - (encoder).writeNull(); - } else { - (encoder).writeIndex(1); - if (favorite_color0 instanceof Utf8) { - (encoder).writeString(((Utf8) favorite_color0)); - } else { - (encoder).writeString(favorite_color0 .toString()); - } - } - } - -} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759.java new file mode 100644 index 000000000..6b7cae46c --- /dev/null +++ b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759.java @@ -0,0 +1,79 @@ + +package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_8; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import com.linkedin.avro.fastserde.FastSerializer; +import org.apache.avro.generic.IndexedRecord; +import org.apache.avro.io.Encoder; +import org.apache.avro.util.Utf8; + +public class FastStringableTest_javaStringPropertyTest_GenericSerializer_3411107869155152759 + implements FastSerializer +{ + + + public void serialize(IndexedRecord data, Encoder encoder) + throws IOException + { + serializeFastStringableTest_javaStringPropertyTest0(data, (encoder)); + } + + @SuppressWarnings("unchecked") + public void serializeFastStringableTest_javaStringPropertyTest0(IndexedRecord data, Encoder encoder) + throws IOException + { + if (data.get(0) instanceof Utf8) { + (encoder).writeString(((Utf8) data.get(0))); + } else { + (encoder).writeString(data.get(0).toString()); + } + CharSequence testUnionString0 = ((CharSequence) data.get(1)); + if (testUnionString0 == null) { + (encoder).writeIndex(0); + (encoder).writeNull(); + } else { + (encoder).writeIndex(1); + if (testUnionString0 instanceof Utf8) { + (encoder).writeString(((Utf8) testUnionString0)); + } else { + (encoder).writeString(testUnionString0 .toString()); + } + } + List testStringArray0 = ((List ) data.get(2)); + (encoder).writeArrayStart(); + if ((testStringArray0 == null)||testStringArray0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringArray0 .size()); + for (int counter0 = 0; (counter0 testStringMap0 = ((Map ) data.get(3)); + (encoder).writeMapStart(); + if ((testStringMap0 == null)||testStringMap0 .isEmpty()) { + (encoder).setItemCount(0); + } else { + (encoder).setItemCount(testStringMap0 .size()); + for (CharSequence key0 : ((Map ) testStringMap0).keySet()) { + (encoder).startItem(); + (encoder).writeString(key0); + if (testStringMap0 .get(key0) instanceof Utf8) { + (encoder).writeString(((Utf8) testStringMap0 .get(key0))); + } else { + (encoder).writeString(testStringMap0 .get(key0).toString()); + } + } + } + (encoder).writeMapEnd(); + } + +} diff --git a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004.java b/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004.java deleted file mode 100644 index 176816610..000000000 --- a/avro-fastserde/src/codegen/java/com/linkedin/avro/fastserde/generated/serialization/AVRO_1_8/FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004.java +++ /dev/null @@ -1,32 +0,0 @@ - -package com.linkedin.avro.fastserde.generated.serialization.AVRO_1_8; - -import java.io.IOException; -import com.linkedin.avro.fastserde.FastSerializer; -import org.apache.avro.generic.IndexedRecord; -import org.apache.avro.io.Encoder; -import org.apache.avro.util.Utf8; - -public class FastStringableTest_javaStringPropertyTest_GenericSerializer_713665344968052004 - implements FastSerializer -{ - - - public void serialize(IndexedRecord data, Encoder encoder) - throws IOException - { - serializeFastStringableTest_javaStringPropertyTest0(data, (encoder)); - } - - @SuppressWarnings("unchecked") - public void serializeFastStringableTest_javaStringPropertyTest0(IndexedRecord data, Encoder encoder) - throws IOException - { - if (data.get(0) instanceof Utf8) { - (encoder).writeString(((Utf8) data.get(0))); - } else { - (encoder).writeString(data.get(0).toString()); - } - } - -} diff --git a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastDeserializerGenerator.java b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastDeserializerGenerator.java index c33286d64..56785f221 100644 --- a/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastDeserializerGenerator.java +++ b/avro-fastserde/src/main/java/com/linkedin/avro/fastserde/FastDeserializerGenerator.java @@ -176,7 +176,7 @@ private void processComplexType(JVar fieldSchemaVar, String name, Schema schema, } } - private void processSimpleType(Schema schema, JBlock methodBody, FieldAction action, + private void processSimpleType(Schema schema, Schema readerSchema, JBlock methodBody, FieldAction action, BiConsumer putExpressionIntoParent, Supplier reuseSupplier) { switch (schema.getType()) { case ENUM: @@ -186,7 +186,12 @@ private void processSimpleType(Schema schema, JBlock methodBody, FieldAction act processFixed(schema, methodBody, action, putExpressionIntoParent, reuseSupplier); break; default: - processPrimitive(schema, methodBody, action, putExpressionIntoParent, reuseSupplier); + // to preserve reader string specific options use reader field schema + if (action.getShouldRead() && readerSchema != null && Schema.Type.STRING.equals(readerSchema.getType())) { + processPrimitive(readerSchema, methodBody, action, putExpressionIntoParent, reuseSupplier); + } else { + processPrimitive(schema, methodBody, action, putExpressionIntoParent, reuseSupplier); + } break; } } @@ -303,7 +308,7 @@ private void processRecord(JVar recordSchemaVar, String recordName, final Schema processComplexType(fieldSchemaVar, field.name(), field.schema(), readerFieldSchema, methodBody, action, putExpressionInRecord, fieldReuseSupplier); } else { - processSimpleType(field.schema(), methodBody, action, putExpressionInRecord, fieldReuseSupplier); + processSimpleType(field.schema(), readerFieldSchema, methodBody, action, putExpressionInRecord, fieldReuseSupplier); } } @@ -542,7 +547,7 @@ private void processUnion(JVar unionSchemaVar, final String name, final Schema u processComplexType(optionSchemaVar, optionName, optionSchema, readerOptionSchema, thenBlock, unionAction, putValueIntoParent, reuseSupplier); } else { - processSimpleType(optionSchema, thenBlock, unionAction, putValueIntoParent, reuseSupplier); + processSimpleType(optionSchema, readerOptionSchema, thenBlock, unionAction, putValueIntoParent, reuseSupplier); } } } @@ -571,7 +576,7 @@ private void processArray(JVar arraySchemaVar, final String name, final Schema a action = FieldAction.fromValues(arraySchema.getElementType().getType(), false, EMPTY_SYMBOL); } - final JVar arrayVar = action.getShouldRead() ? declareValueVar(name, arraySchema, parentBody, true, false, true) : null; + final JVar arrayVar = action.getShouldRead() ? declareValueVar(name, readerArraySchema, parentBody, true, false, true) : null; /** * Special optimization for float array by leveraging {@link ByteBufferBackedPrimitiveFloatList}. * @@ -589,8 +594,8 @@ private void processArray(JVar arraySchemaVar, final String name, final Schema a return; } - JClass arrayClass = schemaAssistant.classFromSchema(arraySchema, false, false, true); - JClass abstractErasedArrayClass = schemaAssistant.classFromSchema(arraySchema, true, false, true).erasure(); + JClass arrayClass = schemaAssistant.classFromSchema(action.getShouldRead() ? readerArraySchema : arraySchema, false, false, true); + JClass abstractErasedArrayClass = schemaAssistant.classFromSchema(action.getShouldRead() ? readerArraySchema : arraySchema, true, false, true).erasure(); JVar chunkLen = parentBody.decl(codeModel.LONG, getUniqueName("chunkLen"), JExpr.direct(DECODER + ".readArrayStart()")); @@ -652,16 +657,18 @@ private void processArray(JVar arraySchemaVar, final String name, final Schema a elementReuseSupplier = () -> elementReuseVar; } + Schema readerArrayElementSchema = null; + if (finalAction.getShouldRead()) { + readerArrayElementSchema = readerArraySchema.getElementType(); + } + if (SchemaAssistant.isComplexType(arraySchema.getElementType())) { String elemName = name + "Elem"; - Schema readerArrayElementSchema = null; - if (finalAction.getShouldRead()) { - readerArrayElementSchema = readerArraySchema.getElementType(); - } + processComplexType(elementSchemaVar, elemName, arraySchema.getElementType(), readerArrayElementSchema, forBody, finalAction, putValueInArray, elementReuseSupplier); } else { - processSimpleType(arraySchema.getElementType(), forBody, finalAction, putValueInArray, elementReuseSupplier); + processSimpleType(arraySchema.getElementType(), readerArrayElementSchema, forBody, finalAction, putValueInArray, elementReuseSupplier); } whileLoopToIterateOnBlocks.body().assign(chunkLen, JExpr.direct(DECODER + ".arrayNext()")); @@ -723,7 +730,7 @@ private void processMap(JVar mapSchemaVar, final String name, final Schema mapSc action = FieldAction.fromValues(mapSchema.getValueType().getType(), false, EMPTY_SYMBOL); } - final JVar mapVar = action.getShouldRead() ? declareValueVar(name, mapSchema, parentBody) : null; + final JVar mapVar = action.getShouldRead() ? declareValueVar(name, readerMapSchema, parentBody) : null; JVar chunkLen = parentBody.decl(codeModel.LONG, getUniqueName("chunkLen"), JExpr.direct(DECODER + ".readMapStart()")); @@ -731,7 +738,7 @@ private void processMap(JVar mapSchemaVar, final String name, final Schema mapSc JBlock ifBlockForChunkLenCheck = conditional._then(); if (action.getShouldRead()) { - JVar reuse = declareValueVar(name + "Reuse", mapSchema, ifBlockForChunkLenCheck); + JVar reuse = declareValueVar(name + "Reuse", readerMapSchema, ifBlockForChunkLenCheck); // Check whether the reuse is a Map or not ifCodeGen(ifBlockForChunkLenCheck, @@ -745,7 +752,7 @@ private void processMap(JVar mapSchemaVar, final String name, final Schema mapSc thenBlock.invoke(reuse, "clear"); thenBlock.assign(mapVar, reuse); }, - elseBlock -> elseBlock.assign(mapVar, JExpr._new(schemaAssistant.classFromSchema(mapSchema, false))) + elseBlock -> elseBlock.assign(mapVar, JExpr._new(schemaAssistant.classFromSchema(readerMapSchema, false))) ); JBlock elseBlock = conditional._else(); @@ -759,12 +766,14 @@ private void processMap(JVar mapSchemaVar, final String name, final Schema mapSc forLoop.update(counter.incr()); JBlock forBody = forLoop.body(); - JClass keyClass = schemaAssistant.findStringClass(mapSchema); + JClass keyClass = schemaAssistant.findStringClass(action.getShouldRead() ? readerMapSchema : mapSchema); JExpression keyValueExpression; if (SchemaAssistant.hasStringableKey(mapSchema)) { keyValueExpression = readStringableExpression(keyClass); } else { - keyValueExpression = JExpr.direct(DECODER + ".readString(null)"); + keyValueExpression = codeModel.ref(String.class).equals(keyClass) ? + JExpr.direct(DECODER + ".readString()") + : JExpr.direct(DECODER + ".readString(null)"); } JVar key = forBody.decl(keyClass, getUniqueName("key"), keyValueExpression); @@ -773,20 +782,20 @@ private void processMap(JVar mapSchemaVar, final String name, final Schema mapSc mapValueSchemaVar = declareSchemaVar(mapSchema.getValueType(), name + "MapValueSchema", mapSchemaVar.invoke("getValueType")); } + BiConsumer putValueInMap = null; + Schema readerMapValueSchema = null; if (action.getShouldRead()) { putValueInMap = (block, expression) -> block.invoke(mapVar, "put").arg(key).arg(expression); + readerMapValueSchema = readerMapSchema.getValueType(); } + if (SchemaAssistant.isComplexType(mapSchema.getValueType())) { String valueName = name + "Value"; - Schema readerMapValueSchema = null; - if (action.getShouldRead()) { - readerMapValueSchema = readerMapSchema.getValueType(); - } processComplexType(mapValueSchemaVar, valueName, mapSchema.getValueType(), readerMapValueSchema, forBody, action, putValueInMap, EMPTY_SUPPLIER); } else { - processSimpleType(mapSchema.getValueType(), forBody, action, putValueInMap, EMPTY_SUPPLIER); + processSimpleType(mapSchema.getValueType(), readerMapValueSchema, forBody, action, putValueInMap, EMPTY_SUPPLIER); } doLoop.body().assign(chunkLen, JExpr.direct(DECODER + ".mapNext()")); if (action.getShouldRead()) { diff --git a/avro-fastserde/src/test/java/com/linkedin/avro/fastserde/FastStringableTest.java b/avro-fastserde/src/test/java/com/linkedin/avro/fastserde/FastStringableTest.java index ad267825b..e7999671e 100644 --- a/avro-fastserde/src/test/java/com/linkedin/avro/fastserde/FastStringableTest.java +++ b/avro-fastserde/src/test/java/com/linkedin/avro/fastserde/FastStringableTest.java @@ -15,6 +15,9 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + import org.apache.avro.Schema; import org.apache.avro.generic.GenericData; import org.apache.avro.generic.GenericDatumReader; @@ -35,7 +38,8 @@ public class FastStringableTest { private static final Schema javaStringSchema = Schema.parse("{\n" + " \"type\":\"string\",\n" + " \"avro.java.string\":\"String\"} "); - + private static final Schema javaStringKeyedMapOfJavaStringsSchema = Schema.parse("{"+ + "\"type\":\"map\",\"values\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"avro.java.string\":\"String\"}"); private File tempDir; private ClassLoader classLoader; @@ -143,11 +147,24 @@ public void serializeStringableFields() throws URISyntaxException, MalformedURLE } @Test(groups = {"deserializationTest"}, dataProvider = "SlowFastDeserializer") - public void javaStringPropertyTest(Boolean whetherUseFastDeserializer) throws IOException { - Schema schema = createRecord(createField("testString", javaStringSchema)); + @SuppressWarnings("unchecked") + public void javaStringPropertyTest(Boolean whetherUseFastDeserializer) { + Schema schema = createRecord( + createField("testString", javaStringSchema), + createUnionField("testUnionString", javaStringSchema), + createArrayFieldSchema("testStringArray", javaStringSchema), + createField("testStringMap", javaStringKeyedMapOfJavaStringsSchema) + ); GenericRecord record = new GenericData.Record(schema); record.put("testString", "aaa"); + record.put("testUnionString", "bbb"); + GenericData.Array stringArray = new GenericData.Array<>(0, Schema.createArray(javaStringSchema)); + stringArray.add("ccc"); + record.put("testStringArray", stringArray); + Map stringMap = new HashMap<>(); + stringMap.put("ddd", "eee"); + record.put("testStringMap", stringMap); Decoder decoder = writeWithFastAvro(record, schema, false); @@ -160,40 +177,82 @@ public void javaStringPropertyTest(Boolean whetherUseFastDeserializer) throws IO if (Utils.isAvro14()){ Assert.assertTrue(afterDecoding.get(0) instanceof Utf8, "Utf8 is expected, but got: " + afterDecoding.get(0).getClass()); + Assert.assertTrue(afterDecoding.get(1) instanceof Utf8, "Utf8 is expected, but got: " + afterDecoding.get(0).getClass()); + Assert.assertTrue(((GenericData.Array) afterDecoding.get(2)).get(0) instanceof Utf8, + "Utf8 is expected, but got: " + ((GenericData.Array) afterDecoding.get(2)).get(0).getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).keySet().iterator().next() instanceof Utf8, + "Utf8 is expected, but got: " + ((Map) afterDecoding.get(3)).keySet().iterator().next().getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).values().iterator().next() instanceof Utf8, + "Utf8 is expected, but got: " + ((Map) afterDecoding.get(3)).values().iterator().next().getClass()); } else { Assert.assertTrue(afterDecoding.get(0) instanceof String, "String is expected, but got: " + afterDecoding.get(0).getClass()); + Assert.assertTrue(afterDecoding.get(1) instanceof String, "String is expected, but got: " + afterDecoding.get(0).getClass()); + Assert.assertTrue(((GenericData.Array) afterDecoding.get(2)).get(0) instanceof String, + "String is expected, but got: " + ((GenericData.Array) afterDecoding.get(2)).get(0).getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).keySet().iterator().next() instanceof String, + "String is expected, but got: " + ((Map) afterDecoding.get(3)).keySet().iterator().next().getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).values().iterator().next() instanceof String, + "String is expected, but got: " + ((Map) afterDecoding.get(3)).values().iterator().next().getClass()); } } @Test(groups = {"deserializationTest"}, dataProvider = "SlowFastDeserializer") - public void javaStringPropertyInsideUnionTest(Boolean whetherUseFastDeserializer) { - Schema schema = createRecord( - createField("name", javaStringSchema), - createUnionField("favorite_number", Schema.create(Schema.Type.INT)), - createUnionField("favorite_color", javaStringSchema) + @SuppressWarnings("unchecked") + public void javaStringPropertyInReaderSchemaTest(Boolean whetherUseFastDeserializer) { + Schema writerSchema = createRecord( + createField("testString", Schema.create(Schema.Type.STRING)), + createUnionField("testUnionString", Schema.create(Schema.Type.STRING)), + createArrayFieldSchema("testStringArray", Schema.create(Schema.Type.STRING)), + createMapFieldSchema("testStringMap", Schema.create(Schema.Type.STRING)) + ); + Schema readerSchema = createRecord( + createField("testString", javaStringSchema), + createUnionField("testUnionString", javaStringSchema), + createArrayFieldSchema("testStringArray", javaStringSchema), + createField("testStringMap", javaStringKeyedMapOfJavaStringsSchema) ); - GenericRecord record = new GenericData.Record(schema); - record.put("name", "test_user"); - record.put("favorite_number", 10); - record.put("favorite_color", "blue"); - Decoder decoder = writeWithFastAvro(record, schema, false); + + GenericRecord record = new GenericData.Record(writerSchema); + record.put("testString", "aaa"); + record.put("testUnionString", "bbb"); + GenericData.Array stringArray = new GenericData.Array<>(0, Schema.createArray(Schema.create(Schema.Type.STRING))); + stringArray.add("ccc"); + record.put("testStringArray", stringArray); + Map stringMap = new HashMap<>(); + stringMap.put("ddd", "eee"); + record.put("testStringMap", stringMap); + + Decoder decoder = writeWithFastAvro(record, writerSchema, false); GenericRecord afterDecoding; if (whetherUseFastDeserializer) { - afterDecoding = readWithFastAvro(schema, schema, decoder, false); + afterDecoding = readWithFastAvro(writerSchema, readerSchema, decoder, false); } else { - afterDecoding = readWithSlowAvro(schema, schema, decoder, false); + afterDecoding = readWithSlowAvro(writerSchema, readerSchema, decoder, false); } if (Utils.isAvro14()){ Assert.assertTrue(afterDecoding.get(0) instanceof Utf8, "Utf8 is expected, but got: " + afterDecoding.get(0).getClass()); - Assert.assertTrue(afterDecoding.get(2) instanceof Utf8, "Utf8 is expected, but got: " + afterDecoding.get(2).getClass()); + Assert.assertTrue(afterDecoding.get(1) instanceof Utf8, "Utf8 is expected, but got: " + afterDecoding.get(0).getClass()); + Assert.assertTrue(((GenericData.Array) afterDecoding.get(2)).get(0) instanceof Utf8, + "Utf8 is expected, but got: " + ((GenericData.Array) afterDecoding.get(2)).get(0).getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).keySet().iterator().next() instanceof Utf8, + "Utf8 is expected, but got: " + ((Map) afterDecoding.get(3)).keySet().iterator().next().getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).values().iterator().next() instanceof Utf8, + "Utf8 is expected, but got: " + ((Map) afterDecoding.get(3)).values().iterator().next().getClass()); } else { Assert.assertTrue(afterDecoding.get(0) instanceof String, "String is expected, but got: " + afterDecoding.get(0).getClass()); - Assert.assertTrue(afterDecoding.get(2) instanceof String, "String is expected, but got: " + afterDecoding.get(2).getClass()); + Assert.assertTrue(afterDecoding.get(1) instanceof String, "String is expected, but got: " + afterDecoding.get(0).getClass()); + Assert.assertTrue(((GenericData.Array) afterDecoding.get(2)).get(0) instanceof String, + "String is expected, but got: " + ((GenericData.Array) afterDecoding.get(2)).get(0).getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).keySet().iterator().next() instanceof String, + "String is expected, but got: " + ((Map) afterDecoding.get(3)).keySet().iterator().next().getClass()); + Assert.assertTrue(((Map) afterDecoding.get(3)).values().iterator().next() instanceof String, + "String is expected, but got: " + ((Map) afterDecoding.get(3)).values().iterator().next().getClass()); } } + @Test(groups = {"deserializationTest"}, dataProvider = "SlowFastDeserializer") public void deserializeStringableFields(Boolean whetherUseFastDeserializer) throws URISyntaxException, MalformedURLException { @@ -281,7 +340,7 @@ public T readWithFastAvro(Schema writerSchema, Schema readerSchema, Decoder } } - private T readWithSlowAvro(Schema readerSchema, Schema writerSchema, Decoder decoder, boolean specific) { + private T readWithSlowAvro(Schema writerSchema, Schema readerSchema, Decoder decoder, boolean specific) { DatumReader datumReader; if (specific) { datumReader = new SpecificDatumReader<>(writerSchema, readerSchema);