Github user jaceklaskowski commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21815#discussion_r203664621
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/DataSourceScanExec.scala 
---
    @@ -166,10 +166,10 @@ case class FileSourceScanExec(
         override val tableIdentifier: Option[TableIdentifier])
       extends DataSourceScanExec with ColumnarBatchScan  {
     
    -  override val supportsBatch: Boolean = relation.fileFormat.supportBatch(
    +  override lazy val supportsBatch: Boolean = 
relation.fileFormat.supportBatch(
         relation.sparkSession, StructType.fromAttributes(output))
     
    -  override val needsUnsafeRowConversion: Boolean = {
    +  override lazy val needsUnsafeRowConversion: Boolean = {
         if (relation.fileFormat.isInstanceOf[ParquetSource]) {
           
SparkSession.getActiveSession.get.sessionState.conf.parquetVectorizedReaderEnabled
    --- End diff --
    
    Since you mentioned `SparkSession`, that line caught my attention where the 
active `SparkSession` is accessed using `SparkSession.getActiveSession.get` not 
`relation.sparkSession` as is the case for other places. I think that's 
something worth considering changing since we're at it.


---

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

Reply via email to