Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,10 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog {
if (!dataTypesAreCompatibleFn(dt1, dt2)) {
val errorMessage =
s"""
|${operator.nodeName} can only be performed on tables with the compatible
|${operator.nodeName} can only be performed on tables with compatible
|column types. The ${ordinalNumber(ci)} column of the
|${ordinalNumber(ti + 1)} table is ${dt1.catalogString} type which is not
|compatible with ${dt2.catalogString} at same column of first table
|compatible with ${dt2.catalogString} at the same column of the first table
""".stripMargin.replace("\n", " ").trim()
failAnalysis(errorMessage + extraHintForAnsiTypeCoercionPlan(operator))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,32 +398,32 @@ class AnalysisErrorSuite extends AnalysisTest {
errorTest(
"union with incompatible column types",
testRelation.union(nestedRelation),
"union" :: "the compatible column types" :: Nil)
"union" :: "compatible column types" :: Nil)

errorTest(
"union with a incompatible column type and compatible column types",
testRelation3.union(testRelation4),
"union" :: "the compatible column types" :: "map" :: "decimal" :: Nil)
"union" :: "compatible column types" :: "map" :: "decimal" :: Nil)

errorTest(
"intersect with incompatible column types",
testRelation.intersect(nestedRelation, isAll = false),
"intersect" :: "the compatible column types" :: Nil)
"intersect" :: "compatible column types" :: Nil)

errorTest(
"intersect with a incompatible column type and compatible column types",
testRelation3.intersect(testRelation4, isAll = false),
"intersect" :: "the compatible column types" :: "map" :: "decimal" :: Nil)
"intersect" :: "compatible column types" :: "map" :: "decimal" :: Nil)

errorTest(
"except with incompatible column types",
testRelation.except(nestedRelation, isAll = false),
"except" :: "the compatible column types" :: Nil)
"except" :: "compatible column types" :: Nil)

errorTest(
"except with a incompatible column type and compatible column types",
testRelation3.except(testRelation4, isAll = false),
"except" :: "the compatible column types" :: "map" :: "decimal" :: Nil)
"except" :: "compatible column types" :: "map" :: "decimal" :: Nil)

errorClassTest(
"SPARK-9955: correct error message for aggregate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -926,29 +926,29 @@ class AnalysisSuite extends AnalysisTest with Matchers {
val r5 = Intersect(firstTable, secondTable, isAll = false)

assertAnalysisError(r1,
Seq("Union can only be performed on tables with the compatible column types. " +
Seq("Union can only be performed on tables with compatible column types. " +
"The second column of the second table is timestamp type which is not compatible " +
"with double at same column of first table"))
"with double at the same column of the first table"))

assertAnalysisError(r2,
Seq("Union can only be performed on tables with the compatible column types. " +
Seq("Union can only be performed on tables with compatible column types. " +
"The third column of the second table is timestamp type which is not compatible " +
"with int at same column of first table"))
"with int at the same column of the first table"))

assertAnalysisError(r3,
Seq("Union can only be performed on tables with the compatible column types. " +
Seq("Union can only be performed on tables with compatible column types. " +
"The 4th column of the second table is timestamp type which is not compatible " +
"with float at same column of first table"))
"with float at the same column of the first table"))

assertAnalysisError(r4,
Seq("Except can only be performed on tables with the compatible column types. " +
Seq("Except can only be performed on tables with compatible column types. " +
"The second column of the second table is timestamp type which is not compatible " +
"with double at same column of first table"))
"with double at the same column of the first table"))

assertAnalysisError(r5,
Seq("Intersect can only be performed on tables with the compatible column types. " +
Seq("Intersect can only be performed on tables with compatible column types. " +
"The second column of the second table is timestamp type which is not compatible " +
"with double at same column of first table"))
"with double at the same column of the first table"))
}

test("SPARK-31975: Throw user facing error when use WindowFunction directly") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ SELECT array(1)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
ExceptAll can only be performed on tables with the compatible column types. The first column of the second table is array<int> type which is not compatible with int at same column of first table
ExceptAll can only be performed on tables with compatible column types. The first column of the second table is array<int> type which is not compatible with int at the same column of the first table


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ SELECT array(1), 2
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
IntersectAll can only be performed on tables with the compatible column types. The first column of the second table is array<int> type which is not compatible with int at same column of first table
IntersectAll can only be performed on tables with compatible column types. The first column of the second table is array<int> type which is not compatible with int at the same column of the first table


-- !query
Expand Down
Loading