Yicong-Huang commented on code in PR #5390:
URL: https://github.com/apache/texera/pull/5390#discussion_r3366051815
##########
amber/src/test/scala/org/apache/texera/web/service/ExecutionResultServiceSpec.scala:
##########
@@ -475,4 +486,67 @@ class ExecutionResultServiceSpec extends AnyFlatSpec with
Matchers {
resultsDefault(2).get("value").asText() shouldBe "medium length"
resultsDefault(3).get("value").asText() should endWith("...")
}
+
+ // The existing binary cases assert only the byte size and the presence of an
+ // ellipsis. They never pin the actual preview bits, and they never exercise
+ // the "<= 13 bits" branch with a non-empty array (only the empty-array edge
+ // hits it). The next two cases pin both branches exactly.
+
+ it should "render the full bit string for a binary field of 13 bits or
fewer" in {
+ val schema = new Schema(List(new Attribute("b", AttributeType.BINARY)))
+ // 1 byte = 8 bits <= 10 (leading) + 3 (trailing), so no
truncation/ellipsis.
+ val tuple = Tuple.builder(schema).add("b", AttributeType.BINARY,
Array[Byte](5)).build()
+
+ val text =
ExecutionResultService.convertTuplesToJson(List(tuple)).head.get("b").asText()
Review Comment:
nit: for the source code, I think this method should be moved out of
ExecutionResultService, but to the component which is displaying it.
not to change in this PR.
--
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]