Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/12268#discussion_r61258077
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/InferSchema.scala
---
@@ -30,22 +30,37 @@ import org.apache.spark.sql.catalyst.util.DateTimeUtils
import org.apache.spark.sql.types._
import org.apache.spark.unsafe.types.UTF8String
-private[csv] object CSVInferSchema {
+private[csv] object InferSchema {
/**
* Similar to the JSON schema inference
* 1. Infer type of each row
* 2. Merge row types to find common type
* 3. Replace any null types with string type
*/
- def infer(
- tokenRdd: RDD[Array[String]],
- header: Array[String],
- nullValue: String = ""): StructType = {
+ def infer(csv: RDD[String], options: CSVOptions): StructType = {
--- End diff --
This looks very similar to `DefaultSource.inferSchema` why not move the
common functionality into a single method?
---
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]