You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by HyukjinKwon <gi...@git.apache.org> on 2018/10/03 09:00:53 UTC
[GitHub] spark pull request #22619: [SPARK-25600][SQL][MINOR] Make use of TypeCoercio...
Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/22619#discussion_r222231401
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVInferSchema.scala ---
@@ -172,35 +172,27 @@ private[csv] object CSVInferSchema {
StringType
}
- private val numericPrecedence: IndexedSeq[DataType] = TypeCoercion.numericPrecedence
+ /**
+ * Returns the common data type given two input data types so that the return type
+ * is compatible with both input data types.
+ */
+ private def compatibleType(t1: DataType, t2: DataType): Option[DataType] = {
+ TypeCoercion.findTightestCommonType(t1, t2).orElse (findCompatibleTypeForCSV(t1, t2))
--- End diff --
nit: `e (` -> `e(`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org