Skip to content

Commit cec21a4

Browse files
adriangbclaude
andcommitted
test: gate the swap-alias shape on its own issue
The swap shape (b AS a, a AS b) fails for a different reason than the same-name computed column: it is apache#25446, which is open, while apache#25414 has a fix. With one switch for both, the fix for the first one cannot be verified by this test. The swap shape now has its own switch, off until the issue is fixed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 58ed765 commit cec21a4

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

‎datafusion/core/tests/fuzz_cases/leaf_pushdown_fuzz.rs‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ use tempfile::TempDir;
6363
/// <https://github.com/apache/datafusion/issues/25414>
6464
const INCLUDE_SAME_NAME_ALIAS_SHAPES: bool = false;
6565

66+
/// A sub-query projection that swaps two column names (`b AS a, a AS b`) under
67+
/// a struct field read gives an "ambiguous" planning error.
68+
/// <https://github.com/apache/datafusion/issues/25446>
69+
const INCLUDE_SWAP_ALIAS_SHAPES: bool = false;
70+
6671
/// A `UNION ALL` branch with a provably false predicate over a CTE gives an
6772
/// "ambiguous" planning error.
6873
/// <https://github.com/apache/datafusion/pull/25412>
@@ -258,7 +263,10 @@ fn all_columns(rng: &mut SmallRng, q: &str) -> String {
258263
fn gen_source(rng: &mut SmallRng) -> (String, String) {
259264
let mut kinds = vec![0, 1, 2, 3, 4];
260265
if INCLUDE_SAME_NAME_ALIAS_SHAPES {
261-
kinds.extend([5, 6]);
266+
kinds.push(5);
267+
}
268+
if INCLUDE_SWAP_ALIAS_SHAPES {
269+
kinds.push(6);
262270
}
263271
if INCLUDE_FALSE_BRANCH_UNION_SHAPES {
264272
kinds.push(7);
@@ -326,7 +334,7 @@ fn gen_source(rng: &mut SmallRng) -> (String, String) {
326334
)
327335
}
328336
// A swap of two column names.
329-
// https://github.com/apache/datafusion/issues/25414
337+
// https://github.com/apache/datafusion/issues/25446
330338
6 => (
331339
String::new(),
332340
format!("(SELECT b AS a, a AS b, c, s, t FROM {table}) AS src"),
@@ -502,7 +510,10 @@ fn gen_struct_function(rng: &mut SmallRng) -> Case {
502510
fn gen_same_name_alias(rng: &mut SmallRng) -> Case {
503511
let expr = pick(rng, &["-a", "a * 10", "a + 1"]);
504512
// Every table holds 8 rows, so this limit keeps all of them.
505-
let sql = match rng.random_range(0..6) {
513+
// The last arm is the swap shape of
514+
// <https://github.com/apache/datafusion/issues/25446>.
515+
let arms = if INCLUDE_SWAP_ALIAS_SHAPES { 6 } else { 5 };
516+
let sql = match rng.random_range(0..arms) {
506517
0 => format!(
507518
"SELECT a, s['b'] FROM (SELECT {expr} AS a, s FROM {NARROW} WHERE a > -3)"
508519
),

0 commit comments

Comments
 (0)