This is an automated email from the ASF dual-hosted git repository. gengliang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new c25fd93199cc [SPARK-47705][INFRA][FOLLOWUP] Sort LogKey alphabetically and build a test to ensure it c25fd93199cc is described below commit c25fd93199cc2d8795414cdb09a7129793a3e206 Author: panbingkun <panbing...@baidu.com> AuthorDate: Wed Apr 3 19:38:37 2024 -0700 [SPARK-47705][INFRA][FOLLOWUP] Sort LogKey alphabetically and build a test to ensure it ### What changes were proposed in this pull request? The pr aims to fix bug about https://github.com/apache/spark/pull/45857 ### Why are the changes needed? In fact, `LogKey.values.toSeq.sorted` did not sort alphabetically as expected. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - Pass GA. - Manually test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #45864 from panbingkun/fix_sort_logkey. Authored-by: panbingkun <panbing...@baidu.com> Signed-off-by: Gengliang Wang <gengli...@apache.org> --- common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala | 2 +- common/utils/src/test/scala/org/apache/spark/util/LogKeySuite.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala b/common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala index b8a43a03d8b6..86ea648d47c1 100644 --- a/common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala +++ b/common/utils/src/main/scala/org/apache/spark/internal/LogKey.scala @@ -30,8 +30,8 @@ object LogKey extends Enumeration { val MAX_EXECUTOR_FAILURES = Value val MAX_SIZE = Value val MIN_SIZE = Value - val REMOTE_ADDRESS = Value val POD_ID = Value + val REMOTE_ADDRESS = Value type LogKey = Value } diff --git a/common/utils/src/test/scala/org/apache/spark/util/LogKeySuite.scala b/common/utils/src/test/scala/org/apache/spark/util/LogKeySuite.scala index 39229f4b910b..1f3c2d77d35f 100644 --- a/common/utils/src/test/scala/org/apache/spark/util/LogKeySuite.scala +++ b/common/utils/src/test/scala/org/apache/spark/util/LogKeySuite.scala @@ -27,6 +27,7 @@ class LogKeySuite test("LogKey enumeration fields must be sorted alphabetically") { val keys = LogKey.values.toSeq - assert(keys === keys.sorted, "LogKey enumeration fields must be sorted alphabetically") + assert(keys === keys.sortBy(_.toString), + "LogKey enumeration fields must be sorted alphabetically") } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org