dongjoon-hyun commented on code in PR #51398:
URL: https://github.com/apache/spark/pull/51398#discussion_r2192696021
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormat.scala:
##########
@@ -235,6 +235,20 @@ trait FileFormat {
*/
def fileConstantMetadataExtractors: Map[String, PartitionedFile => Any] =
FileFormat.BASE_METADATA_EXTRACTORS
+
+ protected def sessionState(sparkSession: SparkSession): SessionState = {
+ sparkSession.sessionState
+ }
+
+ protected def sqlConf(sparkSession: SparkSession): SQLConf = {
+ sessionState(sparkSession).conf
+ }
+
+ protected def hadoopConf(
+ sparkSession: SparkSession,
+ options: Map[String, String]): Configuration = {
+ sessionState(sparkSession).newHadoopConfWithOptions(options)
+ }
Review Comment:
ditto. This method has no relation to any underlying objects or `trait
FileFormat` directly. We had better put this outside independently with the
above `sessionState` and `sqlConf` methods
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]