Hi CDAP team ... your help would be greatly appreciated.
Simple SparkSQL program has runtime exceptions reading from Avro and writing to Avro datasets,
with the Exceptions being as listed below. Have tried various explicit dependency inclusion, and scope options in the pom. Simple source code & POM attached, stripped down from examples/SparkPageRank.a)On read [SRC: DataFrame df = sqlContext.read().format("com.databricks.spark.avro").load("people.avro");]| Diagnostics: | User class threw exception: java.lang.NoClassDefFoundError: org/apache/avro/mapred/FsInput |
|---|
b)On write [SRC: df.write().options(avroParams).format("com.databricks.spark.avro").save("df-avro-test-dir");]
User class threw exception: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: org/apache/avro/SchemaBuilder$NamespacedBuilder.completeSchema(Lorg/apache/avro/Schema;)Lorg/apache/avro/Schema; @2: invokevirtual Reason: Type 'org/apache/avro/Schema' (current frame, stack[1]) is not assignable to 'org/apache/avro/JsonProperties' Current Frame: bci: @2 flags: { } locals: { 'org/apache/avro/SchemaBuilder$NamespacedBuilder', 'org/apache/avro/Schema' } stack: { 'org/apache/avro/SchemaBuilder$NamespacedBuilder', 'org/apache/avro/Schema' } Bytecode: 0000000: 2a2b b600 0857 2a2b b600 0957 2ab6 0006 0000010: 2bb8 000a 2bb0
--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/cdbb7eb7-4ac2-4dd8-ba24-3dd512656550%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Avro-Jar-Probs.png>
--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/f50b73a1-79b1-446b-a1f0-157a1b9d8606%40googlegroups.com.
Hi Manoj,In short, only classes in the cdap-api artifact, hadoop classes (org.apache.hadoop.*, except hbase) and Spark classes (those inside the spark-assembly jar, only for spark programs) are available to user program and nothing else. The class loading model in CDAP is hierarchical instead of a flat classpath in order to support class isolation (e.g. a program can uses different guava version then the one used by the underlying platform).Here are more information about the class loading model.Terence
On Jul 6, 2016, at 6:36 AM, Manoj Seshan <manoj...@thomsonreuters.com> wrote:
Thanks Terence - I used your POM, and the code worked. That's a lot of dependencies that needed to be included / excluded. Would you be able to point us to tools that you use to figure out the ClassPath that the CDAP class loader is using?
On Tuesday, July 5, 2016 at 11:08:10 PM UTC+5:30, Terence Yim wrote:Hi Manoj,Sorry that I missed the attached pom file. From the pom file and the jar file content, it seems correct to me. I’ve tried to reproduce the problem on both Spark 1.5.2 and Spark 1.6.2 (w/ Hadoop 2.6) and both ran successfully. I’ve attached the project and the instructions for your to try it out.Regarding the classpath, CDAP has it own ClassLoader for program execution, which doesn’t rely on the system classpath, hence it’s normal that you don’t see the application jars in the system classpath.Terence--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap...@googlegroups.com.