bobbai00 commented on code in PR #9679:
URL: https://github.com/apache/texera/pull/9679#discussion_r4690560298
##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/scan/text/TextInputSourceOpDescSpec.scala:
##########
@@ -470,37 +360,20 @@ class TextInputSourceOpDescSpec extends AnyFlatSpec with
BeforeAndAfter {
}
}
- /** The configured text read as STRING lines by the executor the engine
runs. */
- private def linesFromEngine(): Seq[String] = {
+ /** Every tuple produced for the configured text by the executor the engine
runs. */
+ private def tuplesFromEngine(): List[Tuple] = {
val exec = new
TextInputSourceOpExec(objectMapper.writeValueAsString(textInputSourceOpDesc))
exec.open()
try {
exec
.produceTuple()
- .map(
- _.asInstanceOf[SchemaEnforceable]
- .enforceSchema(textInputSourceOpDesc.sourceSchema())
- .getField[String]("line")
- )
- .toSeq
+
.map(_.asInstanceOf[SchemaEnforceable].enforceSchema(textInputSourceOpDesc.sourceSchema()))
+ .toList
} finally exec.close()
}
- /** The configured text read as booleans by the executor the engine runs. */
- private def booleansFromEngine(): Seq[Boolean] = {
- val exec = new
TextInputSourceOpExec(objectMapper.writeValueAsString(textInputSourceOpDesc))
- exec.open()
- try {
- exec
- .produceTuple()
- .map(
- _.asInstanceOf[SchemaEnforceable]
- .enforceSchema(textInputSourceOpDesc.sourceSchema())
- .getField[Boolean]("line")
- )
- .toSeq
- } finally exec.close()
- }
+ /** The configured text read as STRING lines by the executor the engine
runs. */
Review Comment:
**Polish:**
`linesFrom` now sets the descriptor's attribute type before calling this
helper. In the two SINGLE_STRING cases (lines 101 and 160) it returns the whole
text as one value, not STRING lines. The comment was already there at
`b4f9162`, so this is one I missed in round 1. Wording it for both modes keeps
it true.
```suggestion
/** The configured text read by the executor the engine runs, one String
per tuple. */
```
--
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]