Skip to content

Commit b58cbb7

Browse files
committed
fix test (new default collation)
1 parent dd3c9e7 commit b58cbb7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/command/DescribeRelationJsonCommand.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ case class DescribeRelationJsonCommand(
9999
case _ => throw QueryCompilationErrors.describeAsJsonNotSupportedForV2TablesError()
100100
}
101101

102+
// Add default collation if not yet added (addKeyValueToMap only adds unique keys).
103+
// Add here to only affect `DESC AS JSON` and not the `DESC TABLE` output.
104+
addKeyValueToMap("collation", JString("UTF8_BINARY"), jsonMap)
105+
102106
Seq(Row(compact(render(JObject(jsonMap.toList)))))
103107
}
104108

@@ -289,9 +293,6 @@ case class DescribeRelationJsonCommand(
289293
filteredTableInfo.map { case (key, value) =>
290294
addKeyValueToMap(key, value, jsonMap)
291295
}
292-
// Add default collation if not yet added (addKeyValueToMap only adds unique keys).
293-
// Add here to only affect `DESC AS JSON` and not the `DESC TABLE` output.
294-
addKeyValueToMap("collation", JString("UTF8_BINARY"), jsonMap)
295296
}
296297

297298
private def describePartitionInfoJson(

sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DescribeTableSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ trait DescribeTableSuiteBase extends command.DescribeTableSuiteBase
458458
TableColumn("c1", Type("string", collation = Some("UNICODE_CI"))),
459459
TableColumn("c2", Type("string", collation = Some("UNICODE_RTRIM"))),
460460
TableColumn("c3", Type("string", collation = Some("fr"))),
461-
TableColumn("c4", Type("string", collation = Some("UTF8_BINARY"))),
461+
TableColumn("c4", Type("string", collation = Some("de"))),
462462
TableColumn("id", Type("int")))),
463463
last_access = Some("UNKNOWN"),
464464
created_by = Some(s"Spark $SPARK_VERSION"),

0 commit comments

Comments
 (0)