Yicong-Huang commented on code in PR #6099:
URL: https://github.com/apache/texera/pull/6099#discussion_r3524182995
##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/scan/arrow/ArrowSourceOpDescSpec.scala:
##########
@@ -81,4 +122,24 @@ class ArrowSourceOpDescSpec extends AnyFlatSpec with
Matchers {
r.limit shouldBe Some(7)
r.offset shouldBe Some(3)
}
+
+ "ArrowSourceOpDesc.inferSchema" should "infer the Texera schema from a valid
Arrow file" in {
+ val file = writeArrowFile(Seq("a", "b"))
+ val d = new ArrowSourceOpDesc
+ d.fileName = Some(file.toURI.toString)
+ val schema = d.inferSchema()
+ schema.getAttributes should have length 1
+ schema.getAttributes.head.getName shouldBe "s"
+ schema.getAttributes.head.getType shouldBe AttributeType.STRING
+ }
Review Comment:
can we make this a bit more complex? this only tests a string field. can we
also test other types, null values, and exception paths for example a
mixed/wrong field (can it happen on arrow file?)
--
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]