Hi Ted thanks much for the reply. I cant share code on public forum. I have created custom format by extending Hadoop mapred InputFormat class and same way RecordReader class. If you can help me how do I use the same in DataFrame it would be very helpful.
On Sat, Aug 1, 2015 at 12:12 AM, Ted Yu <yuzhih...@gmail.com> wrote: > Can you pastebin the complete stack trace ? > > If you can show skeleton of MyInputFormat and MyRecordWritable, that > would provide additional information as well. > > Cheers > > On Fri, Jul 31, 2015 at 11:24 AM, unk1102 <umesh.ka...@gmail.com> wrote: > >> Hi I am having my own Hadoop custom InputFormat which I need to use in >> creating DataFrame. I tried to do the following >> >> JavaPairRDD<Void,MyRecordWritable> myFormatAsPairRdd = >> >> jsc.hadoopFile("hdfs://tmp/data/myformat.xyz",MyInputFormat.class,Void.class,MyRecordWritable.class); >> JavaRDD<MyRecordWritable> myformatRdd = myFormatAsPairRdd.values(); >> DataFrame myFormatAsDataframe = >> sqlContext.createDataFrame(myformatRdd,MyFormatSchema.class); >> myFormatAsDataframe.show(); >> >> Above code does not work and throws exception saying >> java.lang.IllegalArgumentException object is not an instance of declaring >> class >> >> My custom Hadoop InputFormat works very well with Hive,MapReduce etc How >> do >> I make it work with Spark please guide I am new to Spark. Thank in >> advance. >> >> >> >> >> -- >> View this message in context: >> http://apache-spark-user-list.1001560.n3.nabble.com/How-to-create-Spark-DataFrame-using-custom-Hadoop-InputFormat-tp24101.html >> Sent from the Apache Spark User List mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@spark.apache.org >> For additional commands, e-mail: user-h...@spark.apache.org >> >> >