Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avro compiler plugin should throw an error instead of warning when an unsupported data type is encountered #39

Open
rxin opened this issue Nov 13, 2010 · 1 comment

Comments

@rxin
Copy link
Member

rxin commented Nov 13, 2010

I defined the following class in Messages.scala. Note that Class[_] is not
supported:

case class MapRequest(
    var minKey: Option[Array[Byte]],
    var maxKey: Option[Array[Byte]],
    var mapper: Class[_])
extends AvroRecord with KeyValueStoreOperation

Instead of throwing an error, the compiler plugin printed just an info message,
causing many other compilation errors later on.

[INFO] java.lang.reflect.InvocationTargetException
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
[INFO]  at org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:161)
[INFO]  at org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO] Caused by: java.lang.UnsupportedOperationException: Cannot support yet: Class[_]
[INFO]  at edu.berkeley.cs.avro.plugin.SchemaGen$SchemaGenTransformer.edu$berkeley$cs$avro$plugin$SchemaGen$SchemaGenTransformer$$createSchema(SchemaGen.scala:115)
[INFO]  at edu.berkeley.cs.avro.plugin.SchemaGen$SchemaGenTransformer$$anonfun$4.apply(SchemaGen.scala:135)
[INFO]  at edu.berkeley.cs.avro.plugin.SchemaGen$SchemaGenTransformer$$anonfun$4.apply(SchemaGen.scala:133)
[INFO]  at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
[INFO]  at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206)
[INFO]  at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
[INFO]  at scala.collection.immutable.List.foreach(List.scala:45)
[INFO]  at scala.collection.TraversableLike$class.map(TraversableLike.scala:206)
[INFO]  at scala.collection.immutable.List.map(List.scala:45)
[INFO]  at edu.berkeley.cs.avro.plugin.SchemaGen$SchemaGenTransformer.transform(SchemaGen.scala:133)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:856)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:854)
[INFO]  at scala.collection.immutable.List.loop$1(List.scala:115)
[INFO]  at scala.collection.immutable.List.mapConserve(List.scala:132)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transformStats(Trees.scala:854)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:728)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:728)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:864)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:727)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$2.apply(TypingTransformers.scala:51)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$2.apply(TypingTransformers.scala:51)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.atOwner(Trees.scala:864)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
[INFO]  at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:51)
[INFO]  at edu.berkeley.cs.avro.plugin.SchemaGen$SchemaGenTransformer.transform(SchemaGen.scala:157)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:857)
[INFO]  at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
[INFO]  at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:276)
[INFO]  at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:276)
[INFO]  at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:48)
[INFO]  at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:276)
[INFO]  at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:252)
[INFO]  at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:252)
[INFO]  at scala.collection.Iterator$class.foreach(Iterator.scala:631)
[INFO]  at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:304)
[INFO]  at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:252)
[INFO]  at scala.tools.nsc.Global$Run.compileSources(Global.scala:733)
[INFO]  at scala.tools.nsc.Global$Run.compile(Global.scala:813)
[INFO]  at scala.tools.nsc.Main$.process(Main.scala:108)
[INFO]  at scala.tools.nsc.Main$.main(Main.scala:122)
[INFO]  at scala.tools.nsc.Main.main(Main.scala)
[INFO]  ... 6 more
[INFO] prepare-compile in 0 s
[INFO] compile in 11 s
@rxin
Copy link
Member Author

rxin commented Nov 15, 2010

Did guthub just lose your comment, Stephen? I don't see it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant