Description
Currently, in `CheckAnalysis` method getDataTypesAreCompatibleFn implemented as:
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 } }
Return false when data types are compatible, otherwise return true, which is pretty confusing.