You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2023/01/25 07:38:02 UTC
[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #39732: [SPARK-42178][UI] Handle remaining null string values in ui protobuf serializer and add tests
dongjoon-hyun commented on code in PR #39732:
URL: https://github.com/apache/spark/pull/39732#discussion_r1086292024
##########
core/src/test/scala/org/apache/spark/status/protobuf/KVStoreProtobufSerializerSuite.scala:
##########
@@ -31,6 +34,32 @@ import org.apache.spark.ui.scope.{RDDOperationEdge, RDDOperationNode}
class KVStoreProtobufSerializerSuite extends SparkFunSuite {
private val serializer = new KVStoreProtobufSerializer()
+ test("All the string fields must be optional to avoid NPE") {
+ val protoFile = getWorkspaceFilePath(
+ "core", "src", "main", "protobuf", "org", "apache", "spark", "status", "protobuf",
+ "store_types.proto")
+
+ val containsStringRegex = "\\s*string .*"
+ val invalidDefinition = new mutable.ArrayBuffer[(String, Int)]()
+ var lineNumber = 1
+ Source.fromFile(protoFile.toFile.getCanonicalPath).getLines().foreach { line =>
+ if (line.matches(containsStringRegex)) {
Review Comment:
+1 for the above comment.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org