morazow commented on code in PR #26335:
URL: https://github.com/apache/flink/pull/26335#discussion_r2007446297
##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/utils/testTableSourceSinks.scala:
##########
@@ -329,12 +329,27 @@ class TestPartitionableTableSource(
override def explainSource(): String = {
if (remainingPartitions != null) {
- s"partitions=${remainingPartitions.mkString(", ")}"
+ s"partitions=${remainingPartitions.map(sortMapKeys).mkString(", ")}"
Review Comment:
Hey @davidradl, thanks for the feedback!
Yes, unfortunately this doesn't work, because it converts it into sequence
of tuples, and the mkString result becomes `(k1=v1), (k2=v2)`. The explain
source expects `{k1=v1, k2=v2, ...}`.
Example:
```scala
val map: JMap[String, String] = new JHashMap[String, String]()
map.put("part2", "1")
map.put("part1", "C")
map.put("part3", "D")
val partitions: JList[JMap[String, String]] = new JArrayList[JMap[String,
String]]()
partitions.add(map)
println("partitions=" + partitions.map(_.toSeq.sortBy(_._1)).mkString(", "))
println("partitions=" + partitions.mkString(", "))
println(table.explainSource())
// Results
partitions=ArrayBuffer((part1,C), (part2,1), (part3,D))
partitions={part1=C, part2=1, part3=D}
partitions={part1=C, part2=1, part3=D}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]