Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/16976#discussion_r102666106
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala
---
@@ -43,23 +37,26 @@ class CSVFileFormat extends TextBasedFileFormat with
DataSourceRegister {
override def shortName(): String = "csv"
- override def toString: String = "CSV"
-
- override def hashCode(): Int = getClass.hashCode()
-
- override def equals(other: Any): Boolean =
other.isInstanceOf[CSVFileFormat]
+ override def isSplitable(
+ sparkSession: SparkSession,
+ options: Map[String, String],
+ path: Path): Boolean = {
+ val parsedOptions =
+ new CSVOptions(options,
sparkSession.sessionState.conf.sessionLocalTimeZone)
+ val csvDataSource = CSVDataSource(parsedOptions)
+ csvDataSource.isSplitable && super.isSplitable(sparkSession, options,
path)
+ }
override def inferSchema(
sparkSession: SparkSession,
options: Map[String, String],
files: Seq[FileStatus]): Option[StructType] = {
require(files.nonEmpty, "Cannot infer schema from an empty set of
files")
--- End diff --
This is not related with this JIRA itself. I would like to avoid other
additional changes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]