You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2024/12/19 19:22:55 UTC
Re: [PR] [SPARK-50616][SQL] Add File Extension Option to CSV DataSource Writer [spark]
MaxGekk commented on code in PR #49233:
URL: https://github.com/apache/spark/pull/49233#discussion_r1893025455
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala:
##########
@@ -86,7 +86,7 @@ class CSVFileFormat extends TextBasedFileFormat with DataSourceRegister {
}
override def getFileExtension(context: TaskAttemptContext): String = {
- ".csv" + CodecStreams.getCompressionExtension(context)
+ "." + csvOptions.fileExtension + CodecStreams.getCompressionExtension(context)
Review Comment:
In this way, the user can overwrite almost anything in the file system:
```
./../../../../../path/<file to overwrite>.xz
```
Should we do some sanity check of the option?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org