srowen commented on a change in pull request #23258:
[SPARK-23375][SQL][FOLLOWUP][TEST] Test Sort metrics while Sort is missing
URL: https://github.com/apache/spark/pull/23258#discussion_r244533576
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala
##########
@@ -40,6 +41,26 @@ trait SQLMetricsTestUtils extends SQLTestUtils {
protected def statusStore: SQLAppStatusStore = spark.sharedState.statusStore
+ protected val bytes = "([0-9]+(\\.[0-9]+)?) (EiB|PiB|TiB|GiB|MiB|KiB|B)"
+
+ protected val duration = "([0-9]+(\\.[0-9]+)?) (ms|s|m|h)"
+
+ // "\n96.2 MiB (32.1 MiB, 32.1 MiB, 32.1 MiB)"
+ protected val sizeMetricPattern = Pattern.compile(s"\\n$bytes \\($bytes,
$bytes, $bytes\\)")
Review comment:
Add `.r` to the end of these strings to make them a
`scala.util.matching.Regex` automatically. That's more idiomatic for Scala. No
need to import and use Java's `Pattern`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]