Gabriel39 commented on code in PR #71198:
URL: https://github.com/apache/doris/pull/71198#discussion_r4752806666
##########
fe/fe-core/src/main/java/org/apache/doris/datasource/tvf/source/TVFScanNode.java:
##########
@@ -192,6 +195,32 @@ public List<Split> getSplits(int numBackends) throws
UserException {
return splits;
}
+ private boolean isFormatSplittable() {
+ TFileFormatType format = tableValuedFunction.getTFileFormatType();
+ if (format == TFileFormatType.FORMAT_JSON) {
+ // Document mode parses each range as a complete JSON value,
including implicit array mode.
+ return getFileAttributes().isReadJsonByLine();
+ }
+ if (Util.isCsvFormat(format) || format == TFileFormatType.FORMAT_TEXT)
{
+ TFileAttributes attributes = getFileAttributes();
+ if (Util.isCsvFormat(format) &&
attributes.getTextParams().getEnclose() != 0) {
+ // A byte boundary may lie inside a quoted multiline field;
ranges cannot recover quote state.
+ return false;
+ }
+ int skippedLines = attributes.getSkipLines();
+ // Header modes override skip_lines in the reader.
+ if
(FileFormatProperties.FORMAT_CSV_WITH_NAMES.equalsIgnoreCase(attributes.getHeaderType()))
{
+ skippedLines = 1;
+ } else if (FileFormatProperties.FORMAT_CSV_WITH_NAMES_AND_TYPES
+ .equalsIgnoreCase(attributes.getHeaderType())) {
+ skippedLines = 2;
+ }
+ // Non-first ranges skip one partial record, but cannot consume a
remaining multi-record prefix.
+ return skippedLines <= 1;
Review Comment:
Fixed in fab4aa72eebdea08f2fab019c63dcb9783517e1c. Hive text with a
self-overlapping UTF-8 line delimiter now stays in one range, preserving greedy
delimiter alignment in both scanners. Non-overlapping Hive text delimiters and
CSV/JSON keep their existing split policy.
Added planner coverage for overlapping, non-overlapping, encoded and
multibyte delimiters, including COUNT pushdown. The SQL regression now checks
complete rows for your exact 1,228-byte `||` fixture and an `aba` boundary,
with both scanner modes and with/without a `.gz` suffix.
Verified the new planner tests fail before the fix (12 expected failures),
then all 109 targeted FE tests pass after it. FE Checkstyle, clang-format 16
and Groovy compilation also pass. Live external SQL execution remains for CI.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]