Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,8 @@ public static double getHotValueThreshold() {
"FileScanNode 扫描数据的最大并发,默认为 16", "The max threads to read data of FileScanNode, default 16"})
public int maxFileScannersConcurrency = 16;

@VariableMgr.VarAttr(name = ENABLE_FILE_SCANNER_V2, needForward = true, fuzzy = true, description = {
// Fuzzy regression tests only cover the default FileScannerV2 path.
@VariableMgr.VarAttr(name = ENABLE_FILE_SCANNER_V2, needForward = true, description = {
"开启后 FileScanNode 会在支持的查询场景使用 FileScannerV2,默认开启",
"When enabled, FileScanNode uses FileScannerV2 for supported query scans. Enabled by default."})
public boolean enableFileScannerV2 = true;
Expand Down Expand Up @@ -3791,10 +3792,6 @@ public void initFuzzyModeVariables() {
this.useSerialExchange = random.nextBoolean();
this.enableCommonExpPushDownForInvertedIndex = random.nextBoolean();
this.enableExprZonemapFilter = Config.pull_request_id % 2 == 0;
// Randomize the external file scanner engine (FileScannerV2 vs the legacy V1 path). Kept
// here rather than in setFuzzyForCatalog() so it also runs in the external regression
// pipeline, which enables fuzzy sessions with fuzzy_test_type=p1 (not "external").
this.enableFileScannerV2 = random.nextBoolean();
this.disableStreamPreaggregations = random.nextBoolean();
this.enableStreamingAggHashJoinForcePassthrough = random.nextBoolean();
this.enableLocalExchangeBeforeAgg = random.nextBoolean();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ public void testExternalTableBatchModeDefaultsAndFuzzyAttribute() throws Excepti
Assertions.assertTrue(varAttr.fuzzy());
}

@Test
public void testFileScannerV2StaysEnabledInFuzzyMode() throws Exception {
SessionVariable sessionVar = new SessionVariable();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only verifies the pristine Java default. Real connections clone VariableMgr.defaultSessionVariable before initFuzzyModeVariables(); that default is mutable via SET GLOBAL and persisted/replayed. If it is false, fuzzy initialization now leaves it false and the forwarded option still selects legacy V1, so fuzzy sessions are not actually guaranteed to stay on V2. Please exercise an inherited false here and restore an unconditional enableFileScannerV2 = true assignment in initFuzzyModeVariables().

Assertions.assertTrue(sessionVar.enableFileScannerV2);

Field field = SessionVariable.class.getDeclaredField("enableFileScannerV2");
VariableMgr.VarAttr varAttr = field.getAnnotation(VariableMgr.VarAttr.class);
Assertions.assertFalse(varAttr.fuzzy());

sessionVar.initFuzzyModeVariables();
Assertions.assertTrue(sessionVar.enableFileScannerV2);
}

@Test
public void testForceEagerAggHintParseWhenSetSessionVariable() throws Exception {
SessionVariable sessionVar = new SessionVariable();
Expand Down
Loading