You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Gengliang Wang (Jira)" <ji...@apache.org> on 2022/03/07 14:18:00 UTC
[jira] [Resolved] (SPARK-38434) Correct semantic of CheckAnalysis.getDataTypesAreCompatibleFn method
[ https://issues.apache.org/jira/browse/SPARK-38434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gengliang Wang resolved SPARK-38434.
------------------------------------
Fix Version/s: 3.3.0
Resolution: Fixed
Issue resolved by pull request 35752
[https://github.com/apache/spark/pull/35752]
> Correct semantic of CheckAnalysis.getDataTypesAreCompatibleFn method
> --------------------------------------------------------------------
>
> Key: SPARK-38434
> URL: https://issues.apache.org/jira/browse/SPARK-38434
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 3.2.1
> Reporter: huangtengfei
> Assignee: huangtengfei
> Priority: Minor
> Fix For: 3.3.0
>
>
> Currently, in `CheckAnalysis` method [getDataTypesAreCompatibleFn |https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala#L606] implemented as:
> {code:java}
> private def getDataTypesAreCompatibleFn(plan: LogicalPlan): (DataType, DataType) => Boolean = {
> val isUnion = plan.isInstanceOf[Union]
> if (isUnion) {
> (dt1: DataType, dt2: DataType) =>
> !DataType.equalsStructurally(dt1, dt2, true)
> } else {
> // SPARK-18058: we shall not care about the nullability of columns
> (dt1: DataType, dt2: DataType) =>
> TypeCoercion.findWiderTypeForTwo(dt1.asNullable, dt2.asNullable).isEmpty
> }
> }
> {code}
> Return false when data types are compatible, otherwise return true, which is pretty confusing.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org