melihsozdinler commented on code in PR #42336:
URL: https://github.com/apache/spark/pull/42336#discussion_r1285819479


##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveFileFormat.scala:
##########
@@ -122,6 +130,23 @@ class HiveFileFormat(fileSinkConf: FileSinkDesc)
       case _ => true
     }
   }
+
+  private def configureFileExtension(conf: Configuration): Unit = {
+    fileSinkConf.getTableInfo.getOutputFileFormatClassName match {
+      case "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"
+        if SQLConf.get.getConf(HiveUtils.HIVE_PARQUET_FILE_EXTENSION_ENABLED) 
=>
+        conf.set("hive.output.file.extension",
+          CodecConfig.from(new JobConf(conf)).getCodec.getExtension + 
".parquet")

Review Comment:
   .parquet and .orc are repeated in many places as a magic string, there are 
classes like OrcUtils and ParquetUtils can provide the file extension with a 
new function.



-- 
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]

Reply via email to