aglinxinyuan commented on code in PR #6135:
URL: https://github.com/apache/texera/pull/6135#discussion_r3524376756
##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/source/scan/csv/CSVScanSourceOpExecSpec.scala:
##########
@@ -107,4 +112,99 @@ class CSVScanSourceOpExecSpec extends AnyFlatSpec {
assert(msg.toLowerCase.contains("max columns"))
assert(msg.toLowerCase.contains("exceeded"))
}
+
+ //
---------------------------------------------------------------------------
+ // Instance-side scan loop: open() -> produceTuple() -> close() over temp
CSVs.
+ //
---------------------------------------------------------------------------
+
+ private var tempFiles: List[Path] = Nil
+
+ override def afterAll(): Unit = {
+ tempFiles.foreach(Files.deleteIfExists)
+ super.afterAll()
+ }
+
+ /** Writes `content` to a fresh temp .csv and returns its path (tracked for
cleanup). */
+ private def writeTempCsv(content: String): Path = {
+ val path = Files.createTempFile("csv-scan-exec-spec", ".csv")
+ Files.write(path, content.getBytes("UTF-8"))
Review Comment:
Switched to `getBytes(StandardCharsets.UTF_8)` (48a9cbb) — consistent with
the rest of the module.
--
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]