You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/29 07:37:42 UTC

[GitHub] [spark] advancedxy commented on a change in pull request #25616: [SPARK-28907] Review invalid usage of new Configuration()

advancedxy commented on a change in pull request #25616: [SPARK-28907] Review invalid usage of new Configuration()
URL: https://github.com/apache/spark/pull/25616#discussion_r318925606
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/input/WholeTextFileRecordReader.scala
 ##########
 @@ -108,8 +108,17 @@ private[spark] class ConfigurableCombineFileRecordReader[K, V](
   override def initNextRecordReader(): Boolean = {
     val r = super.initNextRecordReader()
     if (r) {
-      this.curReader.asInstanceOf[HConfigurable].setConf(getConf)
+      if (getConf != null) {
+        this.curReader.asInstanceOf[HConfigurable].setConf(getConf)
 
 Review comment:
   This is needed because `initNextRecordReader` could be called in the constructor, which `getConf` would be null.
   
   We have to override `setConf` too to set conf for the first reader.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org