Skip to content

Commit 2fae0d9

Browse files
committed
[fix](load) Exclude query-only connectors from V2 load dispatch
ADBC and Fluss do not support ordinary file loads. Reject their table markers before checking the physical format, since the default Parquet format otherwise admits them to LoadTableReader. Add shared selector coverage for an omitted option and default format, both option values and explicit physical formats. Query selection stays on the existing connector-specific path. Validation: the new regression fails before the fix; 31 targeted tests pass in the branch-4.2 ASAN/UBSAN harness afterward, including the two CI failure assertions. Master operator and relevant test translation units pass syntax checks. clang-format 16, build hygiene and diff checks pass. Full BE UT execution remains for CI.
1 parent ebd0f5f commit 2fae0d9

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

‎be/src/exec/operator/file_scan_operator.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ bool FileScanLocalState::should_use_file_scanner_v2(const TQueryOptions& query_o
150150
bool is_load,
151151
const TFileScanRangeParams& scan_params) {
152152
if (is_load) {
153+
// ADBC and Fluss are query-only connectors. Their default Parquet format must not
154+
// admit them to the ordinary file-load conversion path.
155+
if (scan_params.__isset.table_format_params &&
156+
(scan_params.table_format_params.table_format_type == "adbc" ||
157+
scan_params.table_format_params.table_format_type == "fluss")) {
158+
return false;
159+
}
153160
// Load planners omit query session options. Thrift's default makes an omitted V2
154161
// option indistinguishable from false, so ingestion selects by format instead.
155162
switch (scan_params.format_type) {

‎be/test/exec/scan/file_load_scanner_v2_test.cpp‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,27 @@ TEST(FileLoadScannerV2Test, LoadSelectionDoesNotDependOnQueryOption) {
5050
}
5151
}
5252

53+
// A connector marker must not become a file-load path just because its default format is Parquet.
54+
TEST(FileLoadScannerV2Test, QueryOnlyConnectorsAreNotSupportedLoads) {
55+
for (const auto* table_format : {"adbc", "fluss"}) {
56+
TFileScanRangeParams params;
57+
TTableFormatFileDesc table;
58+
table.__set_table_format_type(table_format);
59+
params.__set_table_format_params(table);
60+
TQueryOptions options;
61+
EXPECT_FALSE(FileScanLocalState::should_use_file_scanner_v2(options, true, params));
62+
for (bool enabled : {false, true}) {
63+
options.__set_enable_file_scanner_v2(enabled);
64+
for (auto format : {TFileFormatType::FORMAT_PARQUET, TFileFormatType::FORMAT_ORC,
65+
TFileFormatType::FORMAT_CSV_PLAIN, TFileFormatType::FORMAT_JSON,
66+
TFileFormatType::FORMAT_WAL, TFileFormatType::FORMAT_JNI,
67+
TFileFormatType::FORMAT_ARROW}) {
68+
params.__set_format_type(format);
69+
EXPECT_FALSE(FileScanLocalState::should_use_file_scanner_v2(options, true, params))
70+
<< table_format << ": " << format << ", V2 option=" << enabled;
71+
}
72+
}
73+
}
74+
}
75+
5376
} // namespace doris

0 commit comments

Comments
 (0)