You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2018/05/03 10:12:16 UTC
[GitHub] spark pull request #21190: [SPARK-22938][SQL][followup] Assert that SQLConf....
Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/21190#discussion_r185750124
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala ---
@@ -102,22 +105,32 @@ object TypeCoercion {
case (_: TimestampType, _: DateType) | (_: DateType, _: TimestampType) =>
Some(TimestampType)
- case (t1 @ StructType(fields1), t2 @ StructType(fields2)) if t1.sameType(t2) =>
- Some(StructType(fields1.zip(fields2).map { case (f1, f2) =>
- // Since `t1.sameType(t2)` is true, two StructTypes have the same DataType
- // except `name` (in case of `spark.sql.caseSensitive=false`) and `nullable`.
- // - Different names: use f1.name
- // - Different nullabilities: `nullable` is true iff one of them is nullable.
- val dataType = findTightestCommonType(f1.dataType, f2.dataType).get
- StructField(f1.name, dataType, nullable = f1.nullable || f2.nullable)
- }))
+ case (t1 @ StructType(fields1), t2 @ StructType(fields2)) =>
+ val isSameType = if (caseSensitive) {
+ t1.sameType(t2)
--- End diff --
Call `DataType.equalsIgnoreNullability` here for better show the difference between the call of `DataType.equalsIgnoreCaseAndNullability` below?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org