diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala index f741c5c3975e..77b775f6c49f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala @@ -2140,7 +2140,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat errorClass = "INCOMPATIBLE_TABLE_CHANGE_AFTER_ANALYSIS.COLUMNS_MISMATCH", messageParameters = Map( "tableName" -> toSQLId(tableName), - "errors" -> errors.mkString("\n- ", "\n- ", ""))) + "errors" -> errors.mkString("- ", "\n- ", ""))) } def metadataColumnsChangedAfterAnalysis( @@ -2150,7 +2150,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat errorClass = "INCOMPATIBLE_TABLE_CHANGE_AFTER_ANALYSIS.METADATA_COLUMNS_MISMATCH", messageParameters = Map( "tableName" -> toSQLId(tableName), - "errors" -> errors.mkString("\n- ", "\n- ", ""))) + "errors" -> errors.mkString("- ", "\n- ", ""))) } def numberOfPartitionsNotAllowedWithUnspecifiedDistributionError(): Throwable = { @@ -4477,7 +4477,7 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat "viewName" -> toSQLId(viewName), "tableName" -> toSQLId(tableName), "colType" -> "data", - "errors" -> errors.mkString("\n- ", "\n- ", ""))) + "errors" -> errors.mkString("- ", "\n- ", ""))) } def metadataColumnsChangedAfterViewWithPlanCreation( @@ -4490,6 +4490,6 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat "viewName" -> toSQLId(viewName), "tableName" -> toSQLId(tableName), "colType" -> "metadata", - "errors" -> errors.mkString("\n- ", "\n- ", ""))) + "errors" -> errors.mkString("- ", "\n- ", ""))) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala index d802a9a7d75f..65078f222fa6 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala @@ -1117,7 +1117,7 @@ class DataSourceV2DataFrameSuite condition = "INCOMPATIBLE_TABLE_CHANGE_AFTER_ANALYSIS.COLUMNS_MISMATCH", parameters = Map( "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", - "errors" -> "\n- `extra` STRING has been removed")) + "errors" -> "- `extra` STRING has been removed")) } } @@ -1141,8 +1141,7 @@ class DataSourceV2DataFrameSuite parameters = Map( "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "errors" -> - """ - |- `new_col1` INT has been added + """- `new_col1` INT has been added |- `new_col2` INT has been added""".stripMargin)) } } @@ -1167,8 +1166,7 @@ class DataSourceV2DataFrameSuite parameters = Map( "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "errors" -> - """ - |- `col4` STRING has been removed + """- `col4` STRING has been removed |- `col5` INT has been added""".stripMargin)) } } @@ -1195,9 +1193,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> - """ - |- `extra` INT has been added""".stripMargin)) + "errors" -> "- `extra` INT has been added")) } } @@ -1220,7 +1216,7 @@ class DataSourceV2DataFrameSuite parameters = Map( "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "errors" -> - ("\n- `person` type has changed from STRUCT " + + ("- `person` type has changed from STRUCT " + "to STRUCT"))) } } @@ -1270,7 +1266,7 @@ class DataSourceV2DataFrameSuite condition = "INCOMPATIBLE_TABLE_CHANGE_AFTER_ANALYSIS.COLUMNS_MISMATCH", parameters = Map( "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", - "errors" -> "\n- `extra` STRING has been added")) + "errors" -> "- `extra` STRING has been added")) // DataFrame execution before joins must have pinned used versions // subsequent version refreshes must not be visible in original DataFrames @@ -1400,7 +1396,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> "\n- `age` INT has been added")) + "errors" -> "- `age` INT has been added")) } } @@ -1424,7 +1420,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> "\n- `age` INT has been removed")) + "errors" -> "- `age` INT has been removed")) } } @@ -1448,7 +1444,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> "\n- `data` type has changed from STRING NOT NULL to STRING")) + "errors" -> "- `data` type has changed from STRING NOT NULL to STRING")) } } @@ -1537,7 +1533,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> "\n- `age` INT has been added")) + "errors" -> "- `age` INT has been added")) } } @@ -1566,7 +1562,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> "\n- `age` INT has been added")) + "errors" -> "- `age` INT has been added")) } } } @@ -1591,7 +1587,7 @@ class DataSourceV2DataFrameSuite "viewName" -> "`v`", "tableName" -> "`testcat`.`ns1`.`ns2`.`tbl`", "colType" -> "data", - "errors" -> "\n- `name` type has changed from VARCHAR(10) to VARCHAR(20)")) + "errors" -> "- `name` type has changed from VARCHAR(10) to VARCHAR(20)")) } }