Regression in 1.3.3 from 1.3.2: Removing a field can result in a
ClassCastException
-----------------------------------------------------------------------------------
Key: AVRO-591
URL: https://issues.apache.org/jira/browse/AVRO-591
Project: Avro
Issue Type: Bug
Components: java
Affects Versions: 1.3.3
Environment: Mac OS X 10.6, JDK 1.6_20
Reporter: Sam Pullara
Fix For: 1.4.0
Stored as:
{
"type":"record",
"name":"User",
"namespace":"bagcheck",
"fields": [
{
"name":"firstName",
"type":"string",
"default": ""
},
{
"name":"lastName",
"type":"string",
"default": ""
},
{
"name":"email",
"type":"string",
"default": ""
},
{
"name":"mobile",
"type":["string", "null"],
"default": "null"
}
]
}
Loaded as:
{
"type":"record",
"name":"User",
"namespace":"bagcheck",
"fields": [
{
"name":"firstName",
"type":"string",
"default": ""
},
{
"name":"lastName",
"type":"string",
"default": ""
},
{
"name":"email",
"type":"string",
"default": ""
}
]
}
java.lang.ClassCastException: org.apache.avro.io.parsing.Symbol$Alternative
cannot be cast to org.apache.avro.io.parsing.Symbol$UnionAdjustAction
at
org.apache.avro.io.ResolvingDecoder.readIndex(ResolvingDecoder.java:188)
at
org.apache.avro.io.ParsingDecoder.skipTopSymbol(ParsingDecoder.java:66)
at org.apache.avro.io.parsing.SkipParser.skipTo(SkipParser.java:71)
at org.apache.avro.io.parsing.SkipParser.skipSymbol(SkipParser.java:93)
at
org.apache.avro.io.ResolvingDecoder.doAction(ResolvingDecoder.java:207)
at
org.apache.avro.io.parsing.Parser.processImplicitActions(Parser.java:116)
at org.apache.avro.io.ResolvingDecoder.drain(ResolvingDecoder.java:141)
at
org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:72)
at havrobase.HABTest.testSchemolution(HABTest.java:224)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:64)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.