In record reader level you can pass the file name as key or value. 

 sc.newAPIHadoopRDD(job.getConfiguration,
        classOf[AvroKeyInputFormat[myObject]],
        classOf[AvroKey[myObject]],
        classOf[Text] // can contain your file) 

AvroKeyInputFormat extends InputFormat<AvroKey[myObject], Text> 
{
   cretaRecordReader(){ return new YourRecordReader()}
 }

YourRecordReader extends RecordReader<AvroKey[myObject], Text>{

 initialize(){
  Path file = inputSplit.getPath() ; // you can pass this file as a value
from your record reader 
  }
 
}



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/newAPIHadoopRDD-file-name-tp22556p22567.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

Reply via email to