Skip to content

Commit 87d3fc8

Browse files
committed
Swap names (infer and inferSchema)
1 parent 04e620c commit 87d3fc8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVDataSource.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ abstract class CSVDataSource extends Serializable {
5454
/**
5555
* Infers the schema from `inputPaths` files.
5656
*/
57-
final def infer(
57+
final def inferSchema(
5858
sparkSession: SparkSession,
5959
inputPaths: Seq[FileStatus],
6060
parsedOptions: CSVOptions): Option[StructType] = {
6161
if (inputPaths.nonEmpty) {
62-
Some(inferSchema(sparkSession, inputPaths, parsedOptions))
62+
Some(infer(sparkSession, inputPaths, parsedOptions))
6363
} else {
6464
None
6565
}
6666
}
6767

68-
protected def inferSchema(
68+
protected def infer(
6969
sparkSession: SparkSession,
7070
inputPaths: Seq[FileStatus],
7171
parsedOptions: CSVOptions): StructType
@@ -139,7 +139,7 @@ object TextInputCSVDataSource extends CSVDataSource {
139139
UnivocityParser.parseIterator(lines, shouldDropHeader, parser)
140140
}
141141

142-
override def inferSchema(
142+
override def infer(
143143
sparkSession: SparkSession,
144144
inputPaths: Seq[FileStatus],
145145
parsedOptions: CSVOptions): StructType = {
@@ -210,7 +210,7 @@ object WholeFileCSVDataSource extends CSVDataSource {
210210
parser)
211211
}
212212

213-
override def inferSchema(
213+
override def infer(
214214
sparkSession: SparkSession,
215215
inputPaths: Seq[FileStatus],
216216
parsedOptions: CSVOptions): StructType = {

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVFileFormat.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class CSVFileFormat extends TextBasedFileFormat with DataSourceRegister {
5454
val parsedOptions =
5555
new CSVOptions(options, sparkSession.sessionState.conf.sessionLocalTimeZone)
5656

57-
CSVDataSource(parsedOptions).infer(sparkSession, files, parsedOptions)
57+
CSVDataSource(parsedOptions).inferSchema(sparkSession, files, parsedOptions)
5858
}
5959

6060
override def prepareWrite(

0 commit comments

Comments
 (0)