zkaoudi commented on code in PR #692:
URL: https://github.com/apache/wayang/pull/692#discussion_r2827954857
##########
wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/sources/fs/JavaCSVTableSource.java:
##########
@@ -176,6 +182,50 @@ private static Stream<String> streamLines(final String
path) {
}
+ /**
+ * Validates the CSV header for Calcite compatibility.
+ * Checks that the header is present, uses comma separators (not the data
+ * delimiter), and each column follows the 'name:type' format
+ * (e.g., 'id:int,name:string,email:string'). Note that Calcite hardcodes
+ * commas for header parsing, while data rows use Wayang's configurable
+ * separator (default ';').
+ *
+ * @param path the filesystem path to the CSV file
+ */
+ private void validateHeaderLine(final String path) {
+ final FileSystem fileSystem =
FileSystems.getFileSystem(path).orElseThrow(
Review Comment:
Would it be possible to do the check directly when we are reading the file?
We are now opening the file twice which could be costly?
--
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]