diff --git a/prqlc/bindings/prqlc-python/src/lib.rs b/prqlc/bindings/prqlc-python/src/lib.rs index 7b83e4bb2215..497e11d5f9b1 100644 --- a/prqlc/bindings/prqlc-python/src/lib.rs +++ b/prqlc/bindings/prqlc-python/src/lib.rs @@ -183,7 +183,7 @@ mod test { assert_snapshot!( compile("from employees | filter (age | in 20..30)", opts).unwrap(), - @r" + @" SELECT * FROM @@ -206,7 +206,7 @@ mod test { let prql = r#"from artists | select {name, id} | filter (id | in [1, 2, 3])"#; assert_snapshot!( - prql_to_pl(prql).and_then(|x| pl_to_rq(x.as_str())).and_then(|x|rq_to_sql(x.as_str(), opts)).unwrap(), @r" + prql_to_pl(prql).and_then(|x| pl_to_rq(x.as_str())).and_then(|x|rq_to_sql(x.as_str(), opts)).unwrap(), @" SELECT name, id @@ -221,7 +221,7 @@ mod test { fn prql_pl_prql_roundtrip() { let prql = r#"from artists | select {name, id} | filter (id | in [1, 2, 3])"#; assert_snapshot!( - prql_to_pl(prql).and_then(|x| pl_to_prql(x.as_str())).unwrap(), @r" + prql_to_pl(prql).and_then(|x| pl_to_prql(x.as_str())).unwrap(), @" from artists select {name, id} filter (id | in [1, 2, 3]) @@ -232,7 +232,7 @@ mod test { fn debug_prql_lineage() { assert_snapshot!( debug::prql_lineage(r#"from a | select { beta, gamma }"#).unwrap(), - @r#"{"frames":[["1:9-31",{"columns":[{"Single":{"name":["a","beta"],"target_id":120,"target_name":null}},{"Single":{"name":["a","gamma"],"target_id":121,"target_name":null}}],"inputs":[{"id":118,"name":"a","table":["default_db","a"]}]}]],"nodes":[{"id":118,"kind":"Ident","span":"1:0-6","ident":{"Ident":["default_db","a"]},"parent":123},{"id":120,"kind":"Ident","span":"1:18-22","ident":{"Ident":["this","a","beta"]},"targets":[118],"parent":122},{"id":121,"kind":"Ident","span":"1:24-29","ident":{"Ident":["this","a","gamma"]},"targets":[118],"parent":122},{"id":122,"kind":"Tuple","span":"1:16-31","children":[120,121],"parent":123},{"id":123,"kind":"TransformCall: Select","span":"1:9-31","children":[118,122]}],"ast":{"name":"Project","stmts":[{"VarDef":{"kind":"Main","name":"main","value":{"Pipeline":{"exprs":[{"FuncCall":{"name":{"Ident":["from"],"span":"1:0-4"},"args":[{"Ident":["a"],"span":"1:5-6"}]},"span":"1:0-6"},{"FuncCall":{"name":{"Ident":["select"],"span":"1:9-15"},"args":[{"Tuple":[{"Ident":["beta"],"span":"1:18-22"},{"Ident":["gamma"],"span":"1:24-29"}],"span":"1:16-31"}]},"span":"1:9-31"}]},"span":"1:0-31"}},"span":"1:0-31"}]}}"# + @r#"{"frames":[["1:9-31",{"columns":[{"Single":{"name":["a","beta"],"target_id":121,"target_name":null}},{"Single":{"name":["a","gamma"],"target_id":122,"target_name":null}}],"inputs":[{"id":119,"name":"a","table":["default_db","a"]}]}]],"nodes":[{"id":119,"kind":"Ident","span":"1:0-6","ident":{"Ident":["default_db","a"]},"parent":124},{"id":121,"kind":"Ident","span":"1:18-22","ident":{"Ident":["this","a","beta"]},"targets":[119],"parent":123},{"id":122,"kind":"Ident","span":"1:24-29","ident":{"Ident":["this","a","gamma"]},"targets":[119],"parent":123},{"id":123,"kind":"Tuple","span":"1:16-31","children":[121,122],"parent":124},{"id":124,"kind":"TransformCall: Select","span":"1:9-31","children":[119,123]}],"ast":{"name":"Project","stmts":[{"VarDef":{"kind":"Main","name":"main","value":{"Pipeline":{"exprs":[{"FuncCall":{"name":{"Ident":["from"],"span":"1:0-4"},"args":[{"Ident":["a"],"span":"1:5-6"}]},"span":"1:0-6"},{"FuncCall":{"name":{"Ident":["select"],"span":"1:9-15"},"args":[{"Tuple":[{"Ident":["beta"],"span":"1:18-22"},{"Ident":["gamma"],"span":"1:24-29"}],"span":"1:16-31"}]},"span":"1:9-31"}]},"span":"1:0-31"}},"span":"1:0-31"}]}}"# ); } @@ -240,7 +240,7 @@ mod test { fn debug_pl_to_lineage() { assert_snapshot!( prql_to_pl(r#"from a | select { beta, gamma }"#).and_then(|x| debug::pl_to_lineage(&x)).unwrap(), - @r#"{"frames":[["1:9-31",{"columns":[{"Single":{"name":["a","beta"],"target_id":120,"target_name":null}},{"Single":{"name":["a","gamma"],"target_id":121,"target_name":null}}],"inputs":[{"id":118,"name":"a","table":["default_db","a"]}]}]],"nodes":[{"id":118,"kind":"Ident","span":"1:0-6","ident":{"Ident":["default_db","a"]},"parent":123},{"id":120,"kind":"Ident","span":"1:18-22","ident":{"Ident":["this","a","beta"]},"targets":[118],"parent":122},{"id":121,"kind":"Ident","span":"1:24-29","ident":{"Ident":["this","a","gamma"]},"targets":[118],"parent":122},{"id":122,"kind":"Tuple","span":"1:16-31","children":[120,121],"parent":123},{"id":123,"kind":"TransformCall: Select","span":"1:9-31","children":[118,122]}],"ast":{"name":"Project","stmts":[{"VarDef":{"kind":"Main","name":"main","value":{"Pipeline":{"exprs":[{"FuncCall":{"name":{"Ident":["from"],"span":"1:0-4"},"args":[{"Ident":["a"],"span":"1:5-6"}]},"span":"1:0-6"},{"FuncCall":{"name":{"Ident":["select"],"span":"1:9-15"},"args":[{"Tuple":[{"Ident":["beta"],"span":"1:18-22"},{"Ident":["gamma"],"span":"1:24-29"}],"span":"1:16-31"}]},"span":"1:9-31"}]},"span":"1:0-31"}},"span":"1:0-31"}]}}"# + @r#"{"frames":[["1:9-31",{"columns":[{"Single":{"name":["a","beta"],"target_id":121,"target_name":null}},{"Single":{"name":["a","gamma"],"target_id":122,"target_name":null}}],"inputs":[{"id":119,"name":"a","table":["default_db","a"]}]}]],"nodes":[{"id":119,"kind":"Ident","span":"1:0-6","ident":{"Ident":["default_db","a"]},"parent":124},{"id":121,"kind":"Ident","span":"1:18-22","ident":{"Ident":["this","a","beta"]},"targets":[119],"parent":123},{"id":122,"kind":"Ident","span":"1:24-29","ident":{"Ident":["this","a","gamma"]},"targets":[119],"parent":123},{"id":123,"kind":"Tuple","span":"1:16-31","children":[121,122],"parent":124},{"id":124,"kind":"TransformCall: Select","span":"1:9-31","children":[119,123]}],"ast":{"name":"Project","stmts":[{"VarDef":{"kind":"Main","name":"main","value":{"Pipeline":{"exprs":[{"FuncCall":{"name":{"Ident":["from"],"span":"1:0-4"},"args":[{"Ident":["a"],"span":"1:5-6"}]},"span":"1:0-6"},{"FuncCall":{"name":{"Ident":["select"],"span":"1:9-15"},"args":[{"Tuple":[{"Ident":["beta"],"span":"1:18-22"},{"Ident":["gamma"],"span":"1:24-29"}],"span":"1:16-31"}]},"span":"1:9-31"}]},"span":"1:0-31"}},"span":"1:0-31"}]}}"# ); } } diff --git a/prqlc/prqlc-parser/src/lexer/test.rs b/prqlc/prqlc-parser/src/lexer/test.rs index 59d909257dee..c95b89db6d61 100644 --- a/prqlc/prqlc-parser/src/lexer/test.rs +++ b/prqlc/prqlc-parser/src/lexer/test.rs @@ -26,7 +26,7 @@ fn line_wrap() { // Basic line wrap test assert_debug_snapshot!(test_line_wrap_tokens(r"5 + - \ 3 "), @r" + \ 3 "), @" Tokens( [ 0..1: Literal(Integer(5)), @@ -77,7 +77,7 @@ fn debug_display() { Tokens(lexer().parse(input).output().unwrap().to_vec()) } - assert_debug_snapshot!(test_tokens("5 + 3"), @r" + assert_debug_snapshot!(test_tokens("5 + 3"), @" Tokens( [ 0..1: Literal(Integer(5)), @@ -221,7 +221,7 @@ fn range() { Tokens(lexer().parse(input).output().unwrap().to_vec()) } - assert_debug_snapshot!(test_range_tokens("1..2"), @r" + assert_debug_snapshot!(test_range_tokens("1..2"), @" Tokens( [ 0..1: Literal(Integer(1)), @@ -231,7 +231,7 @@ fn range() { ) "); - assert_debug_snapshot!(test_range_tokens("..2"), @r" + assert_debug_snapshot!(test_range_tokens("..2"), @" Tokens( [ 0..2: Range { bind_left: true, bind_right: true }, @@ -240,7 +240,7 @@ fn range() { ) "); - assert_debug_snapshot!(test_range_tokens("1.."), @r" + assert_debug_snapshot!(test_range_tokens("1.."), @" Tokens( [ 0..1: Literal(Integer(1)), @@ -267,7 +267,7 @@ fn range() { fn test_lex_source() { use insta::assert_debug_snapshot; - assert_debug_snapshot!(lex_source("5 + 3"), @r" + assert_debug_snapshot!(lex_source("5 + 3"), @" Ok( Tokens( [ @@ -291,20 +291,20 @@ fn test_annotation_tokens() { // Test basic annotation token let result = super::lex_source("@{binding_strength=1}"); assert_debug_snapshot!(result, @r#" - Ok( - Tokens( - [ - 0..0: Start, - 0..1: Annotate, - 1..2: Control('{'), - 2..18: Ident("binding_strength"), - 18..19: Control('='), - 19..20: Literal(Integer(1)), - 20..21: Control('}'), - ], - ), - ) - "#); + Ok( + Tokens( + [ + 0..0: Start, + 0..1: Annotate, + 1..2: Control('{'), + 2..18: Ident("binding_strength"), + 18..19: Control('='), + 19..20: Literal(Integer(1)), + 20..21: Control('}'), + ], + ), + ) + "#); // Test multi-line annotation let result = super::lex_source( @@ -314,32 +314,32 @@ fn test_annotation_tokens() { "#, ); assert_debug_snapshot!(result, @r#" - Ok( - Tokens( - [ - 0..0: Start, - 0..1: NewLine, - 9..10: Annotate, - 10..11: Control('{'), - 11..27: Ident("binding_strength"), - 27..28: Control('='), - 28..29: Literal(Integer(1)), - 29..30: Control('}'), - 30..31: NewLine, - 39..42: Keyword("let"), - 43..46: Ident("add"), - 47..48: Control('='), - 49..50: Ident("a"), - 51..52: Ident("b"), - 53..55: ArrowThin, - 56..57: Ident("a"), - 58..59: Control('+'), - 60..61: Ident("b"), - 61..62: NewLine, - ], - ), - ) - "#); + Ok( + Tokens( + [ + 0..0: Start, + 0..1: NewLine, + 9..10: Annotate, + 10..11: Control('{'), + 11..27: Ident("binding_strength"), + 27..28: Control('='), + 28..29: Literal(Integer(1)), + 29..30: Control('}'), + 30..31: NewLine, + 39..42: Keyword("let"), + 43..46: Ident("add"), + 47..48: Control('='), + 49..50: Ident("a"), + 51..52: Ident("b"), + 53..55: ArrowThin, + 56..57: Ident("a"), + 58..59: Control('+'), + 60..61: Ident("b"), + 61..62: NewLine, + ], + ), + ) + "#); } #[test] diff --git a/prqlc/prqlc/src/cli/mod.rs b/prqlc/prqlc/src/cli/mod.rs index 33028d187c7c..d4e8cc2bff51 100644 --- a/prqlc/prqlc/src/cli/mod.rs +++ b/prqlc/prqlc/src/cli/mod.rs @@ -708,7 +708,7 @@ sort full "", ); - assert_snapshot!(&result.unwrap_err().to_string(), @r" + assert_snapshot!(&result.unwrap_err().to_string(), @" Error: ╭─[ :1:1 ] │ @@ -742,7 +742,7 @@ sort full "main", ) .unwrap(); - assert_snapshot!(String::from_utf8(result).unwrap().trim(), @r" + assert_snapshot!(String::from_utf8(result).unwrap().trim(), @" WITH x AS ( SELECT y, @@ -769,7 +769,7 @@ sort full ) .unwrap(); - assert_snapshot!(String::from_utf8(output).unwrap().trim(), @r" + assert_snapshot!(String::from_utf8(output).unwrap().trim(), @" name: Project stmts: - VarDef: @@ -816,7 +816,7 @@ sort full // TODO: terser output; maybe serialize span as `0..4`? Remove the // `!Ident` complication? - assert_snapshot!(String::from_utf8(output).unwrap().trim(), @r" + assert_snapshot!(String::from_utf8(output).unwrap().trim(), @" - kind: Start span: start: 0 @@ -859,7 +859,7 @@ sort full ) .unwrap(); - assert_snapshot!(String::from_utf8(output).unwrap().trim(), @r" + assert_snapshot!(String::from_utf8(output).unwrap().trim(), @" - kind: Start span: start: 0 diff --git a/prqlc/prqlc/src/cli/test.rs b/prqlc/prqlc/src/cli/test.rs index d463cb9c119a..c0aa040e6d08 100644 --- a/prqlc/prqlc/src/cli/test.rs +++ b/prqlc/prqlc/src/cli/test.rs @@ -13,7 +13,7 @@ use walkdir::WalkDir; #[cfg(not(windows))] // Windows has slightly different output (e.g. `prqlc.exe`), so we exclude. #[test] fn help() { - assert_cmd_snapshot!(prqlc_command().arg("--help"), @r" + assert_cmd_snapshot!(prqlc_command().arg("--help"), @" success: true exit_code: 0 ----- stdout ----- @@ -42,7 +42,7 @@ fn help() { "); // without arguments - assert_cmd_snapshot!(prqlc_command(), @r" + assert_cmd_snapshot!(prqlc_command(), @" success: true exit_code: 0 ----- stdout ----- @@ -73,7 +73,7 @@ fn help() { #[test] fn get_targets() { - assert_cmd_snapshot!(prqlc_command().arg("list-targets"), @r" + assert_cmd_snapshot!(prqlc_command().arg("list-targets"), @" success: true exit_code: 0 ----- stdout ----- @@ -100,7 +100,7 @@ fn get_targets() { fn compile() { assert_cmd_snapshot!(prqlc_command() .args(["compile", "--hide-signature-comment"]) - .pass_stdin("from tracks"), @r" + .pass_stdin("from tracks"), @" success: true exit_code: 0 ----- stdout ----- @@ -116,7 +116,7 @@ fn compile() { #[cfg(not(windows))] // Windows has slightly different output (e.g. `prqlc.exe`), so we exclude. #[test] fn compile_help() { - assert_cmd_snapshot!(prqlc_command().args(["compile", "--help"]), @r" + assert_cmd_snapshot!(prqlc_command().args(["compile", "--help"]), @" success: true exit_code: 0 ----- stdout ----- @@ -194,7 +194,7 @@ let long_query = ( take 20 ) from long_query - "#), @r" + "#), @" success: true exit_code: 0 ----- stdout ----- @@ -278,7 +278,7 @@ fn compile_project() { "main", ]); - assert_cmd_snapshot!(cmd, @r" + assert_cmd_snapshot!(cmd, @" success: true exit_code: 0 ----- stdout ----- @@ -332,7 +332,7 @@ fn compile_project() { project_path().to_str().unwrap(), "-", "favorite_artists", - ]), @r" + ]), @" success: true exit_code: 0 ----- stdout ----- @@ -359,7 +359,7 @@ fn compile_project() { #[test] fn format() { // Test stdin formatting - assert_cmd_snapshot!(prqlc_command().args(["fmt"]).pass_stdin("from tracks | take 20"), @r" + assert_cmd_snapshot!(prqlc_command().args(["fmt"]).pass_stdin("from tracks | take 20"), @" success: true exit_code: 0 ----- stdout ----- @@ -435,29 +435,29 @@ fn debug() { name: - tracks - artist - target_id: 120 + target_id: 121 target_name: null - !Single name: - tracks - album - target_id: 121 + target_id: 122 target_name: null inputs: - - id: 118 + - id: 119 name: tracks table: - default_db - tracks nodes: - - id: 118 + - id: 119 kind: Ident span: 1:0-11 ident: !Ident - default_db - tracks - parent: 123 - - id: 120 + parent: 124 + - id: 121 kind: Ident span: 1:22-28 ident: !Ident @@ -465,9 +465,9 @@ fn debug() { - tracks - artist targets: - - 118 - parent: 122 - - id: 121 + - 119 + parent: 123 + - id: 122 kind: Ident span: 1:30-35 ident: !Ident @@ -475,21 +475,21 @@ fn debug() { - tracks - album targets: - - 118 - parent: 122 - - id: 122 + - 119 + parent: 123 + - id: 123 kind: Tuple span: 1:21-36 children: - - 120 - 121 - parent: 123 - - id: 123 + - 122 + parent: 124 + - id: 124 kind: 'TransformCall: Select' span: 1:14-36 children: - - 118 - - 122 + - 119 + - 123 ast: name: Project stmts: @@ -604,7 +604,7 @@ fn normalize_prqlc(cmd: &mut Command) -> &mut Command { #[test] fn compile_no_prql_files() { - assert_cmd_snapshot!(prqlc_command().args(["compile", "README.md"]), @r" + assert_cmd_snapshot!(prqlc_command().args(["compile", "README.md"]), @" success: false exit_code: 1 ----- stdout ----- @@ -616,7 +616,7 @@ fn compile_no_prql_files() { #[test] fn lex() { - assert_cmd_snapshot!(prqlc_command().args(["lex"]).pass_stdin("from tracks"), @r" + assert_cmd_snapshot!(prqlc_command().args(["lex"]).pass_stdin("from tracks"), @" success: true exit_code: 0 ----- stdout ----- diff --git a/prqlc/prqlc/src/codegen/ast.rs b/prqlc/prqlc/src/codegen/ast.rs index 86d4728b6af5..8a2d72a4336f 100644 --- a/prqlc/prqlc/src/codegen/ast.rs +++ b/prqlc/prqlc/src/codegen/ast.rs @@ -556,7 +556,7 @@ mod test { exprs: vec![short.clone(), long.clone(), long, short.clone()], })); // colons are a workaround to avoid trimming - assert_snapshot!(pipeline.write(opt.clone()).unwrap(), @r" + assert_snapshot!(pipeline.write(opt.clone()).unwrap(), @" ( short some_really_long_and_really_long_name diff --git a/prqlc/prqlc/src/lib.rs b/prqlc/prqlc/src/lib.rs index 910035810ee7..e16e85557b08 100644 --- a/prqlc/prqlc/src/lib.rs +++ b/prqlc/prqlc/src/lib.rs @@ -570,7 +570,7 @@ mod tests { #[test] fn test_target_from_str() { - assert_debug_snapshot!(Target::from_str("sql.postgres"), @r" + assert_debug_snapshot!(Target::from_str("sql.postgres"), @" Ok( Sql( Some( diff --git a/prqlc/prqlc/src/semantic/mod.rs b/prqlc/prqlc/src/semantic/mod.rs index 15402110cf9c..3d9f23396b63 100644 --- a/prqlc/prqlc/src/semantic/mod.rs +++ b/prqlc/prqlc/src/semantic/mod.rs @@ -191,7 +191,7 @@ pub mod test { window range:-4..4 ( derive {next_four_days = sum b} ) - "###).unwrap().relation.columns, @r" + "###).unwrap().relation.columns, @" - Single: day - Single: b - Wildcard @@ -205,7 +205,7 @@ pub mod test { from a=albums filter is_sponsored select {a.*} - "###).unwrap().relation.columns, @r" + "###).unwrap().relation.columns, @" - Single: is_sponsored - Wildcard ") @@ -216,7 +216,7 @@ pub mod test { assert_yaml_snapshot!(parse_resolve_and_lower(r###" from x select {a, a, a = a + 1} - "###).unwrap().relation.columns, @r" + "###).unwrap().relation.columns, @" - Single: ~ - Single: ~ - Single: a @@ -229,7 +229,7 @@ pub mod test { prql target:sql.mssql version:"0" from employees - "#).unwrap(), @r" + "#).unwrap(), @" def: version: ^0 other: diff --git a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap index 4a4a7c96be2b..c28740497cac 100644 --- a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap +++ b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap @@ -7,21 +7,21 @@ columns: name: - employees - name - target_id: 134 + target_id: 135 target_name: ~ - Single: name: - employees - salary - target_id: 135 + target_id: 136 target_name: ~ inputs: - - id: 132 + - id: 133 name: employees table: - default_db - employees - - id: 121 + - id: 122 name: managers table: - default_db diff --git a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap index d12c3c8104d0..386ee276127d 100644 --- a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap +++ b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap @@ -4,18 +4,18 @@ expression: "resolve_lineage(r#\"\n from table_1\n join cu --- columns: - All: - input_id: 119 + input_id: 120 except: [] - All: - input_id: 116 + input_id: 117 except: [] inputs: - - id: 119 + - id: 120 name: table_1 table: - default_db - table_1 - - id: 116 + - id: 117 name: customers table: - default_db diff --git a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap index 804e9f996604..82adca199d66 100644 --- a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap +++ b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap @@ -7,26 +7,26 @@ columns: name: - e - emp_no - target_id: 129 + target_id: 130 target_name: ~ - Single: name: - e - gender - target_id: 130 + target_id: 131 target_name: ~ - Single: name: - emp_salary - target_id: 148 + target_id: 149 target_name: ~ inputs: - - id: 122 + - id: 123 name: e table: - default_db - employees - - id: 119 + - id: 120 name: salaries table: - default_db diff --git a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap index e1d5c30ad09f..6ad23c78ab24 100644 --- a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap +++ b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap @@ -7,26 +7,26 @@ columns: name: - orders - customer_no - target_id: 123 + target_id: 124 target_name: ~ - Single: name: - orders - gross - target_id: 124 + target_id: 125 target_name: ~ - Single: name: - orders - tax - target_id: 125 + target_id: 126 target_name: ~ - Single: name: ~ - target_id: 126 + target_id: 127 target_name: ~ inputs: - - id: 121 + - id: 122 name: orders table: - default_db diff --git a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap index b69b52fe7aed..761566bea47a 100644 --- a/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap +++ b/prqlc/prqlc/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap @@ -21,10 +21,10 @@ TransformCall: lineage: columns: - All: - input_id: 118 + input_id: 119 except: [] inputs: - - id: 118 + - id: 119 name: c_invoice table: - default_db @@ -94,14 +94,14 @@ lineage: name: - c_invoice - issued_at - target_id: 120 + target_id: 121 target_name: ~ - Single: name: ~ - target_id: 136 + target_id: 137 target_name: ~ inputs: - - id: 118 + - id: 119 name: c_invoice table: - default_db diff --git a/prqlc/prqlc/src/semantic/resolver/transforms.rs b/prqlc/prqlc/src/semantic/resolver/transforms.rs index 20bd4210287a..778b6cc9b435 100644 --- a/prqlc/prqlc/src/semantic/resolver/transforms.rs +++ b/prqlc/prqlc/src/semantic/resolver/transforms.rs @@ -1182,7 +1182,7 @@ mod tests { group invoice_no ( take 1 ) - ").unwrap(), @r" + ").unwrap(), @" def: version: ~ other: {} @@ -1271,7 +1271,7 @@ mod tests { sort (-issued_at) sort {issued_at} sort {-issued_at} - ").unwrap(), @r" + ").unwrap(), @" def: version: ~ other: {} diff --git a/prqlc/prqlc/src/semantic/std.prql b/prqlc/prqlc/src/semantic/std.prql index 24b709f0cd4f..3b8770840933 100644 --- a/prqlc/prqlc/src/semantic/std.prql +++ b/prqlc/prqlc/src/semantic/std.prql @@ -231,6 +231,7 @@ module date { let to_text = format column -> internal std.date.to_text let diff = `noresolve.unit` start end -> internal std.date.diff let trunc = unit column -> internal std.date.trunc + let floor = amount `noresolve.unit` column -> internal std.date.floor } ## File-reading functions, primarily for DuckDB diff --git a/prqlc/prqlc/src/sql/dialect.rs b/prqlc/prqlc/src/sql/dialect.rs index 7f3f17e8fa97..3c0b59caa7b8 100644 --- a/prqlc/prqlc/src/sql/dialect.rs +++ b/prqlc/prqlc/src/sql/dialect.rs @@ -761,13 +761,13 @@ mod tests { #[test] fn test_dialect_from_str() { - assert_debug_snapshot!(Dialect::from_str("postgres"), @r" + assert_debug_snapshot!(Dialect::from_str("postgres"), @" Ok( Postgres, ) "); - assert_debug_snapshot!(Dialect::from_str("foo"), @r" + assert_debug_snapshot!(Dialect::from_str("foo"), @" Err( VariantNotFound, ) @@ -876,8 +876,8 @@ mod tests { #[test] fn bigquery_translate_space() { let bq = BigQueryDialect; - assert_snapshot!(bq.translate_chrono_item(Item::Space(" ")).unwrap(), @" "); - assert_snapshot!(bq.translate_chrono_item(Item::Space(" ")).unwrap(), @" "); + assert_snapshot!(bq.translate_chrono_item(Item::Space(" ")).unwrap(), @""); + assert_snapshot!(bq.translate_chrono_item(Item::Space(" ")).unwrap(), @""); } #[test] diff --git a/prqlc/prqlc/src/sql/gen_expr.rs b/prqlc/prqlc/src/sql/gen_expr.rs index 2fe0786b16f3..90a0b3907fc2 100644 --- a/prqlc/prqlc/src/sql/gen_expr.rs +++ b/prqlc/prqlc/src/sql/gen_expr.rs @@ -1220,53 +1220,53 @@ mod test { assert!(range_of_ranges(vec![range_1_10.clone()])?.end.is_some()); - assert_yaml_snapshot!(range_of_ranges(vec![range_1_10.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_1_10.clone()])?, @" start: 1 end: 10 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_1_10.clone(), range_1_10.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_1_10.clone(), range_1_10.clone()])?, @" start: 1 end: 10 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_1_10.clone(), range_5_6.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_1_10.clone(), range_5_6.clone()])?, @" start: 5 end: 6 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_5_6.clone(), range_1_10.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_5_6.clone(), range_1_10.clone()])?, @" start: 5 end: 6 "); // empty range - assert_yaml_snapshot!(range_of_ranges(vec![range_5_6.clone(), range_5_6.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_5_6.clone(), range_5_6.clone()])?, @" start: ~ end: 0 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_5_inf.clone(), range_5_inf.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_5_inf.clone(), range_5_inf.clone()])?, @" start: 9 end: ~ "); - assert_yaml_snapshot!(range_of_ranges(vec![range_1_10, range_5_inf])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_1_10, range_5_inf])?, @" start: 5 end: 10 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_5_6, range_inf_8.clone()])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_5_6, range_inf_8.clone()])?, @" start: 5 end: 6 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_inf_8.clone(), range_inf_8])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_inf_8.clone(), range_inf_8])?, @" start: ~ end: 8 "); - assert_yaml_snapshot!(range_of_ranges(vec![range_5_5])?, @r" + assert_yaml_snapshot!(range_of_ranges(vec![range_5_5])?, @" start: 5 end: 5 "); diff --git a/prqlc/prqlc/src/sql/gen_query.rs b/prqlc/prqlc/src/sql/gen_query.rs index c1e99c869942..b0bbabd82147 100644 --- a/prqlc/prqlc/src/sql/gen_query.rs +++ b/prqlc/prqlc/src/sql/gen_query.rs @@ -778,7 +778,7 @@ mod test { let sql_ast = crate::tests::compile(query).unwrap(); - assert_snapshot!(sql_ast, @r" + assert_snapshot!(sql_ast, @" WITH table_0 AS ( SELECT title, @@ -819,7 +819,7 @@ mod test { let sql_ast = crate::tests::compile(query).unwrap(); - assert_snapshot!(sql_ast, @r" + assert_snapshot!(sql_ast, @" WITH table_0 AS ( SELECT *, @@ -845,7 +845,7 @@ mod test { filter (average bar) > 3 "#; - assert_snapshot!(crate::tests::compile(query).unwrap(), @r" + assert_snapshot!(crate::tests::compile(query).unwrap(), @" WITH table_0 AS ( SELECT *, @@ -873,7 +873,7 @@ mod test { aggregate {c=count this} "#; - assert_snapshot!(crate::tests::compile(query).unwrap(), @r" + assert_snapshot!(crate::tests::compile(query).unwrap(), @" WITH table_0 AS ( SELECT DISTINCT ON (id, name) * diff --git a/prqlc/prqlc/src/sql/std.sql.prql b/prqlc/prqlc/src/sql/std.sql.prql index e11e2e90622d..c7b6f27a1743 100644 --- a/prqlc/prqlc/src/sql/std.sql.prql +++ b/prqlc/prqlc/src/sql/std.sql.prql @@ -142,6 +142,7 @@ module date { # BigQuery: https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_trunc # Snowflake: https://docs.snowflake.com/en/sql-reference/functions/date_trunc let trunc = unit column -> s"DATE_TRUNC({unit:0}, {column:0})" + let floor = amount unit column -> null } # Source-reading functions, primarily for DuckDB @@ -229,6 +230,7 @@ module bigquery { let diff = unit start end -> s"DATE_DIFF({end:0}, {start:0}, {unit:0})" # BigQuery requires parentheses for CURRENT_TIMESTAMP let now = -> s"CURRENT_TIMESTAMP()" + let floor = amount unit column -> s"TIMESTAMP_BUCKET(CAST({column:0} AS TIMESTAMP), INTERVAL {amount:0} {unit:0})" } let regex_search = text pattern -> s"REGEXP_CONTAINS({text:0}, {pattern:0})" @@ -250,6 +252,8 @@ module clickhouse { let diff = unit start end -> s"dateDiff('{unit:0}', {start:0}, {end:0})" # Clickhouse uses now() for current timestamp let now = -> s"now()" + # https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions#toStartOfInterval + let floor = amount unit column -> s"toStartOfInterval({column:0}, INTERVAL {amount:0} {unit:0})" } let regex_search = text pattern -> s"match({text:0}, {pattern:0})" @@ -278,6 +282,7 @@ module duckdb { let to_text = format column -> s"strftime({column:0}, {format:0})" # https://duckdb.org/docs/sql/functions/date let diff = unit start end -> s"datediff('{unit:0}', {start:0}, {end:0})" + let floor = amount unit column -> s"time_bucket(INTERVAL '{amount:0} {unit:0}', {column:0})" } let regex_search = text pattern -> s"REGEXP_MATCHES({text:0}, {pattern:0})" @@ -309,6 +314,7 @@ module mssql { module date { # https://learn.microsoft.com/en-us/sql/t-sql/functions/format-transact-sql let to_text = format column -> s"FORMAT({column:0}, {format:0})" + let floor = amount unit column -> null } let regex_search = text pattern -> null @@ -334,6 +340,7 @@ module mysql { let now = -> s"NOW()" # https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_date-trunc let trunc = unit column -> s"DATE_TRUNC({unit:0}, {column:0})" + let floor = amount unit column -> null } # 'c' for case-sensitive @@ -366,6 +373,7 @@ module postgres { let to_text = format column -> s"TO_CHAR({column:0}, {format:0})" # PostgreSQL has no built-in DATEDIFF equivalent let diff = unit start end -> null + let floor = amount unit column -> s"date_bin('{amount:0} {unit:0}', {column:0}, TIMESTAMP '1970-01-01 00:00:00')" } @{binding_strength=9} diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap index d89effb1f540..53e0075e8a91 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap @@ -7,10 +7,10 @@ frames: - - 1:101-123 - columns: - !All - input_id: 124 + input_id: 125 except: [] inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -18,15 +18,15 @@ frames: - - 1:124-154 - columns: - !All - input_id: 124 + input_id: 125 except: [] - !Single name: - empty_name - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -35,42 +35,42 @@ frames: - columns: - !Single name: null - target_id: 137 + target_id: 138 target_name: null - !Single name: null - target_id: 140 + target_id: 141 target_name: null - !Single name: null - target_id: 143 + target_id: 144 target_name: null - !Single name: null - target_id: 146 + target_id: 147 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db - tracks nodes: -- id: 124 +- id: 125 kind: Ident span: 1:89-100 ident: !Ident - default_db - tracks - parent: 130 -- id: 126 + parent: 131 +- id: 127 kind: RqOperator span: 1:108-123 targets: - - 128 - 129 - parent: 130 -- id: 128 + - 130 + parent: 131 +- id: 129 kind: Ident span: 1:108-116 ident: !Ident @@ -78,26 +78,26 @@ nodes: - tracks - genre_id targets: - - 124 -- id: 129 + - 125 +- id: 130 kind: Literal span: 1:120-123 -- id: 130 +- id: 131 kind: 'TransformCall: Filter' span: 1:101-123 children: - - 124 - - 126 - parent: 136 -- id: 131 + - 125 + - 127 + parent: 137 +- id: 132 kind: RqOperator span: 1:144-154 alias: empty_name targets: - - 133 - 134 - parent: 135 -- id: 133 + - 135 + parent: 136 +- id: 134 kind: Ident span: 1:144-148 ident: !Ident @@ -105,30 +105,30 @@ nodes: - tracks - name targets: - - 124 -- id: 134 + - 125 +- id: 135 kind: Literal span: 1:152-154 -- id: 135 +- id: 136 kind: Tuple span: 1:144-154 children: - - 131 - parent: 136 -- id: 136 + - 132 + parent: 137 +- id: 137 kind: 'TransformCall: Derive' span: 1:124-154 children: - - 130 - - 135 - parent: 150 -- id: 137 + - 131 + - 136 + parent: 151 +- id: 138 kind: RqOperator span: 1:166-178 targets: - - 139 - parent: 149 -- id: 139 + - 140 + parent: 150 +- id: 140 kind: Ident span: 1:170-178 ident: !Ident @@ -136,14 +136,14 @@ nodes: - tracks - track_id targets: - - 124 -- id: 140 + - 125 +- id: 141 kind: RqOperator span: 1:180-197 targets: - - 142 - parent: 149 -- id: 142 + - 143 + parent: 150 +- id: 143 kind: Ident span: 1:193-197 ident: !Ident @@ -151,50 +151,50 @@ nodes: - tracks - name targets: - - 124 -- id: 143 + - 125 +- id: 144 kind: RqOperator span: 1:199-213 targets: - - 145 - parent: 149 -- id: 145 + - 146 + parent: 150 +- id: 146 kind: Ident span: 1:203-213 ident: !Ident - this - empty_name targets: - - 131 -- id: 146 + - 132 +- id: 147 kind: RqOperator span: 1:215-229 targets: - - 148 - parent: 149 -- id: 148 + - 149 + parent: 150 +- id: 149 kind: Ident span: 1:219-229 ident: !Ident - this - empty_name targets: - - 131 -- id: 149 + - 132 +- id: 150 kind: Tuple span: 1:165-230 children: - - 137 - - 140 - - 143 - - 146 - parent: 150 -- id: 150 + - 138 + - 141 + - 144 + - 147 + parent: 151 +- id: 151 kind: 'TransformCall: Aggregate' span: 1:155-230 children: - - 136 - - 149 + - 137 + - 150 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap index dcdeb7ead05a..9eb962b1f2e3 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap @@ -10,22 +10,22 @@ frames: name: - invoices - customer_id - target_id: 148 + target_id: 149 target_name: null - !Single name: - invoices - invoice_id - target_id: 149 + target_id: 150 target_name: null - !Single name: - invoices - billing_country - target_id: 150 + target_id: 151 target_name: null inputs: - - id: 146 + - id: 147 name: invoices table: - default_db @@ -36,22 +36,22 @@ frames: name: - invoices - customer_id - target_id: 148 + target_id: 149 target_name: null - !Single name: - invoices - invoice_id - target_id: 149 + target_id: 150 target_name: null - !Single name: - invoices - billing_country - target_id: 150 + target_id: 151 target_name: null inputs: - - id: 146 + - id: 147 name: invoices table: - default_db @@ -62,22 +62,22 @@ frames: name: - invoices - customer_id - target_id: 129 + target_id: 130 target_name: null - !Single name: - invoices - invoice_id - target_id: 130 + target_id: 131 target_name: null - !Single name: - invoices - billing_country - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 + - id: 128 name: invoices table: - default_db @@ -88,22 +88,22 @@ frames: name: - invoices - customer_id - target_id: 129 + target_id: 130 target_name: null - !Single name: - invoices - invoice_id - target_id: 130 + target_id: 131 target_name: null - !Single name: - invoices - billing_country - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 + - id: 128 name: invoices table: - default_db @@ -114,27 +114,27 @@ frames: name: - invoices - customer_id - target_id: 148 + target_id: 149 target_name: null - !Single name: - invoices - invoice_id - target_id: 149 + target_id: 150 target_name: null - !Single name: - invoices - billing_country - target_id: 150 + target_id: 151 target_name: null inputs: - - id: 146 + - id: 147 name: invoices table: - default_db - invoices - - id: 127 + - id: 128 name: invoices table: - default_db @@ -145,34 +145,34 @@ frames: name: - invoices - billing_country - target_id: 158 + target_id: 159 target_name: null - !Single name: - invoices - invoice_id - target_id: 159 + target_id: 160 target_name: null inputs: - - id: 146 + - id: 147 name: invoices table: - default_db - invoices - - id: 127 + - id: 128 name: invoices table: - default_db - invoices nodes: -- id: 127 +- id: 128 kind: Ident span: 1:89-102 ident: !Ident - default_db - invoices - parent: 133 -- id: 129 + parent: 134 +- id: 130 kind: Ident span: 1:114-125 ident: !Ident @@ -180,9 +180,9 @@ nodes: - invoices - customer_id targets: - - 127 - parent: 132 -- id: 130 + - 128 + parent: 133 +- id: 131 kind: Ident span: 1:127-137 ident: !Ident @@ -190,9 +190,9 @@ nodes: - invoices - invoice_id targets: - - 127 - parent: 132 -- id: 131 + - 128 + parent: 133 +- id: 132 kind: Ident span: 1:139-154 ident: !Ident @@ -200,49 +200,49 @@ nodes: - invoices - billing_country targets: - - 127 - parent: 132 -- id: 132 + - 128 + parent: 133 +- id: 133 kind: Tuple span: 1:112-156 children: - - 129 - 130 - 131 - parent: 133 -- id: 133 + - 132 + parent: 134 +- id: 134 kind: 'TransformCall: Select' span: 1:105-156 children: - - 127 - - 132 - parent: 137 -- id: 134 + - 128 + - 133 + parent: 138 +- id: 135 kind: Literal span: 1:164-166 alias: start - parent: 137 -- id: 135 + parent: 138 +- id: 136 kind: Literal span: 1:168-170 alias: end - parent: 137 -- id: 137 + parent: 138 +- id: 138 kind: 'TransformCall: Take' span: 1:159-170 children: - - 133 - 134 - 135 - parent: 157 -- id: 146 + - 136 + parent: 158 +- id: 147 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 152 -- id: 148 + parent: 153 +- id: 149 kind: Ident span: 1:23-34 ident: !Ident @@ -250,9 +250,9 @@ nodes: - invoices - customer_id targets: - - 146 - parent: 151 -- id: 149 + - 147 + parent: 152 +- id: 150 kind: Ident span: 1:36-46 ident: !Ident @@ -260,9 +260,9 @@ nodes: - invoices - invoice_id targets: - - 146 - parent: 151 -- id: 150 + - 147 + parent: 152 +- id: 151 kind: Ident span: 1:48-63 ident: !Ident @@ -270,49 +270,49 @@ nodes: - invoices - billing_country targets: - - 146 - parent: 151 -- id: 151 + - 147 + parent: 152 +- id: 152 kind: Tuple span: 1:21-65 children: - - 148 - 149 - 150 - parent: 152 -- id: 152 + - 151 + parent: 153 +- id: 153 kind: 'TransformCall: Select' span: 1:14-65 children: - - 146 - - 151 - parent: 156 -- id: 153 + - 147 + - 152 + parent: 157 +- id: 154 kind: Literal span: 1:71-73 alias: start - parent: 156 -- id: 154 + parent: 157 +- id: 155 kind: Literal span: 1:75-77 alias: end - parent: 156 -- id: 156 + parent: 157 +- id: 157 kind: 'TransformCall: Take' span: 1:66-77 children: - - 152 - 153 - 154 - parent: 157 -- id: 157 + - 155 + parent: 158 +- id: 158 kind: 'TransformCall: Append' span: 1:78-172 children: - - 156 - - 137 - parent: 161 -- id: 158 + - 157 + - 138 + parent: 162 +- id: 159 kind: Ident span: 1:182-197 ident: !Ident @@ -320,9 +320,9 @@ nodes: - invoices - billing_country targets: - - 150 - parent: 160 -- id: 159 + - 151 + parent: 161 +- id: 160 kind: Ident span: 1:199-209 ident: !Ident @@ -330,21 +330,21 @@ nodes: - invoices - invoice_id targets: - - 149 - parent: 160 -- id: 160 + - 150 + parent: 161 +- id: 161 kind: Tuple span: 1:180-211 children: - - 158 - 159 - parent: 161 -- id: 161 + - 160 + parent: 162 +- id: 162 kind: 'TransformCall: Select' span: 1:173-211 children: - - 157 - - 160 + - 158 + - 161 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap index 7ae27c22007f..06482dbcb9e4 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap @@ -7,15 +7,15 @@ frames: - - 1:14-74 - columns: - !All - input_id: 164 + input_id: 165 except: [] - !Single name: - total - target_id: 166 + target_id: 167 target_name: null inputs: - - id: 164 + - id: 165 name: invoices table: - default_db @@ -26,21 +26,21 @@ frames: name: - invoices - customer_id - target_id: 179 + target_id: 180 target_name: null - !Single name: - invoices - invoice_id - target_id: 180 + target_id: 181 target_name: null - !Single name: - total - target_id: 181 + target_id: 182 target_name: null inputs: - - id: 164 + - id: 165 name: invoices table: - default_db @@ -51,21 +51,21 @@ frames: name: - invoices - customer_id - target_id: 179 + target_id: 180 target_name: null - !Single name: - invoices - invoice_id - target_id: 180 + target_id: 181 target_name: null - !Single name: - total - target_id: 181 + target_id: 182 target_name: null inputs: - - id: 164 + - id: 165 name: invoices table: - default_db @@ -73,15 +73,15 @@ frames: - - 1:156-235 - columns: - !All - input_id: 130 + input_id: 131 except: [] - !Single name: - unit_price - target_id: 132 + target_id: 133 target_name: null inputs: - - id: 130 + - id: 131 name: invoice_items table: - default_db @@ -92,21 +92,21 @@ frames: name: - invoice_items - invoice_line_id - target_id: 145 + target_id: 146 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 146 + target_id: 147 target_name: null - !Single name: - unit_price - target_id: 147 + target_id: 148 target_name: null inputs: - - id: 130 + - id: 131 name: invoice_items table: - default_db @@ -117,21 +117,21 @@ frames: name: - invoice_items - invoice_line_id - target_id: 145 + target_id: 146 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 146 + target_id: 147 target_name: null - !Single name: - unit_price - target_id: 147 + target_id: 148 target_name: null inputs: - - id: 130 + - id: 131 name: invoice_items table: - default_db @@ -142,26 +142,26 @@ frames: name: - invoices - customer_id - target_id: 179 + target_id: 180 target_name: null - !Single name: - invoices - invoice_id - target_id: 180 + target_id: 181 target_name: null - !Single name: - total - target_id: 181 + target_id: 182 target_name: null inputs: - - id: 164 + - id: 165 name: invoices table: - default_db - invoices - - id: 130 + - id: 131 name: invoice_items table: - default_db @@ -171,49 +171,49 @@ frames: - !Single name: - a - target_id: 188 + target_id: 189 target_name: null - !Single name: - b - target_id: 192 + target_id: 193 target_name: null inputs: - - id: 164 + - id: 165 name: invoices table: - default_db - invoices - - id: 130 + - id: 131 name: invoice_items table: - default_db - invoice_items nodes: -- id: 130 +- id: 131 kind: Ident span: 1:135-153 ident: !Ident - default_db - invoice_items - parent: 144 -- id: 132 + parent: 145 +- id: 133 kind: Case span: 1:176-235 alias: unit_price targets: - - 133 - - 137 - - 141 + - 134 + - 138 - 142 - parent: 143 -- id: 133 + - 143 + parent: 144 +- id: 134 kind: RqOperator span: 1:182-196 targets: - - 135 - 136 -- id: 135 + - 137 +- id: 136 kind: Ident span: 1:182-192 ident: !Ident @@ -221,17 +221,17 @@ nodes: - invoice_items - unit_price targets: - - 130 -- id: 136 + - 131 +- id: 137 kind: Literal span: 1:195-196 -- id: 137 +- id: 138 kind: RqOperator span: 1:200-214 targets: - - 139 - 140 -- id: 139 + - 141 +- id: 140 kind: Ident span: 1:200-210 ident: !Ident @@ -239,14 +239,14 @@ nodes: - invoice_items - unit_price targets: - - 130 -- id: 140 + - 131 +- id: 141 kind: Literal span: 1:213-214 -- id: 141 +- id: 142 kind: Literal span: 1:216-220 -- id: 142 +- id: 143 kind: Ident span: 1:224-234 ident: !Ident @@ -254,21 +254,21 @@ nodes: - invoice_items - unit_price targets: - - 130 -- id: 143 + - 131 +- id: 144 kind: Tuple span: 1:176-235 children: - - 132 - parent: 144 -- id: 144 + - 133 + parent: 145 +- id: 145 kind: 'TransformCall: Derive' span: 1:156-235 children: - - 130 - - 143 - parent: 149 -- id: 145 + - 131 + - 144 + parent: 150 +- id: 146 kind: Ident span: 1:247-262 ident: !Ident @@ -276,9 +276,9 @@ nodes: - invoice_items - invoice_line_id targets: - - 130 - parent: 148 -- id: 146 + - 131 + parent: 149 +- id: 147 kind: Ident span: 1:264-274 ident: !Ident @@ -286,66 +286,66 @@ nodes: - invoice_items - invoice_id targets: - - 130 - parent: 148 -- id: 147 + - 131 + parent: 149 +- id: 148 kind: Ident span: 1:276-286 ident: !Ident - this - unit_price targets: - - 132 - parent: 148 -- id: 148 + - 133 + parent: 149 +- id: 149 kind: Tuple span: 1:245-288 children: - - 145 - 146 - 147 - parent: 149 -- id: 149 + - 148 + parent: 150 +- id: 150 kind: 'TransformCall: Select' span: 1:238-288 children: - - 144 - - 148 - parent: 151 -- id: 151 + - 145 + - 149 + parent: 152 +- id: 152 kind: 'TransformCall: Take' span: 1:291-297 children: - - 149 - - 152 - parent: 187 -- id: 152 + - 150 + - 153 + parent: 188 +- id: 153 kind: Literal - parent: 151 -- id: 164 + parent: 152 +- id: 165 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 178 -- id: 166 + parent: 179 +- id: 167 kind: Case span: 1:29-74 alias: total targets: - - 167 - - 171 - - 175 + - 168 + - 172 - 176 - parent: 177 -- id: 167 + - 177 + parent: 178 +- id: 168 kind: RqOperator span: 1:35-45 targets: - - 169 - 170 -- id: 169 + - 171 +- id: 170 kind: Ident span: 1:35-40 ident: !Ident @@ -353,17 +353,17 @@ nodes: - invoices - total targets: - - 164 -- id: 170 + - 165 +- id: 171 kind: Literal span: 1:43-45 -- id: 171 +- id: 172 kind: RqOperator span: 1:49-58 targets: - - 173 - 174 -- id: 173 + - 175 +- id: 174 kind: Ident span: 1:49-54 ident: !Ident @@ -371,14 +371,14 @@ nodes: - invoices - total targets: - - 164 -- id: 174 + - 165 +- id: 175 kind: Literal span: 1:57-58 -- id: 175 +- id: 176 kind: Literal span: 1:60-64 -- id: 176 +- id: 177 kind: Ident span: 1:68-73 ident: !Ident @@ -386,21 +386,21 @@ nodes: - invoices - total targets: - - 164 -- id: 177 + - 165 +- id: 178 kind: Tuple span: 1:29-74 children: - - 166 - parent: 178 -- id: 178 + - 167 + parent: 179 +- id: 179 kind: 'TransformCall: Derive' span: 1:14-74 children: - - 164 - - 177 - parent: 183 -- id: 179 + - 165 + - 178 + parent: 184 +- id: 180 kind: Ident span: 1:84-95 ident: !Ident @@ -408,9 +408,9 @@ nodes: - invoices - customer_id targets: - - 164 - parent: 182 -- id: 180 + - 165 + parent: 183 +- id: 181 kind: Ident span: 1:97-107 ident: !Ident @@ -418,58 +418,58 @@ nodes: - invoices - invoice_id targets: - - 164 - parent: 182 -- id: 181 + - 165 + parent: 183 +- id: 182 kind: Ident span: 1:109-114 ident: !Ident - this - total targets: - - 166 - parent: 182 -- id: 182 + - 167 + parent: 183 +- id: 183 kind: Tuple span: 1:82-116 children: - - 179 - 180 - 181 - parent: 183 -- id: 183 + - 182 + parent: 184 +- id: 184 kind: 'TransformCall: Select' span: 1:75-116 children: - - 178 - - 182 - parent: 185 -- id: 185 + - 179 + - 183 + parent: 186 +- id: 186 kind: 'TransformCall: Take' span: 1:117-123 children: - - 183 - - 186 - parent: 187 -- id: 186 - kind: Literal - parent: 185 + - 184 + - 187 + parent: 188 - id: 187 + kind: Literal + parent: 186 +- id: 188 kind: 'TransformCall: Append' span: 1:124-299 children: - - 185 - - 151 - parent: 200 -- id: 188 + - 186 + - 152 + parent: 201 +- id: 189 kind: RqOperator span: 1:313-328 alias: a targets: - - 190 - 191 - parent: 199 -- id: 190 + - 192 + parent: 200 +- id: 191 kind: Ident span: 1:313-324 ident: !Ident @@ -477,28 +477,28 @@ nodes: - invoices - customer_id targets: - - 179 -- id: 191 + - 180 +- id: 192 kind: Literal span: 1:327-328 -- id: 192 +- id: 193 kind: RqOperator span: 1:334-367 alias: b targets: - - 194 - 195 - parent: 199 -- id: 194 + - 196 + parent: 200 +- id: 195 kind: Literal span: 1:345-346 -- id: 195 +- id: 196 kind: RqOperator span: 1:348-366 targets: - - 197 - 198 -- id: 197 + - 199 +- id: 198 kind: Ident span: 1:348-358 ident: !Ident @@ -506,28 +506,28 @@ nodes: - invoices - invoice_id targets: - - 180 -- id: 198 + - 181 +- id: 199 kind: Ident span: 1:361-366 ident: !Ident - this - total targets: - - 181 -- id: 199 + - 182 +- id: 200 kind: Tuple span: 1:307-369 children: - - 188 - - 192 - parent: 200 -- id: 200 + - 189 + - 193 + parent: 201 +- id: 201 kind: 'TransformCall: Select' span: 1:300-369 children: - - 187 - - 199 + - 188 + - 200 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap index feb63ea110c5..02ea7e67bdfc 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap @@ -10,22 +10,22 @@ frames: name: - invoices - customer_id - target_id: 168 + target_id: 169 target_name: null - !Single name: - invoices - invoice_id - target_id: 169 + target_id: 170 target_name: null - !Single name: - invoices - billing_country - target_id: 170 + target_id: 171 target_name: null inputs: - - id: 166 + - id: 167 name: invoices table: - default_db @@ -36,22 +36,22 @@ frames: name: - invoices - customer_id - target_id: 168 + target_id: 169 target_name: null - !Single name: - invoices - invoice_id - target_id: 169 + target_id: 170 target_name: null - !Single name: - invoices - billing_country - target_id: 170 + target_id: 171 target_name: null inputs: - - id: 166 + - id: 167 name: invoices table: - default_db @@ -60,22 +60,22 @@ frames: - columns: - !Single name: null - target_id: 150 + target_id: 151 target_name: null - !Single name: - employees - employee_id - target_id: 151 + target_id: 152 target_name: null - !Single name: - employees - country - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 148 + - id: 149 name: employees table: - default_db @@ -84,22 +84,22 @@ frames: - columns: - !Single name: null - target_id: 150 + target_id: 151 target_name: null - !Single name: - employees - employee_id - target_id: 151 + target_id: 152 target_name: null - !Single name: - employees - country - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 148 + - id: 149 name: employees table: - default_db @@ -110,27 +110,27 @@ frames: name: - invoices - customer_id - target_id: 168 + target_id: 169 target_name: null - !Single name: - invoices - invoice_id - target_id: 169 + target_id: 170 target_name: null - !Single name: - invoices - billing_country - target_id: 170 + target_id: 171 target_name: null inputs: - - id: 166 + - id: 167 name: invoices table: - default_db - invoices - - id: 148 + - id: 149 name: employees table: - default_db @@ -141,20 +141,20 @@ frames: name: - invoice_items - invoice_line_id - target_id: 129 + target_id: 130 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 130 + target_id: 131 target_name: null - !Single name: null - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 + - id: 128 name: invoice_items table: - default_db @@ -165,20 +165,20 @@ frames: name: - invoice_items - invoice_line_id - target_id: 129 + target_id: 130 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 130 + target_id: 131 target_name: null - !Single name: null - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 + - id: 128 name: invoice_items table: - default_db @@ -189,32 +189,32 @@ frames: name: - invoices - customer_id - target_id: 168 + target_id: 169 target_name: null - !Single name: - invoices - invoice_id - target_id: 169 + target_id: 170 target_name: null - !Single name: - invoices - billing_country - target_id: 170 + target_id: 171 target_name: null inputs: - - id: 166 + - id: 167 name: invoices table: - default_db - invoices - - id: 148 + - id: 149 name: employees table: - default_db - employees - - id: 127 + - id: 128 name: invoice_items table: - default_db @@ -225,39 +225,39 @@ frames: name: - invoices - billing_country - target_id: 178 + target_id: 179 target_name: null - !Single name: - invoices - invoice_id - target_id: 179 + target_id: 180 target_name: null inputs: - - id: 166 + - id: 167 name: invoices table: - default_db - invoices - - id: 148 + - id: 149 name: employees table: - default_db - employees - - id: 127 + - id: 128 name: invoice_items table: - default_db - invoice_items nodes: -- id: 127 +- id: 128 kind: Ident span: 1:168-186 ident: !Ident - default_db - invoice_items - parent: 133 -- id: 129 + parent: 134 +- id: 130 kind: Ident span: 1:198-213 ident: !Ident @@ -265,9 +265,9 @@ nodes: - invoice_items - invoice_line_id targets: - - 127 - parent: 132 -- id: 130 + - 128 + parent: 133 +- id: 131 kind: Ident span: 1:215-225 ident: !Ident @@ -275,45 +275,45 @@ nodes: - invoice_items - invoice_id targets: - - 127 - parent: 132 -- id: 131 + - 128 + parent: 133 +- id: 132 kind: Literal span: 1:227-231 - parent: 132 -- id: 132 + parent: 133 +- id: 133 kind: Tuple span: 1:196-233 children: - - 129 - 130 - 131 - parent: 133 -- id: 133 + - 132 + parent: 134 +- id: 134 kind: 'TransformCall: Select' span: 1:189-233 children: - - 127 - - 132 - parent: 135 -- id: 135 + - 128 + - 133 + parent: 136 +- id: 136 kind: 'TransformCall: Take' span: 1:236-242 children: - - 133 - - 136 - parent: 177 -- id: 136 + - 134 + - 137 + parent: 178 +- id: 137 kind: Literal - parent: 135 -- id: 148 + parent: 136 +- id: 149 kind: Ident span: 1:84-98 ident: !Ident - default_db - employees - parent: 154 -- id: 150 + parent: 155 +- id: 151 kind: Ident span: 1:110-121 ident: !Ident @@ -321,9 +321,9 @@ nodes: - employees - employee_id targets: - - 148 - parent: 153 -- id: 151 + - 149 + parent: 154 +- id: 152 kind: Ident span: 1:123-134 ident: !Ident @@ -331,9 +331,9 @@ nodes: - employees - employee_id targets: - - 148 - parent: 153 -- id: 152 + - 149 + parent: 154 +- id: 153 kind: Ident span: 1:136-143 ident: !Ident @@ -341,41 +341,41 @@ nodes: - employees - country targets: - - 148 - parent: 153 -- id: 153 + - 149 + parent: 154 +- id: 154 kind: Tuple span: 1:108-145 children: - - 150 - 151 - 152 - parent: 154 -- id: 154 + - 153 + parent: 155 +- id: 155 kind: 'TransformCall: Select' span: 1:101-145 children: - - 148 - - 153 - parent: 156 -- id: 156 + - 149 + - 154 + parent: 157 +- id: 157 kind: 'TransformCall: Take' span: 1:148-154 children: - - 154 - - 157 - parent: 176 -- id: 157 + - 155 + - 158 + parent: 177 +- id: 158 kind: Literal - parent: 156 -- id: 166 + parent: 157 +- id: 167 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 172 -- id: 168 + parent: 173 +- id: 169 kind: Ident span: 1:23-34 ident: !Ident @@ -383,9 +383,9 @@ nodes: - invoices - customer_id targets: - - 166 - parent: 171 -- id: 169 + - 167 + parent: 172 +- id: 170 kind: Ident span: 1:36-46 ident: !Ident @@ -393,9 +393,9 @@ nodes: - invoices - invoice_id targets: - - 166 - parent: 171 -- id: 170 + - 167 + parent: 172 +- id: 171 kind: Ident span: 1:48-63 ident: !Ident @@ -403,48 +403,48 @@ nodes: - invoices - billing_country targets: - - 166 - parent: 171 -- id: 171 + - 167 + parent: 172 +- id: 172 kind: Tuple span: 1:21-65 children: - - 168 - 169 - 170 - parent: 172 -- id: 172 + - 171 + parent: 173 +- id: 173 kind: 'TransformCall: Select' span: 1:14-65 children: - - 166 - - 171 - parent: 174 -- id: 174 + - 167 + - 172 + parent: 175 +- id: 175 kind: 'TransformCall: Take' span: 1:66-72 children: - - 172 - - 175 - parent: 176 -- id: 175 - kind: Literal - parent: 174 + - 173 + - 176 + parent: 177 - id: 176 + kind: Literal + parent: 175 +- id: 177 kind: 'TransformCall: Append' span: 1:73-156 children: - - 174 - - 156 - parent: 177 -- id: 177 + - 175 + - 157 + parent: 178 +- id: 178 kind: 'TransformCall: Append' span: 1:157-244 children: - - 176 - - 135 - parent: 181 -- id: 178 + - 177 + - 136 + parent: 182 +- id: 179 kind: Ident span: 1:254-269 ident: !Ident @@ -452,9 +452,9 @@ nodes: - invoices - billing_country targets: - - 170 - parent: 180 -- id: 179 + - 171 + parent: 181 +- id: 180 kind: Ident span: 1:271-281 ident: !Ident @@ -462,21 +462,21 @@ nodes: - invoices - invoice_id targets: - - 169 - parent: 180 -- id: 180 + - 170 + parent: 181 +- id: 181 kind: Tuple span: 1:252-283 children: - - 178 - 179 - parent: 181 -- id: 181 + - 180 + parent: 182 +- id: 182 kind: 'TransformCall: Select' span: 1:245-283 children: - - 177 - - 180 + - 178 + - 181 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap index 3b99f97e1c83..25e739a963f9 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap @@ -9,15 +9,15 @@ frames: - !Single name: - an_id - target_id: 143 + target_id: 144 target_name: null - !Single name: - name - target_id: 144 + target_id: 145 target_name: null inputs: - - id: 141 + - id: 142 name: invoices table: - default_db @@ -27,15 +27,15 @@ frames: - !Single name: - an_id - target_id: 143 + target_id: 144 target_name: null - !Single name: - name - target_id: 144 + target_id: 145 target_name: null inputs: - - id: 141 + - id: 142 name: invoices table: - default_db @@ -45,15 +45,15 @@ frames: - !Single name: - an_id - target_id: 126 + target_id: 127 target_name: null - !Single name: - name - target_id: 127 + target_id: 128 target_name: null inputs: - - id: 124 + - id: 125 name: employees table: - default_db @@ -63,15 +63,15 @@ frames: - !Single name: - an_id - target_id: 126 + target_id: 127 target_name: null - !Single name: - name - target_id: 127 + target_id: 128 target_name: null inputs: - - id: 124 + - id: 125 name: employees table: - default_db @@ -81,38 +81,38 @@ frames: - !Single name: - an_id - target_id: 143 + target_id: 144 target_name: null - !Single name: - name - target_id: 144 + target_id: 145 target_name: null inputs: - - id: 141 + - id: 142 name: invoices table: - default_db - invoices - - id: 124 + - id: 125 name: employees table: - default_db - employees nodes: -- id: 124 +- id: 125 kind: Ident span: 1:73-87 ident: !Ident - default_db - employees - parent: 129 -- id: 126 + parent: 130 +- id: 127 kind: Literal span: 1:106-110 alias: an_id - parent: 128 -- id: 127 + parent: 129 +- id: 128 kind: Ident span: 1:119-129 alias: name @@ -121,40 +121,40 @@ nodes: - employees - first_name targets: - - 124 - parent: 128 -- id: 128 + - 125 + parent: 129 +- id: 129 kind: Tuple span: 1:97-130 children: - - 126 - 127 - parent: 129 -- id: 129 + - 128 + parent: 130 +- id: 130 kind: 'TransformCall: Select' span: 1:90-130 children: - - 124 - - 128 - parent: 131 -- id: 131 + - 125 + - 129 + parent: 132 +- id: 132 kind: 'TransformCall: Take' span: 1:133-139 children: - - 129 - - 132 - parent: 150 -- id: 132 + - 130 + - 133 + parent: 151 +- id: 133 kind: Literal - parent: 131 -- id: 141 + parent: 132 +- id: 142 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 146 -- id: 143 + parent: 147 +- id: 144 kind: Ident span: 1:30-40 alias: an_id @@ -163,43 +163,43 @@ nodes: - invoices - invoice_id targets: - - 141 - parent: 145 -- id: 144 + - 142 + parent: 146 +- id: 145 kind: Literal span: 1:49-53 alias: name - parent: 145 -- id: 145 + parent: 146 +- id: 146 kind: Tuple span: 1:21-54 children: - - 143 - 144 - parent: 146 -- id: 146 + - 145 + parent: 147 +- id: 147 kind: 'TransformCall: Select' span: 1:14-54 children: - - 141 - - 145 - parent: 148 -- id: 148 + - 142 + - 146 + parent: 149 +- id: 149 kind: 'TransformCall: Take' span: 1:55-61 children: - - 146 - - 149 - parent: 150 -- id: 149 - kind: Literal - parent: 148 + - 147 + - 150 + parent: 151 - id: 150 + kind: Literal + parent: 149 +- id: 151 kind: 'TransformCall: Append' span: 1:62-141 children: - - 148 - - 131 + - 149 + - 132 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap index bbd4f0cf1613..886ac7799396 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap @@ -10,16 +10,16 @@ frames: name: - invoices - invoice_id - target_id: 140 + target_id: 141 target_name: null - !Single name: - invoices - billing_country - target_id: 141 + target_id: 142 target_name: null inputs: - - id: 138 + - id: 139 name: invoices table: - default_db @@ -29,16 +29,16 @@ frames: - !Single name: - invoice_id - target_id: 126 + target_id: 127 target_name: null - !Single name: - invoices - billing_country - target_id: 130 + target_id: 131 target_name: null inputs: - - id: 124 + - id: 125 name: invoices table: - default_db @@ -49,21 +49,21 @@ frames: name: - invoices - invoice_id - target_id: 140 + target_id: 141 target_name: null - !Single name: - invoices - billing_country - target_id: 141 + target_id: 142 target_name: null inputs: - - id: 138 + - id: 139 name: invoices table: - default_db - invoices - - id: 124 + - id: 125 name: invoices table: - default_db @@ -74,42 +74,42 @@ frames: name: - invoices - invoice_id - target_id: 140 + target_id: 141 target_name: null - !Single name: - invoices - billing_country - target_id: 141 + target_id: 142 target_name: null inputs: - - id: 138 + - id: 139 name: invoices table: - default_db - invoices - - id: 124 + - id: 125 name: invoices table: - default_db - invoices nodes: -- id: 124 +- id: 125 kind: Ident span: 1:64-77 ident: !Ident - default_db - invoices - parent: 132 -- id: 126 + parent: 133 +- id: 127 kind: RqOperator span: 1:102-120 alias: invoice_id targets: - - 128 - 129 - parent: 131 -- id: 128 + - 130 + parent: 132 +- id: 129 kind: Ident span: 1:102-114 ident: !Ident @@ -117,11 +117,11 @@ nodes: - invoices - invoice_id targets: - - 124 -- id: 129 + - 125 +- id: 130 kind: Literal span: 1:117-120 -- id: 130 +- id: 131 kind: Ident span: 1:122-137 ident: !Ident @@ -129,30 +129,30 @@ nodes: - invoices - billing_country targets: - - 124 - parent: 131 -- id: 131 + - 125 + parent: 132 +- id: 132 kind: Tuple span: 1:87-139 children: - - 126 - - 130 - parent: 132 -- id: 132 + - 127 + - 131 + parent: 133 +- id: 133 kind: 'TransformCall: Select' span: 1:80-139 children: - - 124 - - 131 - parent: 144 -- id: 138 + - 125 + - 132 + parent: 145 +- id: 139 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 143 -- id: 140 + parent: 144 +- id: 141 kind: Ident span: 1:23-33 ident: !Ident @@ -160,9 +160,9 @@ nodes: - invoices - invoice_id targets: - - 138 - parent: 142 -- id: 141 + - 139 + parent: 143 +- id: 142 kind: Ident span: 1:35-50 ident: !Ident @@ -170,40 +170,40 @@ nodes: - invoices - billing_country targets: - - 138 - parent: 142 -- id: 142 + - 139 + parent: 143 +- id: 143 kind: Tuple span: 1:21-52 children: - - 140 - 141 - parent: 143 -- id: 143 - kind: 'TransformCall: Select' - span: 1:14-52 - children: - - 138 - 142 parent: 144 - id: 144 - kind: 'TransformCall: Append' - span: 1:53-141 + kind: 'TransformCall: Select' + span: 1:14-52 children: + - 139 - 143 - - 132 - parent: 150 + parent: 145 - id: 145 + kind: 'TransformCall: Append' + span: 1:53-141 + children: + - 144 + - 133 + parent: 151 +- id: 146 kind: RqOperator span: 1:168-189 targets: - - 148 - 149 - parent: 150 -- id: 148 + - 150 + parent: 151 +- id: 149 kind: Literal span: 1:185-188 -- id: 149 +- id: 150 kind: Ident span: 1:150-165 ident: !Ident @@ -211,13 +211,13 @@ nodes: - invoices - billing_country targets: - - 141 -- id: 150 + - 142 +- id: 151 kind: 'TransformCall: Filter' span: 1:142-190 children: - - 144 - 145 + - 146 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap index c4254d6fc762..fd81e63ff734 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap @@ -8,875 +8,875 @@ frames: - columns: - !Single name: - - _literal_121 + - _literal_122 - id - target_id: 163 + target_id: 164 target_name: null - !Single name: null - target_id: 164 + target_id: 165 target_name: null - !Single name: null - target_id: 168 + target_id: 169 target_name: null - !Single name: null - target_id: 172 + target_id: 173 target_name: null - !Single name: null - target_id: 176 + target_id: 177 target_name: null - !Single name: - q_ii - target_id: 180 + target_id: 181 target_name: null - !Single name: - q_if - target_id: 184 + target_id: 185 target_name: null - !Single name: - q_fi - target_id: 188 + target_id: 189 target_name: null - !Single name: - q_ff - target_id: 192 + target_id: 193 target_name: null - !Single name: - r_ii - target_id: 196 + target_id: 197 target_name: null - !Single name: - r_if - target_id: 200 + target_id: 201 target_name: null - !Single name: - r_fi - target_id: 204 + target_id: 205 target_name: null - !Single name: - r_ff - target_id: 208 + target_id: 209 target_name: null - !Single name: null - target_id: 212 + target_id: 213 target_name: null - !Single name: null - target_id: 223 + target_id: 224 target_name: null - !Single name: null - target_id: 234 + target_id: 235 target_name: null - !Single name: null - target_id: 245 + target_id: 246 target_name: null inputs: - - id: 121 - name: _literal_121 + - id: 122 + name: _literal_122 table: - default_db - - _literal_121 + - _literal_122 - - 1:825-832 - columns: - !Single name: - - _literal_121 + - _literal_122 - id - target_id: 163 + target_id: 164 target_name: null - !Single name: null - target_id: 164 + target_id: 165 target_name: null - !Single name: null - target_id: 168 + target_id: 169 target_name: null - !Single name: null - target_id: 172 + target_id: 173 target_name: null - !Single name: null - target_id: 176 + target_id: 177 target_name: null - !Single name: - q_ii - target_id: 180 + target_id: 181 target_name: null - !Single name: - q_if - target_id: 184 + target_id: 185 target_name: null - !Single name: - q_fi - target_id: 188 + target_id: 189 target_name: null - !Single name: - q_ff - target_id: 192 + target_id: 193 target_name: null - !Single name: - r_ii - target_id: 196 + target_id: 197 target_name: null - !Single name: - r_if - target_id: 200 + target_id: 201 target_name: null - !Single name: - r_fi - target_id: 204 + target_id: 205 target_name: null - !Single name: - r_ff - target_id: 208 + target_id: 209 target_name: null - !Single name: null - target_id: 212 + target_id: 213 target_name: null - !Single name: null - target_id: 223 + target_id: 224 target_name: null - !Single name: null - target_id: 234 + target_id: 235 target_name: null - !Single name: null - target_id: 245 + target_id: 246 target_name: null inputs: - - id: 121 - name: _literal_121 + - id: 122 + name: _literal_122 table: - default_db - - _literal_121 + - _literal_122 nodes: -- id: 121 +- id: 122 kind: Array span: 1:13-317 children: - - 122 - - 128 - - 138 - - 148 - parent: 257 -- id: 122 + - 123 + - 129 + - 139 + - 149 + parent: 258 +- id: 123 kind: Tuple span: 1:24-92 children: - - 123 - 124 - 125 - 126 - 127 - parent: 121 -- id: 123 + - 128 + parent: 122 +- id: 124 kind: Literal span: 1:31-32 alias: id - parent: 122 -- id: 124 + parent: 123 +- id: 125 kind: Literal span: 1:43-45 alias: x_int - parent: 122 -- id: 125 + parent: 123 +- id: 126 kind: Literal span: 1:58-62 alias: x_float - parent: 122 -- id: 126 + parent: 123 +- id: 127 kind: Literal span: 1:73-74 alias: k_int - parent: 122 -- id: 127 + parent: 123 +- id: 128 kind: Literal span: 1:87-90 alias: k_float - parent: 122 -- id: 128 + parent: 123 +- id: 129 kind: Tuple span: 1:98-166 children: - - 129 - 130 - - 133 - - 136 + - 131 + - 134 - 137 - parent: 121 -- id: 129 + - 138 + parent: 122 +- id: 130 kind: Literal span: 1:105-106 alias: id - parent: 128 -- id: 130 + parent: 129 +- id: 131 kind: Literal span: 1:116-119 alias: x_int - parent: 128 -- id: 133 + parent: 129 +- id: 134 kind: Literal span: 1:131-136 alias: x_float - parent: 128 -- id: 136 + parent: 129 +- id: 137 kind: Literal span: 1:147-148 alias: k_int - parent: 128 -- id: 137 + parent: 129 +- id: 138 kind: Literal span: 1:161-164 alias: k_float - parent: 128 -- id: 138 + parent: 129 +- id: 139 kind: Tuple span: 1:172-240 children: - - 139 - 140 - 141 - 142 - - 145 - parent: 121 -- id: 139 + - 143 + - 146 + parent: 122 +- id: 140 kind: Literal span: 1:179-180 alias: id - parent: 138 -- id: 140 + parent: 139 +- id: 141 kind: Literal span: 1:191-193 alias: x_int - parent: 138 -- id: 141 + parent: 139 +- id: 142 kind: Literal span: 1:206-210 alias: x_float - parent: 138 -- id: 142 + parent: 139 +- id: 143 kind: Literal span: 1:220-222 alias: k_int - parent: 138 -- id: 145 + parent: 139 +- id: 146 kind: Literal span: 1:234-238 alias: k_float - parent: 138 -- id: 148 + parent: 139 +- id: 149 kind: Tuple span: 1:246-314 children: - - 149 - 150 - - 153 - - 156 - - 159 - parent: 121 -- id: 149 + - 151 + - 154 + - 157 + - 160 + parent: 122 +- id: 150 kind: Literal span: 1:253-254 alias: id - parent: 148 -- id: 150 + parent: 149 +- id: 151 kind: Literal span: 1:264-267 alias: x_int - parent: 148 -- id: 153 + parent: 149 +- id: 154 kind: Literal span: 1:279-284 alias: x_float - parent: 148 -- id: 156 + parent: 149 +- id: 157 kind: Literal span: 1:294-296 alias: k_int - parent: 148 -- id: 159 + parent: 149 +- id: 160 kind: Literal span: 1:308-312 alias: k_float - parent: 148 -- id: 163 + parent: 149 +- id: 164 kind: Ident span: 1:331-333 ident: !Ident - this - - _literal_121 + - _literal_122 - id targets: - - 121 - parent: 256 -- id: 164 + - 122 + parent: 257 +- id: 165 kind: RqOperator span: 1:340-353 targets: - - 166 - 167 - parent: 256 -- id: 166 + - 168 + parent: 257 +- id: 167 kind: Ident span: 1:340-345 ident: !Ident - this - - _literal_121 + - _literal_122 - x_int targets: - - 121 -- id: 167 + - 122 +- id: 168 kind: Ident span: 1:348-353 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 168 + - 122 +- id: 169 kind: RqOperator span: 1:359-374 targets: - - 170 - 171 - parent: 256 -- id: 170 + - 172 + parent: 257 +- id: 171 kind: Ident span: 1:359-364 ident: !Ident - this - - _literal_121 + - _literal_122 - x_int targets: - - 121 -- id: 171 + - 122 +- id: 172 kind: Ident span: 1:367-374 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 172 + - 122 +- id: 173 kind: RqOperator span: 1:380-395 targets: - - 174 - 175 - parent: 256 -- id: 174 + - 176 + parent: 257 +- id: 175 kind: Ident span: 1:380-387 ident: !Ident - this - - _literal_121 + - _literal_122 - x_float targets: - - 121 -- id: 175 + - 122 +- id: 176 kind: Ident span: 1:390-395 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 176 + - 122 +- id: 177 kind: RqOperator span: 1:401-418 targets: - - 178 - 179 - parent: 256 -- id: 178 + - 180 + parent: 257 +- id: 179 kind: Ident span: 1:401-408 ident: !Ident - this - - _literal_121 + - _literal_122 - x_float targets: - - 121 -- id: 179 + - 122 +- id: 180 kind: Ident span: 1:411-418 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 180 + - 122 +- id: 181 kind: RqOperator span: 1:432-446 alias: q_ii targets: - - 182 - 183 - parent: 256 -- id: 182 + - 184 + parent: 257 +- id: 183 kind: Ident span: 1:432-437 ident: !Ident - this - - _literal_121 + - _literal_122 - x_int targets: - - 121 -- id: 183 + - 122 +- id: 184 kind: Ident span: 1:441-446 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 184 + - 122 +- id: 185 kind: RqOperator span: 1:459-475 alias: q_if targets: - - 186 - 187 - parent: 256 -- id: 186 + - 188 + parent: 257 +- id: 187 kind: Ident span: 1:459-464 ident: !Ident - this - - _literal_121 + - _literal_122 - x_int targets: - - 121 -- id: 187 + - 122 +- id: 188 kind: Ident span: 1:468-475 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 188 + - 122 +- id: 189 kind: RqOperator span: 1:488-504 alias: q_fi targets: - - 190 - 191 - parent: 256 -- id: 190 + - 192 + parent: 257 +- id: 191 kind: Ident span: 1:488-495 ident: !Ident - this - - _literal_121 + - _literal_122 - x_float targets: - - 121 -- id: 191 + - 122 +- id: 192 kind: Ident span: 1:499-504 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 192 + - 122 +- id: 193 kind: RqOperator span: 1:517-535 alias: q_ff targets: - - 194 - 195 - parent: 256 -- id: 194 + - 196 + parent: 257 +- id: 195 kind: Ident span: 1:517-524 ident: !Ident - this - - _literal_121 + - _literal_122 - x_float targets: - - 121 -- id: 195 + - 122 +- id: 196 kind: Ident span: 1:528-535 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 196 + - 122 +- id: 197 kind: RqOperator span: 1:549-562 alias: r_ii targets: - - 198 - 199 - parent: 256 -- id: 198 + - 200 + parent: 257 +- id: 199 kind: Ident span: 1:549-554 ident: !Ident - this - - _literal_121 + - _literal_122 - x_int targets: - - 121 -- id: 199 + - 122 +- id: 200 kind: Ident span: 1:557-562 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 200 + - 122 +- id: 201 kind: RqOperator span: 1:575-590 alias: r_if targets: - - 202 - 203 - parent: 256 -- id: 202 + - 204 + parent: 257 +- id: 203 kind: Ident span: 1:575-580 ident: !Ident - this - - _literal_121 + - _literal_122 - x_int targets: - - 121 -- id: 203 + - 122 +- id: 204 kind: Ident span: 1:583-590 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 204 + - 122 +- id: 205 kind: RqOperator span: 1:603-618 alias: r_fi targets: - - 206 - 207 - parent: 256 -- id: 206 + - 208 + parent: 257 +- id: 207 kind: Ident span: 1:603-610 ident: !Ident - this - - _literal_121 + - _literal_122 - x_float targets: - - 121 -- id: 207 + - 122 +- id: 208 kind: Ident span: 1:613-618 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 208 + - 122 +- id: 209 kind: RqOperator span: 1:631-648 alias: r_ff targets: - - 210 - 211 - parent: 256 -- id: 210 + - 212 + parent: 257 +- id: 211 kind: Ident span: 1:631-638 ident: !Ident - this - - _literal_121 + - _literal_122 - x_float targets: - - 121 -- id: 211 + - 122 +- id: 212 kind: Ident span: 1:641-648 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 212 + - 122 +- id: 213 kind: RqOperator span: 1:678-690 targets: - - 215 - 216 - parent: 256 -- id: 215 + - 217 + parent: 257 +- id: 216 kind: Literal span: 1:689-690 -- id: 216 +- id: 217 kind: RqOperator span: 1:656-675 targets: - - 218 - - 222 -- id: 218 + - 219 + - 223 +- id: 219 kind: RqOperator span: 1:656-668 targets: - - 220 - 221 -- id: 220 + - 222 +- id: 221 kind: Ident span: 1:656-660 ident: !Ident - this - q_ii targets: - - 180 -- id: 221 + - 181 +- id: 222 kind: Ident span: 1:663-668 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 222 + - 122 +- id: 223 kind: Ident span: 1:671-675 ident: !Ident - this - r_ii targets: - - 196 -- id: 223 + - 197 +- id: 224 kind: RqOperator span: 1:722-734 targets: - - 226 - 227 - parent: 256 -- id: 226 + - 228 + parent: 257 +- id: 227 kind: Literal span: 1:733-734 -- id: 227 +- id: 228 kind: RqOperator span: 1:698-719 targets: - - 229 - - 233 -- id: 229 + - 230 + - 234 +- id: 230 kind: RqOperator span: 1:698-712 targets: - - 231 - 232 -- id: 231 + - 233 +- id: 232 kind: Ident span: 1:698-702 ident: !Ident - this - q_if targets: - - 184 -- id: 232 + - 185 +- id: 233 kind: Ident span: 1:705-712 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 233 + - 122 +- id: 234 kind: Ident span: 1:715-719 ident: !Ident - this - r_if targets: - - 200 -- id: 234 + - 201 +- id: 235 kind: RqOperator span: 1:764-776 targets: - - 237 - 238 - parent: 256 -- id: 237 + - 239 + parent: 257 +- id: 238 kind: Literal span: 1:775-776 -- id: 238 +- id: 239 kind: RqOperator span: 1:742-761 targets: - - 240 - - 244 -- id: 240 + - 241 + - 245 +- id: 241 kind: RqOperator span: 1:742-754 targets: - - 242 - 243 -- id: 242 + - 244 +- id: 243 kind: Ident span: 1:742-746 ident: !Ident - this - q_fi targets: - - 188 -- id: 243 + - 189 +- id: 244 kind: Ident span: 1:749-754 ident: !Ident - this - - _literal_121 + - _literal_122 - k_int targets: - - 121 -- id: 244 + - 122 +- id: 245 kind: Ident span: 1:757-761 ident: !Ident - this - r_fi targets: - - 204 -- id: 245 + - 205 +- id: 246 kind: RqOperator span: 1:808-820 targets: - - 248 - 249 - parent: 256 -- id: 248 + - 250 + parent: 257 +- id: 249 kind: Literal span: 1:819-820 -- id: 249 +- id: 250 kind: RqOperator span: 1:784-805 targets: - - 251 - - 255 -- id: 251 + - 252 + - 256 +- id: 252 kind: RqOperator span: 1:784-798 targets: - - 253 - 254 -- id: 253 + - 255 +- id: 254 kind: Ident span: 1:784-788 ident: !Ident - this - q_ff targets: - - 192 -- id: 254 + - 193 +- id: 255 kind: Ident span: 1:791-798 ident: !Ident - this - - _literal_121 + - _literal_122 - k_float targets: - - 121 -- id: 255 + - 122 +- id: 256 kind: Ident span: 1:801-805 ident: !Ident - this - r_ff targets: - - 208 -- id: 256 + - 209 +- id: 257 kind: Tuple span: 1:325-824 children: - - 163 - 164 - - 168 - - 172 - - 176 - - 180 - - 184 - - 188 - - 192 - - 196 - - 200 - - 204 - - 208 - - 212 - - 223 - - 234 - - 245 - parent: 257 -- id: 257 + - 165 + - 169 + - 173 + - 177 + - 181 + - 185 + - 189 + - 193 + - 197 + - 201 + - 205 + - 209 + - 213 + - 224 + - 235 + - 246 + parent: 258 +- id: 258 kind: 'TransformCall: Select' span: 1:318-824 children: - - 121 - - 256 - parent: 260 -- id: 258 + - 122 + - 257 + parent: 261 +- id: 259 kind: Ident span: 1:830-832 ident: !Ident - this - - _literal_121 + - _literal_122 - id targets: - - 163 - parent: 260 -- id: 260 + - 164 + parent: 261 +- id: 261 kind: 'TransformCall: Sort' span: 1:825-832 children: - - 257 - 258 + - 259 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap index 4b4b7e6a1c67..ce5b68312d60 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap @@ -7,10 +7,10 @@ frames: - - 1:25-38 - columns: - !All - input_id: 124 + input_id: 125 except: [] inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -21,15 +21,15 @@ frames: name: - tracks - name - target_id: 131 + target_id: 132 target_name: null - !Single name: - bin - target_id: 132 + target_id: 133 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -40,28 +40,28 @@ frames: name: - tracks - name - target_id: 131 + target_id: 132 target_name: null - !Single name: - bin - target_id: 132 + target_id: 133 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db - tracks nodes: -- id: 124 +- id: 125 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 130 -- id: 128 + parent: 131 +- id: 129 kind: Ident span: 1:32-37 ident: !Ident @@ -69,16 +69,16 @@ nodes: - tracks - bytes targets: - - 124 - parent: 130 -- id: 130 + - 125 + parent: 131 +- id: 131 kind: 'TransformCall: Sort' span: 1:25-38 children: - - 124 - - 128 - parent: 140 -- id: 131 + - 125 + - 129 + parent: 141 +- id: 132 kind: Ident span: 1:52-56 ident: !Ident @@ -86,22 +86,22 @@ nodes: - tracks - name targets: - - 124 - parent: 139 -- id: 132 + - 125 + parent: 140 +- id: 133 kind: RqOperator span: 1:68-95 alias: bin targets: - - 134 - - 138 - parent: 139 -- id: 134 + - 135 + - 139 + parent: 140 +- id: 135 kind: RqOperator span: 1:81-88 targets: - - 137 -- id: 137 + - 138 +- id: 138 kind: Ident span: 1:70-78 ident: !Ident @@ -109,33 +109,33 @@ nodes: - tracks - album_id targets: - - 124 -- id: 138 + - 125 +- id: 139 kind: Literal span: 1:92-94 -- id: 139 +- id: 140 kind: Tuple span: 1:46-97 children: - - 131 - 132 - parent: 140 -- id: 140 + - 133 + parent: 141 +- id: 141 kind: 'TransformCall: Select' span: 1:39-97 children: - - 130 - - 139 - parent: 142 -- id: 142 + - 131 + - 140 + parent: 143 +- id: 143 kind: 'TransformCall: Take' span: 1:98-105 children: - - 140 - - 143 -- id: 143 + - 141 + - 144 +- id: 144 kind: Literal - parent: 142 + parent: 143 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap index 29b0129956ed..957f312352e1 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap @@ -7,10 +7,10 @@ frames: - - 1:12-19 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: genres table: - default_db @@ -18,10 +18,10 @@ frames: - - 1:20-31 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: genres table: - default_db @@ -29,10 +29,10 @@ frames: - - 1:32-39 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: genres table: - default_db @@ -40,10 +40,10 @@ frames: - - 1:40-51 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: genres table: - default_db @@ -53,81 +53,81 @@ frames: - !Single name: - d - target_id: 142 + target_id: 143 target_name: null inputs: - - id: 130 + - id: 131 name: genres table: - default_db - genres nodes: -- id: 130 +- id: 131 kind: Ident span: 1:0-11 ident: !Ident - default_db - genres - parent: 133 -- id: 133 + parent: 134 +- id: 134 kind: 'TransformCall: Take' span: 1:12-19 children: - - 130 - - 134 - parent: 136 -- id: 134 - kind: Literal - parent: 133 + - 131 + - 135 + parent: 137 - id: 135 kind: Literal - span: 1:27-31 - parent: 136 + parent: 134 - id: 136 + kind: Literal + span: 1:27-31 + parent: 137 +- id: 137 kind: 'TransformCall: Filter' span: 1:20-31 children: - - 133 - - 135 - parent: 138 -- id: 138 + - 134 + - 136 + parent: 139 +- id: 139 kind: 'TransformCall: Take' span: 1:32-39 children: - - 136 - - 139 - parent: 141 -- id: 139 - kind: Literal - parent: 138 + - 137 + - 140 + parent: 142 - id: 140 kind: Literal - span: 1:47-51 - parent: 141 + parent: 139 - id: 141 + kind: Literal + span: 1:47-51 + parent: 142 +- id: 142 kind: 'TransformCall: Filter' span: 1:40-51 children: - - 138 - - 140 - parent: 144 -- id: 142 + - 139 + - 141 + parent: 145 +- id: 143 kind: Literal span: 1:63-65 alias: d - parent: 143 -- id: 143 + parent: 144 +- id: 144 kind: Tuple span: 1:63-65 children: - - 142 - parent: 144 -- id: 144 + - 143 + parent: 145 +- id: 145 kind: 'TransformCall: Select' span: 1:52-65 children: - - 141 - - 143 + - 142 + - 144 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap index 108921396c32..c6272dffce71 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap @@ -7,10 +7,10 @@ frames: - - 1:71-78 - columns: - !All - input_id: 121 + input_id: 122 except: [] inputs: - - id: 121 + - id: 122 name: invoices table: - default_db @@ -20,99 +20,99 @@ frames: - !Single name: - d1 - target_id: 126 + target_id: 127 target_name: null - !Single name: - d2 - target_id: 131 + target_id: 132 target_name: null - !Single name: - d3 - target_id: 136 + target_id: 137 target_name: null - !Single name: - d4 - target_id: 141 + target_id: 142 target_name: null - !Single name: - d5 - target_id: 146 + target_id: 147 target_name: null - !Single name: - d6 - target_id: 151 + target_id: 152 target_name: null - !Single name: - d7 - target_id: 156 + target_id: 157 target_name: null - !Single name: - d8 - target_id: 161 + target_id: 162 target_name: null - !Single name: - d9 - target_id: 166 + target_id: 167 target_name: null - !Single name: - d10 - target_id: 171 + target_id: 172 target_name: null - !Single name: - d11 - target_id: 176 + target_id: 177 target_name: null - !Single name: - d12 - target_id: 181 + target_id: 182 target_name: null inputs: - - id: 121 + - id: 122 name: invoices table: - default_db - invoices nodes: -- id: 121 +- id: 122 kind: Ident span: 1:57-70 ident: !Ident - default_db - invoices - parent: 124 -- id: 124 + parent: 125 +- id: 125 kind: 'TransformCall: Take' span: 1:71-78 children: - - 121 - - 125 - parent: 187 -- id: 125 - kind: Literal - parent: 124 + - 122 + - 126 + parent: 188 - id: 126 + kind: Literal + parent: 125 +- id: 127 kind: RqOperator span: 1:113-136 alias: d1 targets: - - 129 - 130 - parent: 186 -- id: 129 + - 131 + parent: 187 +- id: 130 kind: Literal span: 1:126-136 -- id: 130 +- id: 131 kind: Ident span: 1:98-110 ident: !Ident @@ -120,19 +120,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 131 + - 122 +- id: 132 kind: RqOperator span: 1:164-181 alias: d2 targets: - - 134 - 135 - parent: 186 -- id: 134 + - 136 + parent: 187 +- id: 135 kind: Literal span: 1:177-181 -- id: 135 +- id: 136 kind: Ident span: 1:149-161 ident: !Ident @@ -140,19 +140,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 136 + - 122 +- id: 137 kind: RqOperator span: 1:209-226 alias: d3 targets: - - 139 - 140 - parent: 186 -- id: 139 + - 141 + parent: 187 +- id: 140 kind: Literal span: 1:222-226 -- id: 140 +- id: 141 kind: Ident span: 1:194-206 ident: !Ident @@ -160,19 +160,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 141 + - 122 +- id: 142 kind: RqOperator span: 1:254-280 alias: d4 targets: - - 144 - 145 - parent: 186 -- id: 144 + - 146 + parent: 187 +- id: 145 kind: Literal span: 1:267-280 -- id: 145 +- id: 146 kind: Ident span: 1:239-251 ident: !Ident @@ -180,19 +180,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 146 + - 122 +- id: 147 kind: RqOperator span: 1:308-325 alias: d5 targets: - - 149 - 150 - parent: 186 -- id: 149 + - 151 + parent: 187 +- id: 150 kind: Literal span: 1:321-325 -- id: 150 +- id: 151 kind: Ident span: 1:293-305 ident: !Ident @@ -200,19 +200,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 151 + - 122 +- id: 152 kind: RqOperator span: 1:353-380 alias: d6 targets: - - 154 - 155 - parent: 186 -- id: 154 + - 156 + parent: 187 +- id: 155 kind: Literal span: 1:366-380 -- id: 155 +- id: 156 kind: Ident span: 1:338-350 ident: !Ident @@ -220,19 +220,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 156 + - 122 +- id: 157 kind: RqOperator span: 1:408-451 alias: d7 targets: - - 159 - 160 - parent: 186 -- id: 159 + - 161 + parent: 187 +- id: 160 kind: Literal span: 1:421-451 -- id: 160 +- id: 161 kind: Ident span: 1:393-405 ident: !Ident @@ -240,19 +240,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 161 + - 122 +- id: 162 kind: RqOperator span: 1:479-496 alias: d8 targets: - - 164 - 165 - parent: 186 -- id: 164 + - 166 + parent: 187 +- id: 165 kind: Literal span: 1:492-496 -- id: 165 +- id: 166 kind: Ident span: 1:464-476 ident: !Ident @@ -260,19 +260,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 166 + - 122 +- id: 167 kind: RqOperator span: 1:524-549 alias: d9 targets: - - 169 - 170 - parent: 186 -- id: 169 + - 171 + parent: 187 +- id: 170 kind: Literal span: 1:537-549 -- id: 170 +- id: 171 kind: Ident span: 1:509-521 ident: !Ident @@ -280,19 +280,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 171 + - 122 +- id: 172 kind: RqOperator span: 1:578-603 alias: d10 targets: - - 174 - 175 - parent: 186 -- id: 174 + - 176 + parent: 187 +- id: 175 kind: Literal span: 1:591-603 -- id: 175 +- id: 176 kind: Ident span: 1:563-575 ident: !Ident @@ -300,19 +300,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 176 + - 122 +- id: 177 kind: RqOperator span: 1:632-654 alias: d11 targets: - - 179 - 180 - parent: 186 -- id: 179 + - 181 + parent: 187 +- id: 180 kind: Literal span: 1:645-654 -- id: 180 +- id: 181 kind: Ident span: 1:617-629 ident: !Ident @@ -320,19 +320,19 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 181 + - 122 +- id: 182 kind: RqOperator span: 1:683-714 alias: d12 targets: - - 184 - 185 - parent: 186 -- id: 184 + - 186 + parent: 187 +- id: 185 kind: Literal span: 1:696-714 -- id: 185 +- id: 186 kind: Ident span: 1:668-680 ident: !Ident @@ -340,30 +340,30 @@ nodes: - invoices - invoice_date targets: - - 121 -- id: 186 + - 122 +- id: 187 kind: Tuple span: 1:86-718 children: - - 126 - - 131 - - 136 - - 141 - - 146 - - 151 - - 156 - - 161 - - 166 - - 171 - - 176 - - 181 - parent: 187 -- id: 187 + - 127 + - 132 + - 137 + - 142 + - 147 + - 152 + - 157 + - 162 + - 167 + - 172 + - 177 + - 182 + parent: 188 +- id: 188 kind: 'TransformCall: Select' span: 1:79-718 children: - - 124 - - 186 + - 125 + - 187 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap index 795c7558fc02..af30d247b628 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap @@ -10,16 +10,16 @@ frames: name: - tracks - album_id - target_id: 126 + target_id: 127 target_name: null - !Single name: - tracks - genre_id - target_id: 127 + target_id: 128 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -30,16 +30,16 @@ frames: name: - tracks - album_id - target_id: 131 + target_id: 132 target_name: null - !Single name: - tracks - genre_id - target_id: 132 + target_id: 133 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -50,29 +50,29 @@ frames: name: - tracks - album_id - target_id: 131 + target_id: 132 target_name: null - !Single name: - tracks - genre_id - target_id: 132 + target_id: 133 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db - tracks nodes: -- id: 124 +- id: 125 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 129 -- id: 126 + parent: 130 +- id: 127 kind: Ident span: 1:33-41 ident: !Ident @@ -80,9 +80,9 @@ nodes: - tracks - album_id targets: - - 124 - parent: 128 -- id: 127 + - 125 + parent: 129 +- id: 128 kind: Ident span: 1:43-51 ident: !Ident @@ -90,81 +90,81 @@ nodes: - tracks - genre_id targets: - - 124 - parent: 128 -- id: 128 + - 125 + parent: 129 +- id: 129 kind: Tuple span: 1:32-52 children: - - 126 - 127 - parent: 129 -- id: 129 + - 128 + parent: 130 +- id: 130 kind: 'TransformCall: Select' span: 1:25-52 children: - - 124 - - 128 - parent: 150 -- id: 131 + - 125 + - 129 + parent: 151 +- id: 132 kind: Ident ident: !Ident - this - tracks - album_id targets: - - 126 - parent: 133 -- id: 132 + - 127 + parent: 134 +- id: 133 kind: Ident ident: !Ident - this - tracks - genre_id targets: - - 127 - parent: 133 -- id: 133 + - 128 + parent: 134 +- id: 134 kind: Tuple span: 1:59-67 children: - - 131 - 132 -- id: 150 + - 133 +- id: 151 kind: 'TransformCall: Take' span: 1:69-75 children: - - 129 - - 151 - parent: 158 -- id: 151 + - 130 + - 152 + parent: 159 +- id: 152 kind: Literal - parent: 150 -- id: 155 + parent: 151 +- id: 156 kind: Ident ident: !Ident - this - tracks - album_id targets: - - 131 - parent: 158 -- id: 156 + - 132 + parent: 159 +- id: 157 kind: Ident ident: !Ident - this - tracks - genre_id targets: - - 132 - parent: 158 -- id: 158 + - 133 + parent: 159 +- id: 159 kind: 'TransformCall: Sort' span: 1:77-90 children: - - 150 - - 155 + - 151 - 156 + - 157 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap index 4d76751e4542..d7dd155f72b9 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap @@ -10,22 +10,22 @@ frames: name: - tracks - genre_id - target_id: 126 + target_id: 127 target_name: null - !Single name: - tracks - media_type_id - target_id: 127 + target_id: 128 target_name: null - !Single name: - tracks - album_id - target_id: 128 + target_id: 129 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -36,22 +36,22 @@ frames: name: - tracks - genre_id - target_id: 131 + target_id: 132 target_name: null - !Single name: - tracks - media_type_id - target_id: 132 + target_id: 133 target_name: null - !Single name: - tracks - album_id - target_id: 128 + target_id: 129 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -62,35 +62,35 @@ frames: name: - tracks - genre_id - target_id: 131 + target_id: 132 target_name: null - !Single name: - tracks - media_type_id - target_id: 132 + target_id: 133 target_name: null - !Single name: - tracks - album_id - target_id: 128 + target_id: 129 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db - tracks nodes: -- id: 124 +- id: 125 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 130 -- id: 126 + parent: 131 +- id: 127 kind: Ident span: 1:33-41 ident: !Ident @@ -98,9 +98,9 @@ nodes: - tracks - genre_id targets: - - 124 - parent: 129 -- id: 127 + - 125 + parent: 130 +- id: 128 kind: Ident span: 1:43-56 ident: !Ident @@ -108,9 +108,9 @@ nodes: - tracks - media_type_id targets: - - 124 - parent: 129 -- id: 128 + - 125 + parent: 130 +- id: 129 kind: Ident span: 1:58-66 ident: !Ident @@ -118,24 +118,24 @@ nodes: - tracks - album_id targets: - - 124 - parent: 129 -- id: 129 + - 125 + parent: 130 +- id: 130 kind: Tuple span: 1:32-67 children: - - 126 - 127 - 128 - parent: 130 -- id: 130 + - 129 + parent: 131 +- id: 131 kind: 'TransformCall: Select' span: 1:25-67 children: - - 124 - - 129 - parent: 162 -- id: 131 + - 125 + - 130 + parent: 163 +- id: 132 kind: Ident span: 1:75-83 ident: !Ident @@ -143,9 +143,9 @@ nodes: - tracks - genre_id targets: - - 126 - parent: 133 -- id: 132 + - 127 + parent: 134 +- id: 133 kind: Ident span: 1:85-98 ident: !Ident @@ -153,15 +153,15 @@ nodes: - tracks - media_type_id targets: - - 127 - parent: 133 -- id: 133 + - 128 + parent: 134 +- id: 134 kind: Tuple span: 1:74-99 children: - - 131 - 132 -- id: 158 + - 133 +- id: 159 kind: Ident span: 1:108-116 ident: !Ident @@ -169,18 +169,18 @@ nodes: - tracks - album_id targets: - - 128 -- id: 162 + - 129 +- id: 163 kind: 'TransformCall: Take' span: 1:120-126 children: - - 130 - - 163 - parent: 171 -- id: 163 + - 131 + - 164 + parent: 172 +- id: 164 kind: Literal - parent: 162 -- id: 168 + parent: 163 +- id: 169 kind: Ident span: 1:135-143 ident: !Ident @@ -188,9 +188,9 @@ nodes: - tracks - genre_id targets: - - 131 - parent: 171 -- id: 169 + - 132 + parent: 172 +- id: 170 kind: Ident span: 1:145-158 ident: !Ident @@ -198,15 +198,15 @@ nodes: - tracks - media_type_id targets: - - 132 - parent: 171 -- id: 171 + - 133 + parent: 172 +- id: 172 kind: 'TransformCall: Sort' span: 1:128-159 children: - - 162 - - 168 + - 163 - 169 + - 170 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap index 573296b35ce0..4c32fec2452e 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap @@ -10,10 +10,10 @@ frames: name: - genre_count - a - target_id: 136 + target_id: 137 target_name: a inputs: - - id: 136 + - id: 137 name: genre_count table: - default_db @@ -23,29 +23,29 @@ frames: - !Single name: - a - target_id: 143 + target_id: 144 target_name: null inputs: - - id: 136 + - id: 137 name: genre_count table: - default_db - genres nodes: -- id: 136 +- id: 137 kind: Ident span: 1:187-203 ident: !Ident - genre_count - parent: 142 -- id: 138 + parent: 143 +- id: 139 kind: RqOperator span: 1:211-216 targets: - - 140 - 141 - parent: 142 -- id: 140 + - 142 + parent: 143 +- id: 141 kind: Ident span: 1:211-212 ident: !Ident @@ -53,25 +53,25 @@ nodes: - genre_count - a targets: - - 136 -- id: 141 + - 137 +- id: 142 kind: Literal span: 1:215-216 -- id: 142 +- id: 143 kind: 'TransformCall: Filter' span: 1:204-216 children: - - 136 - - 138 - parent: 147 -- id: 143 + - 137 + - 139 + parent: 148 +- id: 144 kind: RqOperator span: 1:228-230 alias: a targets: - - 145 - parent: 146 -- id: 145 + - 146 + parent: 147 +- id: 146 kind: Ident span: 1:229-230 ident: !Ident @@ -79,19 +79,19 @@ nodes: - genre_count - a targets: - - 136 -- id: 146 + - 137 +- id: 147 kind: Tuple span: 1:228-230 children: - - 143 - parent: 147 -- id: 147 + - 144 + parent: 148 +- id: 148 kind: 'TransformCall: Select' span: 1:217-230 children: - - 142 - - 146 + - 143 + - 147 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap index 3f2cf5e44e75..f900324a8881 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap @@ -7,10 +7,10 @@ frames: - - 1:27-34 - columns: - !All - input_id: 128 + input_id: 129 except: [] inputs: - - id: 128 + - id: 129 name: a table: - default_db @@ -18,18 +18,18 @@ frames: - - 1:35-59 - columns: - !All - input_id: 128 + input_id: 129 except: [] - !All - input_id: 122 + input_id: 123 except: [] inputs: - - id: 128 + - id: 129 name: a table: - default_db - albums - - id: 122 + - id: 123 name: tracks table: - default_db @@ -40,26 +40,26 @@ frames: name: - a - album_id - target_id: 138 + target_id: 139 target_name: null - !Single name: - a - title - target_id: 139 + target_id: 140 target_name: null - !Single name: - price - target_id: 157 + target_id: 158 target_name: null inputs: - - id: 128 + - id: 129 name: a table: - default_db - albums - - id: 122 + - id: 123 name: tracks table: - default_db @@ -70,63 +70,63 @@ frames: name: - a - album_id - target_id: 138 + target_id: 139 target_name: null - !Single name: - a - title - target_id: 139 + target_id: 140 target_name: null - !Single name: - price - target_id: 157 + target_id: 158 target_name: null inputs: - - id: 128 + - id: 129 name: a table: - default_db - albums - - id: 122 + - id: 123 name: tracks table: - default_db - tracks nodes: -- id: 122 +- id: 123 kind: Ident span: 1:40-46 ident: !Ident - default_db - tracks - parent: 137 -- id: 128 + parent: 138 +- id: 129 kind: Ident span: 1:13-26 ident: !Ident - default_db - albums - parent: 131 -- id: 131 + parent: 132 +- id: 132 kind: 'TransformCall: Take' span: 1:27-34 children: - - 128 - - 132 - parent: 137 -- id: 132 - kind: Literal - parent: 131 + - 129 + - 133 + parent: 138 - id: 133 + kind: Literal + parent: 132 +- id: 134 kind: RqOperator span: 1:48-58 targets: - - 135 - 136 - parent: 137 -- id: 135 + - 137 + parent: 138 +- id: 136 kind: Ident span: 1:50-58 ident: !Ident @@ -134,8 +134,8 @@ nodes: - a - album_id targets: - - 128 -- id: 136 + - 129 +- id: 137 kind: Ident span: 1:50-58 ident: !Ident @@ -143,16 +143,16 @@ nodes: - tracks - album_id targets: - - 122 -- id: 137 + - 123 +- id: 138 kind: 'TransformCall: Join' span: 1:35-59 children: - - 131 - - 122 - - 133 - parent: 165 -- id: 138 + - 132 + - 123 + - 134 + parent: 166 +- id: 139 kind: Ident span: 1:67-77 ident: !Ident @@ -160,9 +160,9 @@ nodes: - a - album_id targets: - - 128 - parent: 140 -- id: 139 + - 129 + parent: 141 +- id: 140 kind: Ident span: 1:79-86 ident: !Ident @@ -170,32 +170,32 @@ nodes: - a - title targets: - - 128 - parent: 140 -- id: 140 + - 129 + parent: 141 +- id: 141 kind: Tuple span: 1:66-87 children: - - 138 - 139 - parent: 165 -- id: 157 + - 140 + parent: 166 +- id: 158 kind: RqOperator span: 1:132-144 alias: price targets: - - 160 - 161 - parent: 164 -- id: 160 + - 162 + parent: 165 +- id: 161 kind: Literal span: 1:143-144 -- id: 161 +- id: 162 kind: RqOperator span: 1:108-129 targets: - - 163 -- id: 163 + - 164 +- id: 164 kind: Ident span: 1:112-129 ident: !Ident @@ -203,22 +203,22 @@ nodes: - tracks - unit_price targets: - - 122 -- id: 164 + - 123 +- id: 165 kind: Tuple span: 1:132-144 children: - - 157 - parent: 165 -- id: 165 + - 158 + parent: 166 +- id: 166 kind: 'TransformCall: Aggregate' span: 1:89-145 children: - - 137 - - 164 - - 140 - parent: 170 -- id: 168 + - 138 + - 165 + - 141 + parent: 171 +- id: 169 kind: Ident span: 1:152-160 ident: !Ident @@ -226,14 +226,14 @@ nodes: - a - album_id targets: - - 138 - parent: 170 -- id: 170 + - 139 + parent: 171 +- id: 171 kind: 'TransformCall: Sort' span: 1:147-160 children: - - 165 - - 168 + - 166 + - 169 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap index 36318b3b7d14..62ef7e3d04f9 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap @@ -7,15 +7,15 @@ frames: - - 1:25-48 - columns: - !All - input_id: 130 + input_id: 131 except: [] - !Single name: - d - target_id: 132 + target_id: 133 target_name: null inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -25,15 +25,15 @@ frames: - !Single name: - d - target_id: 138 + target_id: 139 target_name: null - !Single name: - n1 - target_id: 155 + target_id: 156 target_name: null inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -43,15 +43,15 @@ frames: - !Single name: - d - target_id: 138 + target_id: 139 target_name: null - !Single name: - n1 - target_id: 155 + target_id: 156 target_name: null inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -61,15 +61,15 @@ frames: - !Single name: - d - target_id: 138 + target_id: 139 target_name: null - !Single name: - n1 - target_id: 155 + target_id: 156 target_name: null inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -79,36 +79,36 @@ frames: - !Single name: - d1 - target_id: 168 + target_id: 169 target_name: null - !Single name: - n1 - target_id: 169 + target_id: 170 target_name: null inputs: - - id: 130 + - id: 131 name: tracks table: - default_db - tracks nodes: -- id: 130 +- id: 131 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 137 -- id: 132 + parent: 138 +- id: 133 kind: RqOperator span: 1:36-48 alias: d targets: - - 134 - 135 - parent: 136 -- id: 134 + - 136 + parent: 137 +- id: 135 kind: Ident span: 1:36-44 ident: !Ident @@ -116,46 +116,46 @@ nodes: - tracks - album_id targets: - - 130 -- id: 135 + - 131 +- id: 136 kind: Literal span: 1:47-48 -- id: 136 +- id: 137 kind: Tuple span: 1:36-48 children: - - 132 - parent: 137 -- id: 137 + - 133 + parent: 138 +- id: 138 kind: 'TransformCall: Derive' span: 1:25-48 children: - - 130 - - 136 - parent: 159 -- id: 138 + - 131 + - 137 + parent: 160 +- id: 139 kind: Ident span: 1:55-56 ident: !Ident - this - d targets: - - 132 - parent: 141 -- id: 141 + - 133 + parent: 142 +- id: 142 kind: Tuple span: 1:55-56 children: - - 138 - parent: 159 -- id: 155 + - 139 + parent: 160 +- id: 156 kind: RqOperator span: 1:100-103 alias: n1 targets: - - 157 - parent: 158 -- id: 157 + - 158 + parent: 159 +- id: 158 kind: Ident span: 1:89-97 ident: !Ident @@ -163,48 +163,48 @@ nodes: - tracks - track_id targets: - - 130 -- id: 158 + - 131 +- id: 159 kind: Tuple span: 1:73-111 children: - - 155 - parent: 159 -- id: 159 + - 156 + parent: 160 +- id: 160 kind: 'TransformCall: Aggregate' span: 1:63-111 children: - - 137 - - 158 - - 141 - parent: 164 -- id: 162 + - 138 + - 159 + - 142 + parent: 165 +- id: 163 kind: Ident span: 1:119-120 ident: !Ident - this - d targets: - - 138 - parent: 164 -- id: 164 + - 139 + parent: 165 +- id: 165 kind: 'TransformCall: Sort' span: 1:114-120 children: - - 159 - - 162 - parent: 166 -- id: 166 + - 160 + - 163 + parent: 167 +- id: 167 kind: 'TransformCall: Take' span: 1:121-128 children: - - 164 - - 167 - parent: 171 -- id: 167 - kind: Literal - parent: 166 + - 165 + - 168 + parent: 172 - id: 168 + kind: Literal + parent: 167 +- id: 169 kind: Ident span: 1:143-144 alias: d1 @@ -212,30 +212,30 @@ nodes: - this - d targets: - - 138 - parent: 170 -- id: 169 + - 139 + parent: 171 +- id: 170 kind: Ident span: 1:146-148 ident: !Ident - this - n1 targets: - - 155 - parent: 170 -- id: 170 + - 156 + parent: 171 +- id: 171 kind: Tuple span: 1:136-150 children: - - 168 - 169 - parent: 171 -- id: 171 + - 170 + parent: 172 +- id: 172 kind: 'TransformCall: Select' span: 1:129-150 children: - - 166 - - 170 + - 167 + - 171 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap index 3481618172d5..bd7c565333d9 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap @@ -8,186 +8,186 @@ frames: - columns: - !Single name: - - _literal_129 + - _literal_130 - artist_id - target_id: 130 + target_id: 131 target_name: null - !Single name: - album_title_count - target_id: 149 + target_id: 150 target_name: null inputs: - - id: 129 - name: _literal_129 + - id: 130 + name: _literal_130 table: - default_db - - _literal_129 + - _literal_130 - - 1:119-164 - columns: - !Single name: - - _literal_129 + - _literal_130 - artist_id - target_id: 130 + target_id: 131 target_name: null - !Single name: - album_title_count - target_id: 149 + target_id: 150 target_name: null inputs: - - id: 129 - name: _literal_129 + - id: 130 + name: _literal_130 table: - default_db - - _literal_129 + - _literal_130 - - 1:165-214 - columns: - !Single name: - - _literal_129 + - _literal_130 - artist_id - target_id: 130 + target_id: 131 target_name: null - !Single name: - album_title_count - target_id: 149 + target_id: 150 target_name: null - !Single name: - new_album_count - target_id: 159 + target_id: 160 target_name: null inputs: - - id: 129 - name: _literal_129 + - id: 130 + name: _literal_130 table: - default_db - - _literal_129 + - _literal_130 - - 1:215-260 - columns: - !Single name: - - _literal_129 + - _literal_130 - artist_id - target_id: 162 + target_id: 163 target_name: null - !Single name: - new_album_count - target_id: 163 + target_id: 164 target_name: null inputs: - - id: 129 - name: _literal_129 + - id: 130 + name: _literal_130 table: - default_db - - _literal_129 + - _literal_130 - - 1:261-367 - columns: - !Single name: - - _literal_129 + - _literal_130 - artist_id - target_id: 162 + target_id: 163 target_name: null - !Single name: - new_album_count - target_id: 163 + target_id: 164 target_name: null - !All - input_id: 116 + input_id: 117 except: [] inputs: - - id: 129 - name: _literal_129 + - id: 130 + name: _literal_130 table: - default_db - - _literal_129 - - id: 116 - name: _literal_116 + - _literal_130 + - id: 117 + name: _literal_117 table: - default_db - - _literal_116 + - _literal_117 nodes: -- id: 116 +- id: 117 kind: SString span: 1:278-330 - parent: 170 -- id: 129 + parent: 171 +- id: 130 kind: SString span: 1:0-46 - parent: 152 -- id: 130 + parent: 153 +- id: 131 kind: Ident span: 1:54-63 ident: !Ident - this - - _literal_129 + - _literal_130 - artist_id targets: - - 129 - parent: 131 -- id: 131 + - 130 + parent: 132 +- id: 132 kind: Tuple span: 1:53-64 children: - - 130 - parent: 152 -- id: 149 + - 131 + parent: 153 +- id: 150 kind: RqOperator span: 1:98-116 alias: album_title_count targets: - - 150 - parent: 151 -- id: 150 - kind: Literal + - 151 + parent: 152 - id: 151 + kind: Literal +- id: 152 kind: Tuple span: 1:76-117 children: - - 149 - parent: 152 -- id: 152 + - 150 + parent: 153 +- id: 153 kind: 'TransformCall: Aggregate' span: 1:66-117 children: - - 129 - - 151 - - 131 - parent: 158 -- id: 155 + - 130 + - 152 + - 132 + parent: 159 +- id: 156 kind: Ident span: 1:125-139 ident: !Ident - this - - _literal_129 + - _literal_130 - artist_id targets: - - 130 - parent: 158 -- id: 156 + - 131 + parent: 159 +- id: 157 kind: Ident span: 1:141-163 ident: !Ident - this - album_title_count targets: - - 149 - parent: 158 -- id: 158 + - 150 + parent: 159 +- id: 159 kind: 'TransformCall: Sort' span: 1:119-164 children: - - 152 - - 155 + - 153 - 156 - parent: 161 -- id: 159 + - 157 + parent: 162 +- id: 160 kind: Ident span: 1:191-213 alias: new_album_count @@ -195,86 +195,86 @@ nodes: - this - album_title_count targets: - - 149 - parent: 160 -- id: 160 + - 150 + parent: 161 +- id: 161 kind: Tuple span: 1:172-214 children: - - 159 - parent: 161 -- id: 161 + - 160 + parent: 162 +- id: 162 kind: 'TransformCall: Derive' span: 1:165-214 children: - - 158 - - 160 - parent: 165 -- id: 162 + - 159 + - 161 + parent: 166 +- id: 163 kind: Ident span: 1:223-237 ident: !Ident - this - - _literal_129 + - _literal_130 - artist_id targets: - - 130 - parent: 164 -- id: 163 + - 131 + parent: 165 +- id: 164 kind: Ident span: 1:239-259 ident: !Ident - this - new_album_count targets: - - 159 - parent: 164 -- id: 164 + - 160 + parent: 165 +- id: 165 kind: Tuple span: 1:222-260 children: - - 162 - 163 - parent: 165 -- id: 165 + - 164 + parent: 166 +- id: 166 kind: 'TransformCall: Select' span: 1:215-260 children: - - 161 - - 164 - parent: 170 -- id: 166 + - 162 + - 165 + parent: 171 +- id: 167 kind: RqOperator span: 1:334-366 targets: - - 168 - 169 - parent: 170 -- id: 168 + - 170 + parent: 171 +- id: 169 kind: Ident span: 1:334-348 ident: !Ident - this - - _literal_129 + - _literal_130 - artist_id targets: - - 162 -- id: 169 + - 163 +- id: 170 kind: Ident span: 1:352-366 ident: !Ident - that - - _literal_116 + - _literal_117 - artist_id targets: - - 116 -- id: 170 + - 117 +- id: 171 kind: 'TransformCall: Join' span: 1:261-367 children: - - 165 - - 116 - 166 + - 117 + - 167 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap index 355d52efdba6..eaa5217f9029 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap @@ -8,230 +8,230 @@ frames: - columns: - !Single name: - - _literal_132 + - _literal_133 - artist_id - target_id: 133 + target_id: 134 target_name: null - !Single name: - album_title_count - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 132 - name: _literal_132 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:119-164 - columns: - !Single name: - - _literal_132 + - _literal_133 - artist_id - target_id: 133 + target_id: 134 target_name: null - !Single name: - album_title_count - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 132 - name: _literal_132 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:165-201 - columns: - !Single name: - - _literal_132 + - _literal_133 - artist_id - target_id: 133 + target_id: 134 target_name: null - !Single name: - album_title_count - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 132 - name: _literal_132 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:202-251 - columns: - !Single name: - - _literal_132 + - _literal_133 - artist_id - target_id: 133 + target_id: 134 target_name: null - !Single name: - album_title_count - target_id: 152 + target_id: 153 target_name: null - !Single name: - new_album_count - target_id: 167 + target_id: 168 target_name: null inputs: - - id: 132 - name: _literal_132 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:252-297 - columns: - !Single name: - - _literal_132 + - _literal_133 - artist_id - target_id: 170 + target_id: 171 target_name: null - !Single name: - new_album_count - target_id: 171 + target_id: 172 target_name: null inputs: - - id: 132 - name: _literal_132 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:298-404 - columns: - !Single name: - - _literal_132 + - _literal_133 - artist_id - target_id: 170 + target_id: 171 target_name: null - !Single name: - new_album_count - target_id: 171 + target_id: 172 target_name: null - !All - input_id: 116 + input_id: 117 except: [] inputs: - - id: 132 - name: _literal_132 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 - - id: 116 - name: _literal_116 + - _literal_133 + - id: 117 + name: _literal_117 table: - default_db - - _literal_116 + - _literal_117 nodes: -- id: 116 +- id: 117 kind: SString span: 1:315-367 - parent: 178 -- id: 132 + parent: 179 +- id: 133 kind: SString span: 1:0-46 - parent: 155 -- id: 133 + parent: 156 +- id: 134 kind: Ident span: 1:54-63 ident: !Ident - this - - _literal_132 + - _literal_133 - artist_id targets: - - 132 - parent: 134 -- id: 134 + - 133 + parent: 135 +- id: 135 kind: Tuple span: 1:53-64 children: - - 133 - parent: 155 -- id: 152 + - 134 + parent: 156 +- id: 153 kind: RqOperator span: 1:98-116 alias: album_title_count targets: - - 153 - parent: 154 -- id: 153 - kind: Literal + - 154 + parent: 155 - id: 154 + kind: Literal +- id: 155 kind: Tuple span: 1:76-117 children: - - 152 - parent: 155 -- id: 155 + - 153 + parent: 156 +- id: 156 kind: 'TransformCall: Aggregate' span: 1:66-117 children: - - 132 - - 154 - - 134 - parent: 161 -- id: 158 + - 133 + - 155 + - 135 + parent: 162 +- id: 159 kind: Ident span: 1:125-139 ident: !Ident - this - - _literal_132 + - _literal_133 - artist_id targets: - - 133 - parent: 161 -- id: 159 + - 134 + parent: 162 +- id: 160 kind: Ident span: 1:141-163 ident: !Ident - this - album_title_count targets: - - 152 - parent: 161 -- id: 161 + - 153 + parent: 162 +- id: 162 kind: 'TransformCall: Sort' span: 1:119-164 children: - - 155 - - 158 + - 156 - 159 - parent: 166 -- id: 162 + - 160 + parent: 167 +- id: 163 kind: RqOperator span: 1:172-201 targets: - - 164 - 165 - parent: 166 -- id: 164 + - 166 + parent: 167 +- id: 165 kind: Ident span: 1:173-195 ident: !Ident - this - album_title_count targets: - - 152 -- id: 165 + - 153 +- id: 166 kind: Literal span: 1:199-201 -- id: 166 +- id: 167 kind: 'TransformCall: Filter' span: 1:165-201 children: - - 161 - 162 - parent: 169 -- id: 167 + - 163 + parent: 170 +- id: 168 kind: Ident span: 1:228-250 alias: new_album_count @@ -239,86 +239,86 @@ nodes: - this - album_title_count targets: - - 152 - parent: 168 -- id: 168 + - 153 + parent: 169 +- id: 169 kind: Tuple span: 1:209-251 children: - - 167 - parent: 169 -- id: 169 + - 168 + parent: 170 +- id: 170 kind: 'TransformCall: Derive' span: 1:202-251 children: - - 166 - - 168 - parent: 173 -- id: 170 + - 167 + - 169 + parent: 174 +- id: 171 kind: Ident span: 1:260-274 ident: !Ident - this - - _literal_132 + - _literal_133 - artist_id targets: - - 133 - parent: 172 -- id: 171 + - 134 + parent: 173 +- id: 172 kind: Ident span: 1:276-296 ident: !Ident - this - new_album_count targets: - - 167 - parent: 172 -- id: 172 + - 168 + parent: 173 +- id: 173 kind: Tuple span: 1:259-297 children: - - 170 - 171 - parent: 173 -- id: 173 + - 172 + parent: 174 +- id: 174 kind: 'TransformCall: Select' span: 1:252-297 children: - - 169 - - 172 - parent: 178 -- id: 174 + - 170 + - 173 + parent: 179 +- id: 175 kind: RqOperator span: 1:371-403 targets: - - 176 - 177 - parent: 178 -- id: 176 + - 178 + parent: 179 +- id: 177 kind: Ident span: 1:371-385 ident: !Ident - this - - _literal_132 + - _literal_133 - artist_id targets: - - 170 -- id: 177 + - 171 +- id: 178 kind: Ident span: 1:389-403 ident: !Ident - that - - _literal_116 + - _literal_117 - artist_id targets: - - 116 -- id: 178 + - 117 +- id: 179 kind: 'TransformCall: Join' span: 1:298-404 children: - - 173 - - 116 - 174 + - 117 + - 175 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap index 5214f60b559d..84e440d71f91 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap @@ -10,16 +10,16 @@ frames: name: - tracks - genre_id - target_id: 133 + target_id: 134 target_name: null - !Single name: - tracks - milliseconds - target_id: 134 + target_id: 135 target_name: null inputs: - - id: 131 + - id: 132 name: tracks table: - default_db @@ -30,16 +30,16 @@ frames: name: - tracks - genre_id - target_id: 137 + target_id: 138 target_name: null - !Single name: - tracks - milliseconds - target_id: 134 + target_id: 135 target_name: null inputs: - - id: 131 + - id: 132 name: tracks table: - default_db @@ -50,24 +50,24 @@ frames: name: - tracks - genre_id - target_id: 137 + target_id: 138 target_name: null - !Single name: - tracks - milliseconds - target_id: 134 + target_id: 135 target_name: null - !All - input_id: 122 + input_id: 123 except: [] inputs: - - id: 131 + - id: 132 name: tracks table: - default_db - tracks - - id: 122 + - id: 123 name: genres table: - default_db @@ -78,21 +78,21 @@ frames: name: - genres - name - target_id: 175 + target_id: 176 target_name: null - !Single name: - tracks - milliseconds - target_id: 176 + target_id: 177 target_name: null inputs: - - id: 131 + - id: 132 name: tracks table: - default_db - tracks - - id: 122 + - id: 123 name: genres table: - default_db @@ -103,41 +103,41 @@ frames: name: - genres - name - target_id: 175 + target_id: 176 target_name: null - !Single name: - tracks - milliseconds - target_id: 176 + target_id: 177 target_name: null inputs: - - id: 131 + - id: 132 name: tracks table: - default_db - tracks - - id: 122 + - id: 123 name: genres table: - default_db - genres nodes: -- id: 122 +- id: 123 kind: Ident span: 1:177-183 ident: !Ident - default_db - genres - parent: 174 -- id: 131 + parent: 175 +- id: 132 kind: Ident span: 1:76-87 ident: !Ident - default_db - tracks - parent: 136 -- id: 133 + parent: 137 +- id: 134 kind: Ident span: 1:96-104 ident: !Ident @@ -145,9 +145,9 @@ nodes: - tracks - genre_id targets: - - 131 - parent: 135 -- id: 134 + - 132 + parent: 136 +- id: 135 kind: Ident span: 1:105-117 ident: !Ident @@ -155,23 +155,23 @@ nodes: - tracks - milliseconds targets: - - 131 - parent: 135 -- id: 135 + - 132 + parent: 136 +- id: 136 kind: Tuple span: 1:95-118 children: - - 133 - 134 - parent: 136 -- id: 136 + - 135 + parent: 137 +- id: 137 kind: 'TransformCall: Select' span: 1:88-118 children: - - 131 - - 135 - parent: 166 -- id: 137 + - 132 + - 136 + parent: 167 +- id: 138 kind: Ident span: 1:126-134 ident: !Ident @@ -179,14 +179,14 @@ nodes: - tracks - genre_id targets: - - 133 - parent: 138 -- id: 138 + - 134 + parent: 139 +- id: 139 kind: Tuple span: 1:125-135 children: - - 137 -- id: 162 + - 138 +- id: 163 kind: Ident span: 1:147-159 ident: !Ident @@ -194,25 +194,25 @@ nodes: - tracks - milliseconds targets: - - 134 -- id: 166 + - 135 +- id: 167 kind: 'TransformCall: Take' span: 1:163-169 children: - - 136 - - 167 - parent: 174 -- id: 167 + - 137 + - 168 + parent: 175 +- id: 168 kind: Literal - parent: 166 -- id: 170 + parent: 167 +- id: 171 kind: RqOperator span: 1:185-195 targets: - - 172 - 173 - parent: 174 -- id: 172 + - 174 + parent: 175 +- id: 173 kind: Ident span: 1:187-195 ident: !Ident @@ -220,8 +220,8 @@ nodes: - tracks - genre_id targets: - - 137 -- id: 173 + - 138 +- id: 174 kind: Ident span: 1:187-195 ident: !Ident @@ -229,16 +229,16 @@ nodes: - genres - genre_id targets: - - 122 -- id: 174 + - 123 +- id: 175 kind: 'TransformCall: Join' span: 1:172-196 children: - - 166 - - 122 - - 170 - parent: 178 -- id: 175 + - 167 + - 123 + - 171 + parent: 179 +- id: 176 kind: Ident span: 1:205-209 ident: !Ident @@ -246,9 +246,9 @@ nodes: - genres - name targets: - - 122 - parent: 177 -- id: 176 + - 123 + parent: 178 +- id: 177 kind: Ident span: 1:211-223 ident: !Ident @@ -256,23 +256,23 @@ nodes: - tracks - milliseconds targets: - - 134 - parent: 177 -- id: 177 + - 135 + parent: 178 +- id: 178 kind: Tuple span: 1:204-224 children: - - 175 - 176 - parent: 178 -- id: 178 + - 177 + parent: 179 +- id: 179 kind: 'TransformCall: Select' span: 1:197-224 children: - - 174 - - 177 - parent: 184 -- id: 179 + - 175 + - 178 + parent: 185 +- id: 180 kind: Ident span: 1:231-236 ident: !Ident @@ -280,9 +280,9 @@ nodes: - genres - name targets: - - 175 - parent: 184 -- id: 182 + - 176 + parent: 185 +- id: 183 kind: Ident span: 1:238-250 ident: !Ident @@ -290,15 +290,15 @@ nodes: - tracks - milliseconds targets: - - 176 - parent: 184 -- id: 184 + - 177 + parent: 185 +- id: 185 kind: 'TransformCall: Sort' span: 1:225-251 children: - - 178 - 179 - - 182 + - 180 + - 183 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap index ee23a13653bf..6284a10a0141 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap @@ -7,18 +7,18 @@ frames: - - 1:147-183 - columns: - !All - input_id: 140 + input_id: 141 except: [] - !All - input_id: 137 + input_id: 138 except: [] inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -26,28 +26,28 @@ frames: - - 1:184-253 - columns: - !All - input_id: 140 + input_id: 141 except: [] - !All - input_id: 137 + input_id: 138 except: [] - !Single name: - city - target_id: 147 + target_id: 148 target_name: null - !Single name: - street - target_id: 148 + target_id: 149 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -55,23 +55,23 @@ frames: - - 1:281-323 - columns: - !All - input_id: 140 + input_id: 141 except: [] - !All - input_id: 137 + input_id: 138 except: [] - !Single name: - total - target_id: 178 + target_id: 179 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -81,35 +81,35 @@ frames: - !Single name: - city - target_id: 151 + target_id: 152 target_name: null - !Single name: - street - target_id: 152 + target_id: 153 target_name: null - !Single name: - num_orders - target_id: 184 + target_id: 185 target_name: null - !Single name: - num_tracks - target_id: 187 + target_id: 188 target_name: null - !Single name: - total_price - target_id: 190 + target_id: 191 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -119,40 +119,40 @@ frames: - !Single name: - city - target_id: 197 + target_id: 198 target_name: null - !Single name: - street - target_id: 152 + target_id: 153 target_name: null - !Single name: - num_orders - target_id: 184 + target_id: 185 target_name: null - !Single name: - num_tracks - target_id: 187 + target_id: 188 target_name: null - !Single name: - total_price - target_id: 190 + target_id: 191 target_name: null - !Single name: - running_total_num_tracks - target_id: 243 + target_id: 244 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -162,40 +162,40 @@ frames: - !Single name: - city - target_id: 197 + target_id: 198 target_name: null - !Single name: - street - target_id: 152 + target_id: 153 target_name: null - !Single name: - num_orders - target_id: 184 + target_id: 185 target_name: null - !Single name: - num_tracks - target_id: 187 + target_id: 188 target_name: null - !Single name: - total_price - target_id: 190 + target_id: 191 target_name: null - !Single name: - running_total_num_tracks - target_id: 243 + target_id: 244 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -205,45 +205,45 @@ frames: - !Single name: - city - target_id: 197 + target_id: 198 target_name: null - !Single name: - street - target_id: 152 + target_id: 153 target_name: null - !Single name: - num_orders - target_id: 184 + target_id: 185 target_name: null - !Single name: - num_tracks - target_id: 187 + target_id: 188 target_name: null - !Single name: - total_price - target_id: 190 + target_id: 191 target_name: null - !Single name: - running_total_num_tracks - target_id: 243 + target_id: 244 target_name: null - !Single name: - num_tracks_last_week - target_id: 257 + target_id: 258 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -253,40 +253,40 @@ frames: - !Single name: - city - target_id: 263 + target_id: 264 target_name: null - !Single name: - street - target_id: 264 + target_id: 265 target_name: null - !Single name: - num_orders - target_id: 265 + target_id: 266 target_name: null - !Single name: - num_tracks - target_id: 266 + target_id: 267 target_name: null - !Single name: - running_total_num_tracks - target_id: 267 + target_id: 268 target_name: null - !Single name: - num_tracks_last_week - target_id: 268 + target_id: 269 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db @@ -296,67 +296,67 @@ frames: - !Single name: - city - target_id: 263 + target_id: 264 target_name: null - !Single name: - street - target_id: 264 + target_id: 265 target_name: null - !Single name: - num_orders - target_id: 265 + target_id: 266 target_name: null - !Single name: - num_tracks - target_id: 266 + target_id: 267 target_name: null - !Single name: - running_total_num_tracks - target_id: 267 + target_id: 268 target_name: null - !Single name: - num_tracks_last_week - target_id: 268 + target_id: 269 target_name: null inputs: - - id: 140 + - id: 141 name: i table: - default_db - invoices - - id: 137 + - id: 138 name: ii table: - default_db - invoice_items nodes: -- id: 137 +- id: 138 kind: Ident span: 1:155-168 ident: !Ident - default_db - invoice_items - parent: 146 -- id: 140 + parent: 147 +- id: 141 kind: Ident span: 1:131-146 ident: !Ident - default_db - invoices - parent: 146 -- id: 142 + parent: 147 +- id: 143 kind: RqOperator span: 1:170-182 targets: - - 144 - 145 - parent: 146 -- id: 144 + - 146 + parent: 147 +- id: 145 kind: Ident span: 1:172-182 ident: !Ident @@ -364,8 +364,8 @@ nodes: - i - invoice_id targets: - - 140 -- id: 145 + - 141 +- id: 146 kind: Ident span: 1:172-182 ident: !Ident @@ -373,16 +373,16 @@ nodes: - ii - invoice_id targets: - - 137 -- id: 146 + - 138 +- id: 147 kind: 'TransformCall: Join' span: 1:147-183 children: - - 140 - - 137 - - 142 - parent: 150 -- id: 147 + - 141 + - 138 + - 143 + parent: 151 +- id: 148 kind: Ident span: 1:204-218 alias: city @@ -391,9 +391,9 @@ nodes: - i - billing_city targets: - - 140 - parent: 149 -- id: 148 + - 141 + parent: 150 +- id: 149 kind: Ident span: 1:233-250 alias: street @@ -402,56 +402,56 @@ nodes: - i - billing_address targets: - - 140 - parent: 149 -- id: 149 + - 141 + parent: 150 +- id: 150 kind: Tuple span: 1:191-253 children: - - 147 - 148 - parent: 150 -- id: 150 + - 149 + parent: 151 +- id: 151 kind: 'TransformCall: Derive' span: 1:184-253 children: - - 146 - - 149 - parent: 183 -- id: 151 + - 147 + - 150 + parent: 184 +- id: 152 kind: Ident span: 1:261-265 ident: !Ident - this - city targets: - - 147 - parent: 153 -- id: 152 + - 148 + parent: 154 +- id: 153 kind: Ident span: 1:267-273 ident: !Ident - this - street targets: - - 148 - parent: 153 -- id: 153 + - 149 + parent: 154 +- id: 154 kind: Tuple span: 1:260-274 children: - - 151 - 152 - parent: 194 -- id: 178 + - 153 + parent: 195 +- id: 179 kind: RqOperator span: 1:296-323 alias: total targets: - - 180 - 181 - parent: 182 -- id: 180 + - 182 + parent: 183 +- id: 181 kind: Ident span: 1:296-309 ident: !Ident @@ -459,8 +459,8 @@ nodes: - ii - unit_price targets: - - 137 -- id: 181 + - 138 +- id: 182 kind: Ident span: 1:312-323 ident: !Ident @@ -468,28 +468,28 @@ nodes: - ii - quantity targets: - - 137 -- id: 182 + - 138 +- id: 183 kind: Tuple span: 1:296-323 children: - - 178 - parent: 183 -- id: 183 + - 179 + parent: 184 +- id: 184 kind: 'TransformCall: Derive' span: 1:281-323 children: - - 150 - - 182 - parent: 194 -- id: 184 + - 151 + - 183 + parent: 195 +- id: 185 kind: RqOperator span: 1:361-388 alias: num_orders targets: - - 186 - parent: 193 -- id: 186 + - 187 + parent: 194 +- id: 187 kind: Ident span: 1:376-388 ident: !Ident @@ -497,15 +497,15 @@ nodes: - i - invoice_id targets: - - 140 -- id: 187 + - 141 +- id: 188 kind: RqOperator span: 1:411-426 alias: num_tracks targets: - - 189 - parent: 193 -- id: 189 + - 190 + parent: 194 +- id: 190 kind: Ident span: 1:415-426 ident: !Ident @@ -513,229 +513,229 @@ nodes: - ii - quantity targets: - - 137 -- id: 190 + - 138 +- id: 191 kind: RqOperator span: 1:450-459 alias: total_price targets: - - 192 - parent: 193 -- id: 192 + - 193 + parent: 194 +- id: 193 kind: Ident span: 1:454-459 ident: !Ident - this - total targets: - - 178 -- id: 193 + - 179 +- id: 194 kind: Tuple span: 1:338-466 children: - - 184 - - 187 - - 190 - parent: 194 -- id: 194 + - 185 + - 188 + - 191 + parent: 195 +- id: 195 kind: 'TransformCall: Aggregate' span: 1:328-466 children: - - 183 - - 193 - - 153 - parent: 247 -- id: 197 + - 184 + - 194 + - 154 + parent: 248 +- id: 198 kind: Ident span: 1:476-480 ident: !Ident - this - city targets: - - 151 - parent: 198 -- id: 198 + - 152 + parent: 199 +- id: 199 kind: Tuple span: 1:475-481 children: - - 197 -- id: 222 + - 198 +- id: 223 kind: Ident span: 1:493-499 ident: !Ident - this - street targets: - - 152 -- id: 243 + - 153 +- id: 244 kind: RqOperator span: 1:571-585 alias: running_total_num_tracks targets: - - 245 - parent: 246 -- id: 245 + - 246 + parent: 247 +- id: 246 kind: Ident span: 1:575-585 ident: !Ident - this - num_tracks targets: - - 187 -- id: 246 + - 188 +- id: 247 kind: Tuple span: 1:543-586 children: - - 243 - parent: 247 -- id: 247 + - 244 + parent: 248 +- id: 248 kind: 'TransformCall: Derive' span: 1:536-586 children: - - 194 - - 246 - parent: 256 -- id: 249 + - 195 + - 247 + parent: 257 +- id: 250 kind: Literal -- id: 253 +- id: 254 kind: Ident span: 1:601-605 ident: !Ident - this - city targets: - - 197 - parent: 256 -- id: 254 + - 198 + parent: 257 +- id: 255 kind: Ident span: 1:607-613 ident: !Ident - this - street targets: - - 152 - parent: 256 -- id: 256 + - 153 + parent: 257 +- id: 257 kind: 'TransformCall: Sort' span: 1:595-614 children: - - 247 - - 253 + - 248 - 254 - parent: 262 -- id: 257 + - 255 + parent: 263 +- id: 258 kind: RqOperator span: 1:646-662 alias: num_tracks_last_week targets: - - 259 - 260 - parent: 261 -- id: 259 + - 261 + parent: 262 +- id: 260 kind: Literal span: 1:650-651 -- id: 260 +- id: 261 kind: Ident span: 1:652-662 ident: !Ident - this - num_tracks targets: - - 187 -- id: 261 + - 188 +- id: 262 kind: Tuple span: 1:622-663 children: - - 257 - parent: 262 -- id: 262 + - 258 + parent: 263 +- id: 263 kind: 'TransformCall: Derive' span: 1:615-663 children: - - 256 - - 261 - parent: 270 -- id: 263 + - 257 + - 262 + parent: 271 +- id: 264 kind: Ident span: 1:677-681 ident: !Ident - this - city targets: - - 197 - parent: 269 -- id: 264 + - 198 + parent: 270 +- id: 265 kind: Ident span: 1:687-693 ident: !Ident - this - street targets: - - 152 - parent: 269 -- id: 265 + - 153 + parent: 270 +- id: 266 kind: Ident span: 1:699-709 ident: !Ident - this - num_orders targets: - - 184 - parent: 269 -- id: 266 + - 185 + parent: 270 +- id: 267 kind: Ident span: 1:715-725 ident: !Ident - this - num_tracks targets: - - 187 - parent: 269 -- id: 267 + - 188 + parent: 270 +- id: 268 kind: Ident span: 1:731-755 ident: !Ident - this - running_total_num_tracks targets: - - 243 - parent: 269 -- id: 268 + - 244 + parent: 270 +- id: 269 kind: Ident span: 1:761-781 ident: !Ident - this - num_tracks_last_week targets: - - 257 - parent: 269 -- id: 269 + - 258 + parent: 270 +- id: 270 kind: Tuple span: 1:671-783 children: - - 263 - 264 - 265 - 266 - 267 - 268 - parent: 270 -- id: 270 + - 269 + parent: 271 +- id: 271 kind: 'TransformCall: Select' span: 1:664-783 children: - - 262 - - 269 - parent: 272 -- id: 272 + - 263 + - 270 + parent: 273 +- id: 273 kind: 'TransformCall: Take' span: 1:784-791 children: - - 270 - - 273 -- id: 273 + - 271 + - 274 +- id: 274 kind: Literal - parent: 272 + parent: 273 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap index 36fedb6b3dfd..80bf9acf1e88 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap @@ -9,252 +9,252 @@ frames: - !Single name: - n - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 128 + name: _literal_128 table: - default_db - - _literal_127 + - _literal_128 - - 1:200-212 - columns: - !Single name: - n - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 128 + name: _literal_128 table: - default_db - - _literal_127 + - _literal_128 - - 1:215-231 - columns: - !Single name: - n - target_id: 154 + target_id: 155 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 128 + name: _literal_128 table: - default_db - - _literal_127 + - _literal_128 - - 1:194-232 - columns: - !Single name: - n - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 128 + name: _literal_128 table: - default_db - - _literal_127 + - _literal_128 - - 1:233-249 - columns: - !Single name: - n - target_id: 162 + target_id: 163 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 128 + name: _literal_128 table: - default_db - - _literal_127 + - _literal_128 - - 1:250-256 - columns: - !Single name: - n - target_id: 162 + target_id: 163 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 128 + name: _literal_128 table: - default_db - - _literal_127 + - _literal_128 nodes: -- id: 127 +- id: 128 kind: Array span: 1:162-176 children: - - 128 - parent: 136 -- id: 128 + - 129 + parent: 137 +- id: 129 kind: Tuple span: 1:168-175 children: - - 129 - parent: 127 -- id: 129 + - 130 + parent: 128 +- id: 130 kind: Literal span: 1:173-174 alias: n - parent: 128 -- id: 131 + parent: 129 +- id: 132 kind: RqOperator span: 1:188-193 alias: n targets: - - 133 - 134 - parent: 135 -- id: 133 + - 135 + parent: 136 +- id: 134 kind: Ident span: 1:188-189 ident: !Ident - this - - _literal_127 + - _literal_128 - n targets: - - 127 -- id: 134 + - 128 +- id: 135 kind: Literal span: 1:192-193 -- id: 135 +- id: 136 kind: Tuple span: 1:188-193 children: - - 131 - parent: 136 -- id: 136 + - 132 + parent: 137 +- id: 137 kind: 'TransformCall: Select' span: 1:177-193 children: - - 127 - - 135 - parent: 160 -- id: 145 + - 128 + - 136 + parent: 161 +- id: 146 kind: Ident ident: !Ident - _param - _tbl targets: - - 142 - parent: 153 -- id: 149 + - 143 + parent: 154 +- id: 150 kind: RqOperator span: 1:207-212 targets: - - 151 - 152 - parent: 153 -- id: 151 + - 153 + parent: 154 +- id: 152 kind: Ident span: 1:207-208 ident: !Ident - this - n targets: - - 131 -- id: 152 + - 132 +- id: 153 kind: Literal span: 1:211-212 -- id: 153 +- id: 154 kind: 'TransformCall: Filter' span: 1:200-212 children: - - 145 - - 149 - parent: 159 -- id: 154 + - 146 + - 150 + parent: 160 +- id: 155 kind: RqOperator span: 1:226-231 alias: n targets: - - 156 - 157 - parent: 158 -- id: 156 + - 158 + parent: 159 +- id: 157 kind: Ident span: 1:226-227 ident: !Ident - this - n targets: - - 131 -- id: 157 + - 132 +- id: 158 kind: Literal span: 1:230-231 -- id: 158 +- id: 159 kind: Tuple span: 1:226-231 children: - - 154 - parent: 159 -- id: 159 + - 155 + parent: 160 +- id: 160 kind: 'TransformCall: Select' span: 1:215-231 children: - - 153 - - 158 -- id: 160 + - 154 + - 159 +- id: 161 kind: 'TransformCall: Loop' span: 1:194-232 children: - - 136 - - 161 - parent: 167 -- id: 161 + - 137 + - 162 + parent: 168 +- id: 162 kind: Func span: 1:215-231 - parent: 160 -- id: 162 + parent: 161 +- id: 163 kind: RqOperator span: 1:244-249 alias: n targets: - - 164 - 165 - parent: 166 -- id: 164 + - 166 + parent: 167 +- id: 165 kind: Ident span: 1:244-245 ident: !Ident - this - n targets: - - 131 -- id: 165 + - 132 +- id: 166 kind: Literal span: 1:248-249 -- id: 166 +- id: 167 kind: Tuple span: 1:244-249 children: - - 162 - parent: 167 -- id: 167 + - 163 + parent: 168 +- id: 168 kind: 'TransformCall: Select' span: 1:233-249 children: - - 160 - - 166 - parent: 170 -- id: 168 + - 161 + - 167 + parent: 171 +- id: 169 kind: Ident span: 1:255-256 ident: !Ident - this - n targets: - - 162 - parent: 170 -- id: 170 + - 163 + parent: 171 +- id: 171 kind: 'TransformCall: Sort' span: 1:250-256 children: - - 167 - 168 + - 169 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap index cf552c40ab7b..0740c403892a 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap @@ -7,10 +7,10 @@ frames: - - 1:96-102 - columns: - !All - input_id: 121 + input_id: 122 except: [] inputs: - - id: 121 + - id: 122 name: invoices table: - default_db @@ -20,109 +20,109 @@ frames: - !Single name: - total_original - target_id: 126 + target_id: 127 target_name: null - !Single name: - total_x - target_id: 131 + target_id: 132 target_name: null - !Single name: - total_floor - target_id: 142 + target_id: 143 target_name: null - !Single name: - total_ceil - target_id: 145 + target_id: 146 target_name: null - !Single name: - total_log10 - target_id: 148 + target_id: 149 target_name: null - !Single name: - total_log2 - target_id: 155 + target_id: 156 target_name: null - !Single name: - total_sqrt - target_id: 163 + target_id: 164 target_name: null - !Single name: - total_ln - target_id: 170 + target_id: 171 target_name: null - !Single name: - total_cos - target_id: 179 + target_id: 180 target_name: null - !Single name: - total_sin - target_id: 188 + target_id: 189 target_name: null - !Single name: - total_tan - target_id: 197 + target_id: 198 target_name: null - !Single name: - total_deg - target_id: 206 + target_id: 207 target_name: null - !Single name: - total_square - target_id: 215 + target_id: 216 target_name: null - !Single name: - total_square_op - target_id: 224 + target_id: 225 target_name: null inputs: - - id: 121 + - id: 122 name: invoices table: - default_db - invoices nodes: -- id: 121 +- id: 122 kind: Ident span: 1:82-95 ident: !Ident - default_db - invoices - parent: 124 -- id: 124 + parent: 125 +- id: 125 kind: 'TransformCall: Take' span: 1:96-102 children: - - 121 - - 125 - parent: 233 -- id: 125 - kind: Literal - parent: 124 + - 122 + - 126 + parent: 234 - id: 126 + kind: Literal + parent: 125 +- id: 127 kind: RqOperator span: 1:142-154 alias: total_original targets: - - 129 - 130 - parent: 232 -- id: 129 + - 131 + parent: 233 +- id: 130 kind: Literal span: 1:153-154 -- id: 130 +- id: 131 kind: Ident span: 1:134-139 ident: !Ident @@ -130,33 +130,33 @@ nodes: - invoices - total targets: - - 121 -- id: 131 + - 122 +- id: 132 kind: RqOperator span: 1:205-213 alias: total_x targets: - - 133 - parent: 232 -- id: 133 + - 134 + parent: 233 +- id: 134 kind: RqOperator span: 1:190-202 targets: - - 136 - 137 -- id: 136 + - 138 +- id: 137 kind: Literal span: 1:201-202 -- id: 137 +- id: 138 kind: RqOperator span: 1:172-187 targets: - - 140 - 141 -- id: 140 + - 142 +- id: 141 kind: RqOperator span: 1:172-179 -- id: 141 +- id: 142 kind: Ident span: 1:182-187 ident: !Ident @@ -164,15 +164,15 @@ nodes: - invoices - total targets: - - 121 -- id: 142 + - 122 +- id: 143 kind: RqOperator span: 1:234-252 alias: total_floor targets: - - 144 - parent: 232 -- id: 144 + - 145 + parent: 233 +- id: 145 kind: Ident span: 1:246-251 ident: !Ident @@ -180,15 +180,15 @@ nodes: - invoices - total targets: - - 121 -- id: 145 + - 122 +- id: 146 kind: RqOperator span: 1:271-288 alias: total_ceil targets: - - 147 - parent: 232 -- id: 147 + - 148 + parent: 233 +- id: 148 kind: Ident span: 1:282-287 ident: !Ident @@ -196,24 +196,24 @@ nodes: - invoices - total targets: - - 121 -- id: 148 + - 122 +- id: 149 kind: RqOperator span: 1:328-340 alias: total_log10 targets: - - 151 - 152 - parent: 232 -- id: 151 + - 153 + parent: 233 +- id: 152 kind: Literal span: 1:339-340 -- id: 152 +- id: 153 kind: RqOperator span: 1:309-325 targets: - - 154 -- id: 154 + - 155 +- id: 155 kind: Ident span: 1:320-325 ident: !Ident @@ -221,28 +221,28 @@ nodes: - invoices - total targets: - - 121 -- id: 155 + - 122 +- id: 156 kind: RqOperator span: 1:380-392 alias: total_log2 targets: - - 158 - 159 - parent: 232 -- id: 158 + - 160 + parent: 233 +- id: 159 kind: Literal span: 1:391-392 -- id: 159 +- id: 160 kind: RqOperator span: 1:361-377 targets: - - 161 - 162 -- id: 161 + - 163 +- id: 162 kind: Literal span: 1:370-371 -- id: 162 +- id: 163 kind: Ident span: 1:372-377 ident: !Ident @@ -250,24 +250,24 @@ nodes: - invoices - total targets: - - 121 -- id: 163 + - 122 +- id: 164 kind: RqOperator span: 1:431-443 alias: total_sqrt targets: - - 166 - 167 - parent: 232 -- id: 166 + - 168 + parent: 233 +- id: 167 kind: Literal span: 1:442-443 -- id: 167 +- id: 168 kind: RqOperator span: 1:413-428 targets: - - 169 -- id: 169 + - 170 +- id: 170 kind: Ident span: 1:423-428 ident: !Ident @@ -275,29 +275,29 @@ nodes: - invoices - total targets: - - 121 -- id: 170 + - 122 +- id: 171 kind: RqOperator span: 1:489-501 alias: total_ln targets: - - 173 - 174 - parent: 232 -- id: 173 + - 175 + parent: 233 +- id: 174 kind: Literal span: 1:500-501 -- id: 174 +- id: 175 kind: RqOperator span: 1:478-486 targets: - - 176 -- id: 176 + - 177 +- id: 177 kind: RqOperator span: 1:462-475 targets: - - 178 -- id: 178 + - 179 +- id: 179 kind: Ident span: 1:470-475 ident: !Ident @@ -305,29 +305,29 @@ nodes: - invoices - total targets: - - 121 -- id: 179 + - 122 +- id: 180 kind: RqOperator span: 1:550-562 alias: total_cos targets: - - 182 - 183 - parent: 232 -- id: 182 + - 184 + parent: 233 +- id: 183 kind: Literal span: 1:561-562 -- id: 183 +- id: 184 kind: RqOperator span: 1:538-547 targets: - - 185 -- id: 185 + - 186 +- id: 186 kind: RqOperator span: 1:521-535 targets: - - 187 -- id: 187 + - 188 +- id: 188 kind: Ident span: 1:530-535 ident: !Ident @@ -335,29 +335,29 @@ nodes: - invoices - total targets: - - 121 -- id: 188 + - 122 +- id: 189 kind: RqOperator span: 1:611-623 alias: total_sin targets: - - 191 - 192 - parent: 232 -- id: 191 + - 193 + parent: 233 +- id: 192 kind: Literal span: 1:622-623 -- id: 192 +- id: 193 kind: RqOperator span: 1:599-608 targets: - - 194 -- id: 194 + - 195 +- id: 195 kind: RqOperator span: 1:582-596 targets: - - 196 -- id: 196 + - 197 +- id: 197 kind: Ident span: 1:591-596 ident: !Ident @@ -365,29 +365,29 @@ nodes: - invoices - total targets: - - 121 -- id: 197 + - 122 +- id: 198 kind: RqOperator span: 1:672-684 alias: total_tan targets: - - 200 - 201 - parent: 232 -- id: 200 + - 202 + parent: 233 +- id: 201 kind: Literal span: 1:683-684 -- id: 201 +- id: 202 kind: RqOperator span: 1:660-669 targets: - - 203 -- id: 203 + - 204 +- id: 204 kind: RqOperator span: 1:643-657 targets: - - 205 -- id: 205 + - 206 +- id: 206 kind: Ident span: 1:652-657 ident: !Ident @@ -395,29 +395,29 @@ nodes: - invoices - total targets: - - 121 -- id: 206 + - 122 +- id: 207 kind: RqOperator span: 1:742-754 alias: total_deg targets: - - 209 - 210 - parent: 232 -- id: 209 + - 211 + parent: 233 +- id: 210 kind: Literal span: 1:753-754 -- id: 210 +- id: 211 kind: RqOperator span: 1:727-739 targets: - - 212 -- id: 212 + - 213 +- id: 213 kind: RqOperator span: 1:712-724 targets: - - 214 -- id: 214 + - 215 +- id: 215 kind: Ident span: 1:704-709 ident: !Ident @@ -425,28 +425,28 @@ nodes: - invoices - total targets: - - 121 -- id: 215 + - 122 +- id: 216 kind: RqOperator span: 1:798-810 alias: total_square targets: - - 218 - 219 - parent: 232 -- id: 218 + - 220 + parent: 233 +- id: 219 kind: Literal span: 1:809-810 -- id: 219 +- id: 220 kind: RqOperator span: 1:785-795 targets: - - 222 - 223 -- id: 222 + - 224 +- id: 223 kind: Literal span: 1:794-795 -- id: 223 +- id: 224 kind: Ident span: 1:777-782 ident: !Ident @@ -454,28 +454,28 @@ nodes: - invoices - total targets: - - 121 -- id: 224 + - 122 +- id: 225 kind: RqOperator span: 1:851-863 alias: total_square_op targets: - - 227 - 228 - parent: 232 -- id: 227 + - 229 + parent: 233 +- id: 228 kind: Literal span: 1:862-863 -- id: 228 +- id: 229 kind: RqOperator span: 1:836-848 targets: - - 230 - 231 -- id: 230 + - 232 +- id: 231 kind: Literal span: 1:846-847 -- id: 231 +- id: 232 kind: Ident span: 1:837-842 ident: !Ident @@ -483,32 +483,32 @@ nodes: - invoices - total targets: - - 121 -- id: 232 + - 122 +- id: 233 kind: Tuple span: 1:110-867 children: - - 126 - - 131 - - 142 - - 145 - - 148 - - 155 - - 163 - - 170 - - 179 - - 188 - - 197 - - 206 - - 215 - - 224 - parent: 233 -- id: 233 + - 127 + - 132 + - 143 + - 146 + - 149 + - 156 + - 164 + - 171 + - 180 + - 189 + - 198 + - 207 + - 216 + - 225 + parent: 234 +- id: 234 kind: 'TransformCall: Select' span: 1:103-867 children: - - 124 - - 232 + - 125 + - 233 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap index e76b2258b509..508352ae17e7 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap @@ -7,10 +7,10 @@ frames: - - 1:179-202 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -18,10 +18,10 @@ frames: - - 1:203-248 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -29,10 +29,10 @@ frames: - - 1:249-262 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -40,10 +40,10 @@ frames: - - 1:263-273 - columns: - !All - input_id: 130 + input_id: 131 except: [] inputs: - - id: 130 + - id: 131 name: tracks table: - default_db @@ -54,36 +54,36 @@ frames: name: - tracks - name - target_id: 164 + target_id: 165 target_name: null - !Single name: - tracks - composer - target_id: 165 + target_id: 166 target_name: null inputs: - - id: 130 + - id: 131 name: tracks table: - default_db - tracks nodes: -- id: 130 +- id: 131 kind: Ident span: 1:166-177 ident: !Ident - default_db - tracks - parent: 136 -- id: 132 + parent: 137 +- id: 133 kind: RqOperator span: 1:187-201 targets: - - 134 - 135 - parent: 136 -- id: 134 + - 136 + parent: 137 +- id: 135 kind: Ident span: 1:187-191 ident: !Ident @@ -91,38 +91,38 @@ nodes: - tracks - name targets: - - 130 -- id: 135 + - 131 +- id: 136 kind: Literal span: 1:195-201 -- id: 136 +- id: 137 kind: 'TransformCall: Filter' span: 1:179-202 children: - - 130 - - 132 - parent: 156 -- id: 140 + - 131 + - 133 + parent: 157 +- id: 141 kind: Literal span: 1:243-244 alias: start -- id: 141 +- id: 142 kind: Literal span: 1:246-247 alias: end -- id: 143 +- id: 144 kind: RqOperator span: 1:211-237 targets: - - 145 - - 149 -- id: 145 + - 146 + - 150 +- id: 146 kind: RqOperator span: 1:212-231 targets: - - 147 - 148 -- id: 147 + - 149 +- id: 148 kind: Ident span: 1:212-224 ident: !Ident @@ -130,38 +130,38 @@ nodes: - tracks - milliseconds targets: - - 130 -- id: 148 + - 131 +- id: 149 kind: Literal span: 1:227-231 -- id: 149 +- id: 150 kind: Literal span: 1:234-236 -- id: 150 +- id: 151 kind: RqOperator span: 1:240-247 targets: - - 152 - - 154 - parent: 156 -- id: 152 + - 153 + - 155 + parent: 157 +- id: 153 kind: RqOperator targets: - - 143 - - 140 -- id: 154 + - 144 + - 141 +- id: 155 kind: RqOperator targets: - - 143 - - 141 -- id: 156 + - 144 + - 142 +- id: 157 kind: 'TransformCall: Filter' span: 1:203-248 children: - - 136 - - 150 - parent: 159 -- id: 157 + - 137 + - 151 + parent: 160 +- id: 158 kind: Ident span: 1:254-262 ident: !Ident @@ -169,34 +169,34 @@ nodes: - tracks - track_id targets: - - 130 - parent: 159 -- id: 159 + - 131 + parent: 160 +- id: 160 kind: 'TransformCall: Sort' span: 1:249-262 children: - - 156 - 157 - parent: 163 -- id: 160 + - 158 + parent: 164 +- id: 161 kind: Literal span: 1:268-269 alias: start - parent: 163 -- id: 161 + parent: 164 +- id: 162 kind: Literal span: 1:271-273 alias: end - parent: 163 -- id: 163 + parent: 164 +- id: 164 kind: 'TransformCall: Take' span: 1:263-273 children: - - 159 - 160 - 161 - parent: 167 -- id: 164 + - 162 + parent: 168 +- id: 165 kind: Ident span: 1:282-286 ident: !Ident @@ -204,9 +204,9 @@ nodes: - tracks - name targets: - - 130 - parent: 166 -- id: 165 + - 131 + parent: 167 +- id: 166 kind: Ident span: 1:288-296 ident: !Ident @@ -214,21 +214,21 @@ nodes: - tracks - composer targets: - - 130 - parent: 166 -- id: 166 + - 131 + parent: 167 +- id: 167 kind: Tuple span: 1:281-297 children: - - 164 - 165 - parent: 167 -- id: 167 + - 166 + parent: 168 +- id: 168 kind: 'TransformCall: Select' span: 1:274-297 children: - - 163 - - 166 + - 164 + - 167 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap index d5fc9bfbbde7..0f669456d723 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap @@ -7,77 +7,77 @@ frames: - - 1:92-144 - columns: - !All - input_id: 124 + input_id: 125 except: [] inputs: - - id: 124 - name: _literal_124 + - id: 125 + name: _literal_125 table: - default_db - - _literal_124 - - id: 119 - name: _literal_119 + - _literal_125 + - id: 120 + name: _literal_120 table: - default_db - - _literal_119 + - _literal_120 - - 1:145-163 - columns: - !All - input_id: 124 + input_id: 125 except: [] inputs: - - id: 124 - name: _literal_124 + - id: 125 + name: _literal_125 table: - default_db - - _literal_124 - - id: 119 - name: _literal_119 + - _literal_125 + - id: 120 + name: _literal_120 table: - default_db - - _literal_119 + - _literal_120 nodes: -- id: 119 +- id: 120 kind: RqOperator span: 1:100-143 targets: - - 121 - parent: 128 -- id: 121 + - 122 + parent: 129 +- id: 122 kind: Literal span: 1:110-143 -- id: 124 +- id: 125 kind: RqOperator span: 1:43-91 targets: - - 126 - parent: 128 -- id: 126 + - 127 + parent: 129 +- id: 127 kind: Literal span: 1:58-90 -- id: 128 +- id: 129 kind: 'TransformCall: Append' span: 1:92-144 children: - - 124 - - 119 - parent: 131 -- id: 129 + - 125 + - 120 + parent: 132 +- id: 130 kind: Ident span: 1:150-163 ident: !Ident - this - - _literal_124 + - _literal_125 - media_type_id targets: - - 124 - parent: 131 -- id: 131 + - 125 + parent: 132 +- id: 132 kind: 'TransformCall: Sort' span: 1:145-163 children: - - 128 - 129 + - 130 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap index cd69dacc93d0..d120a73bd6b7 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap @@ -10,167 +10,167 @@ frames: name: - t - a - target_id: 136 + target_id: 137 target_name: null inputs: - - id: 127 + - id: 128 name: t table: - default_db - - _literal_127 + - _literal_128 - - 0:3172-3258 - columns: - !Single name: - t - a - target_id: 136 + target_id: 137 target_name: null - !Single name: - b - a - target_id: 122 + target_id: 123 target_name: a inputs: - - id: 127 + - id: 128 name: t table: - default_db - - _literal_127 - - id: 122 + - _literal_128 + - id: 123 name: b table: - default_db - - _literal_122 + - _literal_123 - - 0:3261-3315 - columns: - !Single name: - t - a - target_id: 136 + target_id: 137 target_name: null - !Single name: - b - a - target_id: 122 + target_id: 123 target_name: a inputs: - - id: 127 + - id: 128 name: t table: - default_db - - _literal_127 - - id: 122 + - _literal_128 + - id: 123 name: b table: - default_db - - _literal_122 + - _literal_123 - - 1:165-238 - columns: - !Single name: - t - a - target_id: 213 + target_id: 214 target_name: null inputs: - - id: 127 + - id: 128 name: t table: - default_db - - _literal_127 - - id: 122 + - _literal_128 + - id: 123 name: b table: - default_db - - _literal_122 + - _literal_123 - - 1:239-245 - columns: - !Single name: - t - a - target_id: 213 + target_id: 214 target_name: null inputs: - - id: 127 + - id: 128 name: t table: - default_db - - _literal_127 - - id: 122 + - _literal_128 + - id: 123 name: b table: - default_db - - _literal_122 + - _literal_123 nodes: -- id: 122 +- id: 123 kind: Array span: 1:173-237 - parent: 192 -- id: 127 + parent: 193 +- id: 128 kind: Array span: 1:36-55 - parent: 154 -- id: 136 + parent: 155 +- id: 137 kind: Ident ident: !Ident - this - t - a targets: - - 127 - parent: 138 -- id: 138 + - 128 + parent: 139 +- id: 139 kind: Tuple span: 1:64-69 children: - - 136 -- id: 154 + - 137 +- id: 155 kind: 'TransformCall: Take' span: 1:71-77 children: - - 127 - - 155 - parent: 192 -- id: 155 + - 128 + - 156 + parent: 193 +- id: 156 kind: Literal - parent: 154 -- id: 181 + parent: 155 +- id: 182 kind: Ident ident: !Ident - this - t - a targets: - - 136 -- id: 184 + - 137 +- id: 185 kind: Ident ident: !Ident - that - b - a targets: - - 122 -- id: 190 + - 123 +- id: 191 kind: RqOperator span: 0:3201-3257 targets: - - 181 - - 184 - parent: 192 -- id: 192 + - 182 + - 185 + parent: 193 +- id: 193 kind: 'TransformCall: Join' span: 0:3172-3258 children: - - 154 - - 122 - - 190 - parent: 211 -- id: 203 + - 155 + - 123 + - 191 + parent: 212 +- id: 204 kind: Ident span: 0:6033-6041 ident: !Ident @@ -178,47 +178,47 @@ nodes: - b - a targets: - - 122 -- id: 207 + - 123 +- id: 208 kind: RqOperator span: 0:3269-3314 targets: - - 203 - - 210 - parent: 211 -- id: 210 + - 204 + - 211 + parent: 212 +- id: 211 kind: Literal span: 0:6045-6049 -- id: 211 +- id: 212 kind: 'TransformCall: Filter' span: 0:3261-3315 children: - - 192 - - 207 - parent: 215 -- id: 213 + - 193 + - 208 + parent: 216 +- id: 214 kind: Ident ident: !Ident - this - t - a targets: - - 136 - parent: 214 -- id: 214 + - 137 + parent: 215 +- id: 215 kind: Tuple span: 0:3325-3328 children: - - 213 - parent: 215 -- id: 215 + - 214 + parent: 216 +- id: 216 kind: 'TransformCall: Select' span: 1:165-238 children: - - 211 - - 214 - parent: 218 -- id: 216 + - 212 + - 215 + parent: 219 +- id: 217 kind: Ident span: 1:244-245 ident: !Ident @@ -226,14 +226,14 @@ nodes: - t - a targets: - - 213 - parent: 218 -- id: 218 + - 214 + parent: 219 +- id: 219 kind: 'TransformCall: Sort' span: 1:239-245 children: - - 215 - 216 + - 217 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap index db7de1ae6789..0c1a52ce8eeb 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap @@ -7,10 +7,10 @@ frames: - - 1:30-61 - columns: - !All - input_id: 128 + input_id: 129 except: [] inputs: - - id: 128 + - id: 129 name: e table: - default_db @@ -18,10 +18,10 @@ frames: - - 1:62-90 - columns: - !All - input_id: 128 + input_id: 129 except: [] inputs: - - id: 128 + - id: 129 name: e table: - default_db @@ -29,18 +29,18 @@ frames: - - 1:145-215 - columns: - !All - input_id: 128 + input_id: 129 except: [] - !All - input_id: 119 + input_id: 120 except: [] inputs: - - id: 128 + - id: 129 name: e table: - default_db - employees - - id: 119 + - id: 120 name: manager table: - default_db @@ -49,54 +49,54 @@ frames: - columns: - !Single name: null - target_id: 144 + target_id: 145 target_name: null - !Single name: - e - last_name - target_id: 145 + target_id: 146 target_name: null - !Single name: - manager - first_name - target_id: 146 + target_id: 147 target_name: null inputs: - - id: 128 + - id: 129 name: e table: - default_db - employees - - id: 119 + - id: 120 name: manager table: - default_db - employees nodes: -- id: 119 +- id: 120 kind: Ident span: 1:158-167 ident: !Ident - default_db - employees - parent: 143 -- id: 128 + parent: 144 +- id: 129 kind: Ident span: 1:13-29 ident: !Ident - default_db - employees - parent: 134 -- id: 130 + parent: 135 +- id: 131 kind: RqOperator span: 1:37-61 targets: - - 132 - 133 - parent: 134 -- id: 132 + - 134 + parent: 135 +- id: 133 kind: Ident span: 1:37-47 ident: !Ident @@ -104,18 +104,18 @@ nodes: - e - first_name targets: - - 128 -- id: 133 + - 129 +- id: 134 kind: Literal span: 1:51-61 -- id: 134 +- id: 135 kind: 'TransformCall: Filter' span: 1:30-61 children: - - 128 - - 130 - parent: 138 -- id: 135 + - 129 + - 131 + parent: 139 +- id: 136 kind: Ident span: 1:68-78 ident: !Ident @@ -123,9 +123,9 @@ nodes: - e - first_name targets: - - 128 - parent: 138 -- id: 136 + - 129 + parent: 139 +- id: 137 kind: Ident span: 1:80-89 ident: !Ident @@ -133,24 +133,24 @@ nodes: - e - last_name targets: - - 128 - parent: 138 -- id: 138 + - 129 + parent: 139 +- id: 139 kind: 'TransformCall: Sort' span: 1:62-90 children: - - 134 - 135 - 136 - parent: 143 -- id: 139 + - 137 + parent: 144 +- id: 140 kind: RqOperator span: 1:179-214 targets: - - 141 - 142 - parent: 143 -- id: 141 + - 143 + parent: 144 +- id: 142 kind: Ident span: 1:179-191 ident: !Ident @@ -158,8 +158,8 @@ nodes: - e - reports_to targets: - - 128 -- id: 142 + - 129 +- id: 143 kind: Ident span: 1:195-214 ident: !Ident @@ -167,16 +167,16 @@ nodes: - manager - employee_id targets: - - 119 -- id: 143 + - 120 +- id: 144 kind: 'TransformCall: Join' span: 1:145-215 children: - - 138 - - 119 - 139 - parent: 148 -- id: 144 + - 120 + - 140 + parent: 149 +- id: 145 kind: Ident span: 1:225-237 ident: !Ident @@ -184,9 +184,9 @@ nodes: - e - first_name targets: - - 128 - parent: 147 -- id: 145 + - 129 + parent: 148 +- id: 146 kind: Ident span: 1:239-250 ident: !Ident @@ -194,9 +194,9 @@ nodes: - e - last_name targets: - - 128 - parent: 147 -- id: 146 + - 129 + parent: 148 +- id: 147 kind: Ident span: 1:252-270 ident: !Ident @@ -204,22 +204,22 @@ nodes: - manager - first_name targets: - - 119 - parent: 147 -- id: 147 + - 120 + parent: 148 +- id: 148 kind: Tuple span: 1:224-271 children: - - 144 - 145 - 146 - parent: 148 -- id: 148 + - 147 + parent: 149 +- id: 149 kind: 'TransformCall: Select' span: 1:217-271 children: - - 143 - - 147 + - 144 + - 148 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap index b49dc06cb375..77b8eb37d108 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap @@ -9,16 +9,16 @@ frames: - !Single name: - AA - target_id: 130 + target_id: 131 target_name: null - !Single name: - albums - artist_id - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 128 + - id: 129 name: albums table: - default_db @@ -28,16 +28,16 @@ frames: - !Single name: - AA - target_id: 130 + target_id: 131 target_name: null - !Single name: - albums - artist_id - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 128 + - id: 129 name: albums table: - default_db @@ -47,16 +47,16 @@ frames: - !Single name: - AA - target_id: 130 + target_id: 131 target_name: null - !Single name: - albums - artist_id - target_id: 131 + target_id: 132 target_name: null inputs: - - id: 128 + - id: 129 name: albums table: - default_db @@ -66,44 +66,44 @@ frames: - !Single name: - AA - target_id: 130 + target_id: 131 target_name: null - !Single name: - albums - artist_id - target_id: 131 + target_id: 132 target_name: null - !All - input_id: 116 + input_id: 117 except: [] inputs: - - id: 128 + - id: 129 name: albums table: - default_db - albums - - id: 116 + - id: 117 name: artists table: - default_db - artists nodes: -- id: 116 +- id: 117 kind: Ident span: 1:75-82 ident: !Ident - default_db - artists - parent: 146 -- id: 128 + parent: 147 +- id: 129 kind: Ident span: 1:0-11 ident: !Ident - default_db - albums - parent: 133 -- id: 130 + parent: 134 +- id: 131 kind: Ident span: 1:24-32 alias: AA @@ -112,9 +112,9 @@ nodes: - albums - album_id targets: - - 128 - parent: 132 -- id: 131 + - 129 + parent: 133 +- id: 132 kind: Ident span: 1:34-43 ident: !Ident @@ -122,71 +122,71 @@ nodes: - albums - artist_id targets: - - 128 - parent: 132 -- id: 132 + - 129 + parent: 133 +- id: 133 kind: Tuple span: 1:19-45 children: - - 130 - 131 - parent: 133 -- id: 133 + - 132 + parent: 134 +- id: 134 kind: 'TransformCall: Select' span: 1:12-45 children: - - 128 - - 132 - parent: 136 -- id: 134 + - 129 + - 133 + parent: 137 +- id: 135 kind: Ident span: 1:51-53 ident: !Ident - this - AA targets: - - 130 - parent: 136 -- id: 136 + - 131 + parent: 137 +- id: 137 kind: 'TransformCall: Sort' span: 1:46-53 children: - - 133 - 134 - parent: 141 -- id: 137 + - 135 + parent: 142 +- id: 138 kind: RqOperator span: 1:61-69 targets: - - 139 - 140 - parent: 141 -- id: 139 + - 141 + parent: 142 +- id: 140 kind: Ident span: 1:61-63 ident: !Ident - this - AA targets: - - 130 -- id: 140 + - 131 +- id: 141 kind: Literal span: 1:67-69 -- id: 141 +- id: 142 kind: 'TransformCall: Filter' span: 1:54-69 children: - - 136 - 137 - parent: 146 -- id: 142 + - 138 + parent: 147 +- id: 143 kind: RqOperator span: 1:84-95 targets: - - 144 - 145 - parent: 146 -- id: 144 + - 146 + parent: 147 +- id: 145 kind: Ident span: 1:86-95 ident: !Ident @@ -194,8 +194,8 @@ nodes: - albums - artist_id targets: - - 131 -- id: 145 + - 132 +- id: 146 kind: Ident span: 1:86-95 ident: !Ident @@ -203,14 +203,14 @@ nodes: - artists - artist_id targets: - - 116 -- id: 146 + - 117 +- id: 147 kind: 'TransformCall: Join' span: 1:70-96 children: - - 141 - - 116 - 142 + - 117 + - 143 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap index 3b4465152e42..0cae4becbb36 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap @@ -9,565 +9,565 @@ frames: - !Single name: - AA - target_id: 150 + target_id: 151 target_name: null - !Single name: - - _literal_144 + - _literal_145 - album_id - target_id: 151 + target_id: 152 target_name: null - !Single name: - - _literal_144 + - _literal_145 - genre_id - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 + - _literal_145 - - 1:87-94 - columns: - !Single name: - AA - target_id: 150 + target_id: 151 target_name: null - !Single name: - - _literal_144 + - _literal_145 - album_id - target_id: 151 + target_id: 152 target_name: null - !Single name: - - _literal_144 + - _literal_145 - genre_id - target_id: 152 + target_id: 153 target_name: null inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 + - _literal_145 - - 1:95-158 - columns: - !Single name: - AA - target_id: 150 + target_id: 151 target_name: null - !Single name: - - _literal_144 + - _literal_145 - album_id - target_id: 151 + target_id: 152 target_name: null - !Single name: - - _literal_144 + - _literal_145 - genre_id - target_id: 152 + target_id: 153 target_name: null - !Single name: - - _literal_132 + - _literal_133 - album_id - target_id: 132 + target_id: 133 target_name: album_id - !Single name: - - _literal_132 + - _literal_133 - album_title - target_id: 132 + target_id: 133 target_name: album_title inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 - - id: 132 - name: _literal_132 + - _literal_145 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:159-213 - columns: - !Single name: - AA - target_id: 163 + target_id: 164 target_name: null - !Single name: - AT - target_id: 164 + target_id: 165 target_name: null - !Single name: - - _literal_144 + - _literal_145 - genre_id - target_id: 168 + target_id: 169 target_name: null inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 - - id: 132 - name: _literal_132 + - _literal_145 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:214-228 - columns: - !Single name: - AA - target_id: 163 + target_id: 164 target_name: null - !Single name: - AT - target_id: 164 + target_id: 165 target_name: null - !Single name: - - _literal_144 + - _literal_145 - genre_id - target_id: 168 + target_id: 169 target_name: null inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 - - id: 132 - name: _literal_132 + - _literal_145 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 + - _literal_133 - - 1:229-291 - columns: - !Single name: - AA - target_id: 163 + target_id: 164 target_name: null - !Single name: - AT - target_id: 164 + target_id: 165 target_name: null - !Single name: - - _literal_144 + - _literal_145 - genre_id - target_id: 168 + target_id: 169 target_name: null - !Single name: - - _literal_119 + - _literal_120 - genre_id - target_id: 119 + target_id: 120 target_name: genre_id - !Single name: - - _literal_119 + - _literal_120 - genre_title - target_id: 119 + target_id: 120 target_name: genre_title inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 - - id: 132 - name: _literal_132 + - _literal_145 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 - - id: 119 - name: _literal_119 + - _literal_133 + - id: 120 + name: _literal_120 table: - default_db - - _literal_119 + - _literal_120 - - 1:292-340 - columns: - !Single name: - AA - target_id: 181 + target_id: 182 target_name: null - !Single name: - AT - target_id: 182 + target_id: 183 target_name: null - !Single name: - GT - target_id: 183 + target_id: 184 target_name: null inputs: - - id: 144 - name: _literal_144 + - id: 145 + name: _literal_145 table: - default_db - - _literal_144 - - id: 132 - name: _literal_132 + - _literal_145 + - id: 133 + name: _literal_133 table: - default_db - - _literal_132 - - id: 119 - name: _literal_119 + - _literal_133 + - id: 120 + name: _literal_120 table: - default_db - - _literal_119 + - _literal_120 nodes: -- id: 119 +- id: 120 kind: Array span: 1:244-278 children: - - 120 - parent: 180 -- id: 120 + - 121 + parent: 181 +- id: 121 kind: Tuple span: 1:245-277 children: - - 121 - 122 - parent: 119 -- id: 121 + - 123 + parent: 120 +- id: 122 kind: Literal span: 1:255-256 alias: genre_id - parent: 120 -- id: 122 + parent: 121 +- id: 123 kind: Literal span: 1:270-276 alias: genre_title - parent: 120 -- id: 132 + parent: 121 +- id: 133 kind: Array span: 1:110-145 children: - - 133 - parent: 162 -- id: 133 + - 134 + parent: 163 +- id: 134 kind: Tuple span: 1:111-144 children: - - 134 - 135 - parent: 132 -- id: 134 + - 136 + parent: 133 +- id: 135 kind: Literal span: 1:121-122 alias: album_id - parent: 133 -- id: 135 + parent: 134 +- id: 136 kind: Literal span: 1:136-143 alias: album_title - parent: 133 -- id: 144 + parent: 134 +- id: 145 kind: Array span: 1:0-43 children: - - 145 - parent: 154 -- id: 145 + - 146 + parent: 155 +- id: 146 kind: Tuple span: 1:6-42 children: - - 146 - 147 - 148 - parent: 144 -- id: 146 + - 149 + parent: 145 +- id: 147 kind: Literal span: 1:16-17 alias: track_id - parent: 145 -- id: 147 + parent: 146 +- id: 148 kind: Literal span: 1:28-29 alias: album_id - parent: 145 -- id: 148 + parent: 146 +- id: 149 kind: Literal span: 1:40-41 alias: genre_id - parent: 145 -- id: 150 + parent: 146 +- id: 151 kind: Ident span: 1:56-64 alias: AA ident: !Ident - this - - _literal_144 + - _literal_145 - track_id targets: - - 144 - parent: 153 -- id: 151 + - 145 + parent: 154 +- id: 152 kind: Ident span: 1:66-74 ident: !Ident - this - - _literal_144 + - _literal_145 - album_id targets: - - 144 - parent: 153 -- id: 152 + - 145 + parent: 154 +- id: 153 kind: Ident span: 1:76-84 ident: !Ident - this - - _literal_144 + - _literal_145 - genre_id targets: - - 144 - parent: 153 -- id: 153 + - 145 + parent: 154 +- id: 154 kind: Tuple span: 1:51-86 children: - - 150 - 151 - 152 - parent: 154 -- id: 154 + - 153 + parent: 155 +- id: 155 kind: 'TransformCall: Select' span: 1:44-86 children: - - 144 - - 153 - parent: 157 -- id: 155 + - 145 + - 154 + parent: 158 +- id: 156 kind: Ident span: 1:92-94 ident: !Ident - this - AA targets: - - 150 - parent: 157 -- id: 157 + - 151 + parent: 158 +- id: 158 kind: 'TransformCall: Sort' span: 1:87-94 children: - - 154 - 155 - parent: 162 -- id: 158 + - 156 + parent: 163 +- id: 159 kind: RqOperator span: 1:147-157 targets: - - 160 - 161 - parent: 162 -- id: 160 + - 162 + parent: 163 +- id: 161 kind: Ident span: 1:149-157 ident: !Ident - this - - _literal_144 + - _literal_145 - album_id targets: - - 151 -- id: 161 + - 152 +- id: 162 kind: Ident span: 1:149-157 ident: !Ident - that - - _literal_132 + - _literal_133 - album_id targets: - - 132 -- id: 162 + - 133 +- id: 163 kind: 'TransformCall: Join' span: 1:95-158 children: - - 157 - - 132 - 158 - parent: 170 -- id: 163 + - 133 + - 159 + parent: 171 +- id: 164 kind: Ident span: 1:168-170 ident: !Ident - this - AA targets: - - 150 - parent: 169 -- id: 164 + - 151 + parent: 170 +- id: 165 kind: RqOperator span: 1:177-201 alias: AT targets: - - 166 - 167 - parent: 169 -- id: 166 + - 168 + parent: 170 +- id: 167 kind: Ident span: 1:177-188 ident: !Ident - this - - _literal_132 + - _literal_133 - album_title targets: - - 132 -- id: 167 + - 133 +- id: 168 kind: Literal span: 1:192-201 -- id: 168 +- id: 169 kind: Ident span: 1:203-211 ident: !Ident - this - - _literal_144 + - _literal_145 - genre_id targets: - - 152 - parent: 169 -- id: 169 + - 153 + parent: 170 +- id: 170 kind: Tuple span: 1:166-213 children: - - 163 - 164 - - 168 - parent: 170 -- id: 170 + - 165 + - 169 + parent: 171 +- id: 171 kind: 'TransformCall: Select' span: 1:159-213 children: - - 162 - - 169 - parent: 175 -- id: 171 + - 163 + - 170 + parent: 176 +- id: 172 kind: RqOperator span: 1:221-228 targets: - - 173 - 174 - parent: 175 -- id: 173 + - 175 + parent: 176 +- id: 174 kind: Ident span: 1:221-223 ident: !Ident - this - AA targets: - - 163 -- id: 174 + - 164 +- id: 175 kind: Literal span: 1:226-228 -- id: 175 +- id: 176 kind: 'TransformCall: Filter' span: 1:214-228 children: - - 170 - 171 - parent: 180 -- id: 176 + - 172 + parent: 181 +- id: 177 kind: RqOperator span: 1:280-290 targets: - - 178 - 179 - parent: 180 -- id: 178 + - 180 + parent: 181 +- id: 179 kind: Ident span: 1:282-290 ident: !Ident - this - - _literal_144 + - _literal_145 - genre_id targets: - - 168 -- id: 179 + - 169 +- id: 180 kind: Ident span: 1:282-290 ident: !Ident - that - - _literal_119 + - _literal_120 - genre_id targets: - - 119 -- id: 180 + - 120 +- id: 181 kind: 'TransformCall: Join' span: 1:229-291 children: - - 175 - - 119 - 176 - parent: 188 -- id: 181 + - 120 + - 177 + parent: 189 +- id: 182 kind: Ident span: 1:301-303 ident: !Ident - this - AA targets: - - 163 - parent: 187 -- id: 182 + - 164 + parent: 188 +- id: 183 kind: Ident span: 1:305-307 ident: !Ident - this - AT targets: - - 164 - parent: 187 -- id: 183 + - 165 + parent: 188 +- id: 184 kind: RqOperator span: 1:314-338 alias: GT targets: - - 185 - 186 - parent: 187 -- id: 185 + - 187 + parent: 188 +- id: 186 kind: Ident span: 1:314-325 ident: !Ident - this - - _literal_119 + - _literal_120 - genre_title targets: - - 119 -- id: 186 + - 120 +- id: 187 kind: Literal span: 1:329-338 -- id: 187 +- id: 188 kind: Tuple span: 1:299-340 children: - - 181 - 182 - 183 - parent: 188 -- id: 188 + - 184 + parent: 189 +- id: 189 kind: 'TransformCall: Select' span: 1:292-340 children: - - 180 - - 187 + - 181 + - 188 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap index 45387d65e704..f7b776b68213 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap @@ -7,10 +7,10 @@ frames: - - 1:101-118 - columns: - !All - input_id: 124 + input_id: 125 except: [] inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -20,10 +20,10 @@ frames: - !Single name: - display - target_id: 129 + target_id: 130 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db @@ -33,23 +33,23 @@ frames: - !Single name: - display - target_id: 129 + target_id: 130 target_name: null inputs: - - id: 124 + - id: 125 name: tracks table: - default_db - tracks nodes: -- id: 124 +- id: 125 kind: Ident span: 1:89-100 ident: !Ident - default_db - tracks - parent: 128 -- id: 126 + parent: 129 +- id: 127 kind: Ident span: 1:106-118 ident: !Ident @@ -57,34 +57,34 @@ nodes: - tracks - milliseconds targets: - - 124 - parent: 128 -- id: 128 + - 125 + parent: 129 +- id: 129 kind: 'TransformCall: Sort' span: 1:101-118 children: - - 124 - - 126 - parent: 143 -- id: 129 + - 125 + - 127 + parent: 144 +- id: 130 kind: Case span: 1:136-246 alias: display targets: - - 130 - - 134 + - 131 - 135 - - 139 + - 136 - 140 - 141 - parent: 142 -- id: 130 + - 142 + parent: 143 +- id: 131 kind: RqOperator span: 1:147-163 targets: - - 132 - 133 -- id: 132 + - 134 +- id: 133 kind: Ident span: 1:147-155 ident: !Ident @@ -92,11 +92,11 @@ nodes: - tracks - composer targets: - - 124 -- id: 133 + - 125 +- id: 134 kind: Literal span: 1:159-163 -- id: 134 +- id: 135 kind: Ident span: 1:167-175 ident: !Ident @@ -104,14 +104,14 @@ nodes: - tracks - composer targets: - - 124 -- id: 135 + - 125 +- id: 136 kind: RqOperator span: 1:181-194 targets: - - 137 - 138 -- id: 137 + - 139 +- id: 138 kind: Ident span: 1:181-189 ident: !Ident @@ -119,41 +119,41 @@ nodes: - tracks - genre_id targets: - - 124 -- id: 138 + - 125 +- id: 139 kind: Literal span: 1:192-194 -- id: 139 +- id: 140 kind: Literal span: 1:198-211 -- id: 140 +- id: 141 kind: Literal span: 1:217-221 -- id: 141 +- id: 142 kind: FString span: 1:225-244 -- id: 142 +- id: 143 kind: Tuple span: 1:136-246 children: - - 129 - parent: 143 -- id: 143 + - 130 + parent: 144 +- id: 144 kind: 'TransformCall: Select' span: 1:119-246 children: - - 128 - - 142 - parent: 145 -- id: 145 + - 129 + - 143 + parent: 146 +- id: 146 kind: 'TransformCall: Take' span: 1:247-254 children: - - 143 - - 146 -- id: 146 + - 144 + - 147 +- id: 147 kind: Literal - parent: 145 + parent: 146 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__take.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__take.snap index 3155ca37ba1b..b5d9c38b15f9 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__take.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__take.snap @@ -7,10 +7,10 @@ frames: - - 1:25-41 - columns: - !All - input_id: 121 + input_id: 122 except: [] inputs: - - id: 121 + - id: 122 name: tracks table: - default_db @@ -18,23 +18,23 @@ frames: - - 1:42-51 - columns: - !All - input_id: 121 + input_id: 122 except: [] inputs: - - id: 121 + - id: 122 name: tracks table: - default_db - tracks nodes: -- id: 121 +- id: 122 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 125 -- id: 123 + parent: 126 +- id: 124 kind: Ident span: 1:31-40 ident: !Ident @@ -42,32 +42,32 @@ nodes: - tracks - track_id targets: - - 121 - parent: 125 -- id: 125 + - 122 + parent: 126 +- id: 126 kind: 'TransformCall: Sort' span: 1:25-41 children: - - 121 - - 123 - parent: 129 -- id: 126 + - 122 + - 124 + parent: 130 +- id: 127 kind: Literal span: 1:47-48 alias: start - parent: 129 -- id: 127 + parent: 130 +- id: 128 kind: Literal span: 1:50-51 alias: end - parent: 129 -- id: 129 + parent: 130 +- id: 130 kind: 'TransformCall: Take' span: 1:42-51 children: - - 125 - 126 - 127 + - 128 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap index d9a041d7f748..6dcf8ee3fde0 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap @@ -10,55 +10,55 @@ frames: name: - albums - title - target_id: 126 + target_id: 127 target_name: null - !Single name: - title_and_spaces - target_id: 127 + target_id: 128 target_name: null - !Single name: - low - target_id: 129 + target_id: 130 target_name: null - !Single name: - up - target_id: 132 + target_id: 133 target_name: null - !Single name: - ltrimmed - target_id: 135 + target_id: 136 target_name: null - !Single name: - rtrimmed - target_id: 138 + target_id: 139 target_name: null - !Single name: - trimmed - target_id: 141 + target_id: 142 target_name: null - !Single name: - len - target_id: 144 + target_id: 145 target_name: null - !Single name: - subs - target_id: 147 + target_id: 148 target_name: null - !Single name: - replace - target_id: 153 + target_id: 154 target_name: null inputs: - - id: 124 + - id: 125 name: albums table: - default_db @@ -69,55 +69,55 @@ frames: name: - albums - title - target_id: 126 + target_id: 127 target_name: null - !Single name: - title_and_spaces - target_id: 127 + target_id: 128 target_name: null - !Single name: - low - target_id: 129 + target_id: 130 target_name: null - !Single name: - up - target_id: 132 + target_id: 133 target_name: null - !Single name: - ltrimmed - target_id: 135 + target_id: 136 target_name: null - !Single name: - rtrimmed - target_id: 138 + target_id: 139 target_name: null - !Single name: - trimmed - target_id: 141 + target_id: 142 target_name: null - !Single name: - len - target_id: 144 + target_id: 145 target_name: null - !Single name: - subs - target_id: 147 + target_id: 148 target_name: null - !Single name: - replace - target_id: 153 + target_id: 154 target_name: null inputs: - - id: 124 + - id: 125 name: albums table: - default_db @@ -128,68 +128,68 @@ frames: name: - albums - title - target_id: 126 + target_id: 127 target_name: null - !Single name: - title_and_spaces - target_id: 127 + target_id: 128 target_name: null - !Single name: - low - target_id: 129 + target_id: 130 target_name: null - !Single name: - up - target_id: 132 + target_id: 133 target_name: null - !Single name: - ltrimmed - target_id: 135 + target_id: 136 target_name: null - !Single name: - rtrimmed - target_id: 138 + target_id: 139 target_name: null - !Single name: - trimmed - target_id: 141 + target_id: 142 target_name: null - !Single name: - len - target_id: 144 + target_id: 145 target_name: null - !Single name: - subs - target_id: 147 + target_id: 148 target_name: null - !Single name: - replace - target_id: 153 + target_id: 154 target_name: null inputs: - - id: 124 + - id: 125 name: albums table: - default_db - albums nodes: -- id: 124 +- id: 125 kind: Ident span: 1:115-126 ident: !Ident - default_db - albums - parent: 160 -- id: 126 + parent: 161 +- id: 127 kind: Ident span: 1:140-145 ident: !Ident @@ -197,16 +197,16 @@ nodes: - albums - title targets: - - 124 - parent: 159 -- id: 127 + - 125 + parent: 160 +- id: 128 kind: FString span: 1:170-184 alias: title_and_spaces targets: - - 128 - parent: 159 -- id: 128 + - 129 + parent: 160 +- id: 129 kind: Ident span: 1:175-180 ident: !Ident @@ -214,15 +214,15 @@ nodes: - albums - title targets: - - 124 -- id: 129 + - 125 +- id: 130 kind: RqOperator span: 1:205-215 alias: low targets: - - 131 - parent: 159 -- id: 131 + - 132 + parent: 160 +- id: 132 kind: Ident span: 1:197-202 ident: !Ident @@ -230,15 +230,15 @@ nodes: - albums - title targets: - - 124 -- id: 132 + - 125 +- id: 133 kind: RqOperator span: 1:236-246 alias: up targets: - - 134 - parent: 159 -- id: 134 + - 135 + parent: 160 +- id: 135 kind: Ident span: 1:228-233 ident: !Ident @@ -246,15 +246,15 @@ nodes: - albums - title targets: - - 124 -- id: 135 + - 125 +- id: 136 kind: RqOperator span: 1:273-283 alias: ltrimmed targets: - - 137 - parent: 159 -- id: 137 + - 138 + parent: 160 +- id: 138 kind: Ident span: 1:265-270 ident: !Ident @@ -262,15 +262,15 @@ nodes: - albums - title targets: - - 124 -- id: 138 + - 125 +- id: 139 kind: RqOperator span: 1:310-320 alias: rtrimmed targets: - - 140 - parent: 159 -- id: 140 + - 141 + parent: 160 +- id: 141 kind: Ident span: 1:302-307 ident: !Ident @@ -278,15 +278,15 @@ nodes: - albums - title targets: - - 124 -- id: 141 + - 125 +- id: 142 kind: RqOperator span: 1:346-355 alias: trimmed targets: - - 143 - parent: 159 -- id: 143 + - 144 + parent: 160 +- id: 144 kind: Ident span: 1:338-343 ident: !Ident @@ -294,15 +294,15 @@ nodes: - albums - title targets: - - 124 -- id: 144 + - 125 +- id: 145 kind: RqOperator span: 1:377-388 alias: len targets: - - 146 - parent: 159 -- id: 146 + - 147 + parent: 160 +- id: 147 kind: Ident span: 1:369-374 ident: !Ident @@ -310,23 +310,23 @@ nodes: - albums - title targets: - - 124 -- id: 147 + - 125 +- id: 148 kind: RqOperator span: 1:411-427 alias: subs targets: - - 150 - 151 - 152 - parent: 159 -- id: 150 + - 153 + parent: 160 +- id: 151 kind: Literal span: 1:424-425 -- id: 151 +- id: 152 kind: Literal span: 1:426-427 -- id: 152 +- id: 153 kind: Ident span: 1:403-408 ident: !Ident @@ -334,23 +334,23 @@ nodes: - albums - title targets: - - 124 -- id: 153 + - 125 +- id: 154 kind: RqOperator span: 1:453-477 alias: replace targets: - - 156 - 157 - 158 - parent: 159 -- id: 156 + - 159 + parent: 160 +- id: 157 kind: Literal span: 1:466-470 -- id: 157 +- id: 158 kind: Literal span: 1:471-477 -- id: 158 +- id: 159 kind: Ident span: 1:445-450 ident: !Ident @@ -358,30 +358,30 @@ nodes: - albums - title targets: - - 124 -- id: 159 + - 125 +- id: 160 kind: Tuple span: 1:134-481 children: - - 126 - 127 - - 129 - - 132 - - 135 - - 138 - - 141 - - 144 - - 147 - - 153 - parent: 160 -- id: 160 + - 128 + - 130 + - 133 + - 136 + - 139 + - 142 + - 145 + - 148 + - 154 + parent: 161 +- id: 161 kind: 'TransformCall: Select' span: 1:127-481 children: - - 124 - - 159 - parent: 163 -- id: 161 + - 125 + - 160 + parent: 164 +- id: 162 kind: Ident span: 1:488-493 ident: !Ident @@ -389,38 +389,38 @@ nodes: - albums - title targets: - - 126 - parent: 163 -- id: 163 + - 127 + parent: 164 +- id: 164 kind: 'TransformCall: Sort' span: 1:482-494 children: - - 160 - 161 - parent: 183 -- id: 164 + - 162 + parent: 184 +- id: 165 kind: RqOperator span: 1:502-606 targets: - - 166 - - 178 - parent: 183 -- id: 166 + - 167 + - 179 + parent: 184 +- id: 167 kind: RqOperator span: 1:502-573 targets: - - 168 - - 173 -- id: 168 + - 169 + - 174 +- id: 169 kind: RqOperator span: 1:511-535 targets: - - 171 - 172 -- id: 171 + - 173 +- id: 172 kind: Literal span: 1:528-535 -- id: 172 +- id: 173 kind: Ident span: 1:503-508 ident: !Ident @@ -428,17 +428,17 @@ nodes: - albums - title targets: - - 126 -- id: 173 + - 127 +- id: 174 kind: RqOperator span: 1:549-572 targets: - - 176 - 177 -- id: 176 + - 178 +- id: 177 kind: Literal span: 1:563-572 -- id: 177 +- id: 178 kind: Ident span: 1:541-546 ident: !Ident @@ -446,17 +446,17 @@ nodes: - albums - title targets: - - 126 -- id: 178 + - 127 +- id: 179 kind: RqOperator span: 1:586-605 targets: - - 181 - 182 -- id: 181 + - 183 +- id: 182 kind: Literal span: 1:601-605 -- id: 182 +- id: 183 kind: Ident span: 1:578-583 ident: !Ident @@ -464,13 +464,13 @@ nodes: - albums - title targets: - - 126 -- id: 183 + - 127 +- id: 184 kind: 'TransformCall: Filter' span: 1:495-606 children: - - 163 - 164 + - 165 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__window.snap b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__window.snap index fe50146de194..0727cfdc4f5c 100644 --- a/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__window.snap +++ b/prqlc/prqlc/tests/integration/snapshots/integration__queries__debug_lineage__window.snap @@ -7,26 +7,26 @@ frames: - - 1:521-614 - columns: - !All - input_id: 127 + input_id: 128 except: - genre_id - !Single name: - num - target_id: 165 + target_id: 166 target_name: null - !Single name: - total - target_id: 173 + target_id: 174 target_name: null - !Single name: - last_val - target_id: 175 + target_id: 176 target_name: null inputs: - - id: 127 + - id: 128 name: tracks table: - default_db @@ -37,29 +37,29 @@ frames: name: - tracks - genre_id - target_id: 129 + target_id: 130 target_name: null - !All - input_id: 127 + input_id: 128 except: - genre_id - !Single name: - num - target_id: 165 + target_id: 166 target_name: null - !Single name: - total - target_id: 173 + target_id: 174 target_name: null - !Single name: - last_val - target_id: 175 + target_id: 176 target_name: null inputs: - - id: 127 + - id: 128 name: tracks table: - default_db @@ -70,29 +70,29 @@ frames: name: - tracks - genre_id - target_id: 129 + target_id: 130 target_name: null - !All - input_id: 127 + input_id: 128 except: - genre_id - !Single name: - num - target_id: 165 + target_id: 166 target_name: null - !Single name: - total - target_id: 173 + target_id: 174 target_name: null - !Single name: - last_val - target_id: 175 + target_id: 176 target_name: null inputs: - - id: 127 + - id: 128 name: tracks table: - default_db @@ -103,31 +103,31 @@ frames: name: - tracks - track_id - target_id: 189 + target_id: 190 target_name: null - !Single name: - tracks - genre_id - target_id: 190 + target_id: 191 target_name: null - !Single name: - num - target_id: 191 + target_id: 192 target_name: null - !Single name: - total - target_id: 192 + target_id: 193 target_name: null - !Single name: - last_val - target_id: 193 + target_id: 194 target_name: null inputs: - - id: 127 + - id: 128 name: tracks table: - default_db @@ -138,44 +138,44 @@ frames: name: - tracks - track_id - target_id: 189 + target_id: 190 target_name: null - !Single name: - tracks - genre_id - target_id: 190 + target_id: 191 target_name: null - !Single name: - num - target_id: 191 + target_id: 192 target_name: null - !Single name: - total - target_id: 192 + target_id: 193 target_name: null - !Single name: - last_val - target_id: 193 + target_id: 194 target_name: null inputs: - - id: 127 + - id: 128 name: tracks table: - default_db - tracks nodes: -- id: 127 +- id: 128 kind: Ident span: 1:470-481 ident: !Ident - default_db - tracks - parent: 179 -- id: 129 + parent: 180 +- id: 130 kind: Ident span: 1:488-496 ident: !Ident @@ -183,14 +183,14 @@ nodes: - tracks - genre_id targets: - - 127 - parent: 138 -- id: 138 + - 128 + parent: 139 +- id: 139 kind: Tuple span: 1:488-496 children: - - 129 -- id: 157 + - 130 +- id: 158 kind: Ident span: 1:506-518 ident: !Ident @@ -198,33 +198,33 @@ nodes: - tracks - milliseconds targets: - - 127 -- id: 165 + - 128 +- id: 166 kind: RqOperator span: 1:540-555 alias: num targets: - - 166 - parent: 178 -- id: 166 + - 167 + parent: 179 +- id: 167 kind: Literal -- id: 173 +- id: 174 kind: RqOperator span: 1:569-579 alias: total targets: - - 174 - parent: 178 -- id: 174 - kind: Literal + - 175 + parent: 179 - id: 175 + kind: Literal +- id: 176 kind: RqOperator span: 1:596-609 alias: last_val targets: - - 177 - parent: 178 -- id: 177 + - 178 + parent: 179 +- id: 178 kind: Ident span: 1:601-609 ident: !Ident @@ -232,33 +232,33 @@ nodes: - tracks - track_id targets: - - 127 -- id: 178 + - 128 +- id: 179 kind: Tuple span: 1:528-614 children: - - 165 - - 173 - - 175 - parent: 179 -- id: 179 + - 166 + - 174 + - 176 + parent: 180 +- id: 180 kind: 'TransformCall: Derive' span: 1:521-614 children: - - 127 - - 178 - parent: 181 -- id: 181 + - 128 + - 179 + parent: 182 +- id: 182 kind: 'TransformCall: Take' span: 1:617-624 children: - - 179 - - 182 - parent: 188 -- id: 182 + - 180 + - 183 + parent: 189 +- id: 183 kind: Literal - parent: 181 -- id: 185 + parent: 182 +- id: 186 kind: Ident span: 1:633-641 ident: !Ident @@ -266,9 +266,9 @@ nodes: - tracks - genre_id targets: - - 129 - parent: 188 -- id: 186 + - 130 + parent: 189 +- id: 187 kind: Ident span: 1:643-655 ident: !Ident @@ -276,17 +276,17 @@ nodes: - tracks - milliseconds targets: - - 127 - parent: 188 -- id: 188 + - 128 + parent: 189 +- id: 189 kind: 'TransformCall: Sort' span: 1:627-656 children: - - 181 - - 185 + - 182 - 186 - parent: 195 -- id: 189 + - 187 + parent: 196 +- id: 190 kind: Ident span: 1:665-673 ident: !Ident @@ -294,9 +294,9 @@ nodes: - tracks - track_id targets: - - 127 - parent: 194 -- id: 190 + - 128 + parent: 195 +- id: 191 kind: Ident span: 1:675-683 ident: !Ident @@ -304,60 +304,60 @@ nodes: - tracks - genre_id targets: - - 129 - parent: 194 -- id: 191 + - 130 + parent: 195 +- id: 192 kind: Ident span: 1:685-688 ident: !Ident - this - num targets: - - 165 - parent: 194 -- id: 192 + - 166 + parent: 195 +- id: 193 kind: Ident span: 1:690-695 ident: !Ident - this - total targets: - - 173 - parent: 194 -- id: 193 + - 174 + parent: 195 +- id: 194 kind: Ident span: 1:697-705 ident: !Ident - this - last_val targets: - - 175 - parent: 194 -- id: 194 + - 176 + parent: 195 +- id: 195 kind: Tuple span: 1:664-706 children: - - 189 - 190 - 191 - 192 - 193 - parent: 195 -- id: 195 + - 194 + parent: 196 +- id: 196 kind: 'TransformCall: Select' span: 1:657-706 children: - - 188 - - 194 - parent: 200 -- id: 196 + - 189 + - 195 + parent: 201 +- id: 197 kind: RqOperator span: 1:714-728 targets: - - 198 - 199 - parent: 200 -- id: 198 + - 200 + parent: 201 +- id: 199 kind: Ident span: 1:714-722 ident: !Ident @@ -365,16 +365,16 @@ nodes: - tracks - genre_id targets: - - 190 -- id: 199 + - 191 +- id: 200 kind: Literal span: 1:726-728 -- id: 200 +- id: 201 kind: 'TransformCall: Filter' span: 1:707-728 children: - - 195 - 196 + - 197 ast: name: Project stmts: diff --git a/prqlc/prqlc/tests/integration/sql.rs b/prqlc/prqlc/tests/integration/sql.rs index 462e988d0026..1396bb6290c0 100644 --- a/prqlc/prqlc/tests/integration/sql.rs +++ b/prqlc/prqlc/tests/integration/sql.rs @@ -381,6 +381,27 @@ fn date_trunc_unsupported_dialects() { .is_err()); } +#[test] +fn date_floor_unsupported_dialects() { + assert!(compile_with_sql_dialect( + "from events | select (event_time | date.floor 15 minute)", + sql::Dialect::SQLite + ) + .is_err()); + + assert!(compile_with_sql_dialect( + "from events | select (event_time | date.floor 15 minute)", + sql::Dialect::MySql + ) + .is_err()); + + assert!(compile_with_sql_dialect( + "from events | select (event_time | date.floor 15 minute)", + sql::Dialect::MsSql + ) + .is_err()); +} + #[test] fn date_to_text_bigquery_rfc3339() { assert_snapshot!(compile(r#" @@ -428,6 +449,32 @@ FROM ) } +#[rstest] +#[case::clickhouse( + sql::Dialect::ClickHouse, + "SELECT\n toStartOfInterval(event_time, INTERVAL 15 minute)\nFROM\n events\n" +)] +#[case::duckdb( + sql::Dialect::DuckDb, + "SELECT\n time_bucket(INTERVAL '15 minute', event_time)\nFROM\n events\n" +)] +#[case::postgres( + sql::Dialect::Postgres, + "SELECT\n date_bin(\n '15 minute',\n event_time,\n TIMESTAMP '1970-01-01 00:00:00'\n )\nFROM\n events\n" +)] +#[case::bigquery( + sql::Dialect::BigQuery, + "SELECT\n TIMESTAMP_BUCKET(\n CAST(event_time AS TIMESTAMP),\n INTERVAL 15 minute\n )\nFROM\n events\n" +)] +fn date_floor_operator(#[case] dialect: sql::Dialect, #[case] expected_sql: &'static str) { + let query = "from events | select (event_time | date.floor 15 minute)"; + + assert_eq!( + compile_with_sql_dialect(query, dialect).unwrap(), + expected_sql + ) +} + #[test] fn json_of_test() { let pl = prqlc::prql_to_pl("from employees | take 10").unwrap(); @@ -6004,13 +6051,13 @@ fn test_select_this() { select this "###, ) - .unwrap(), @r###" + .unwrap(), @" SELECT a, b FROM x - "###); + "); } #[test] @@ -6022,13 +6069,13 @@ fn test_select_this_wildcard() { select this.* "###, ) - .unwrap(), @r###" + .unwrap(), @" SELECT a, b FROM x - "###); + "); } #[test] @@ -6040,7 +6087,7 @@ fn test_sort_this_wildcard() { sort this.* "###, ) - .unwrap(), @r###" + .unwrap(), @" SELECT a, b @@ -6049,7 +6096,7 @@ fn test_sort_this_wildcard() { ORDER BY a, b - "###); + "); } #[test] @@ -6245,14 +6292,14 @@ select { "###, ) .unwrap(), @" -SELECT - 4 + 1 + 2 + 3 AS with_initial, - 4 + 3 AS with_initial_one, - 4 AS with_initial_zero, - 1 + 2 + 3 AS no_initial, - 3 AS no_initial_one -FROM - foo + SELECT + 4 + 1 + 2 + 3 AS with_initial, + 4 + 3 AS with_initial_one, + 4 AS with_initial_zero, + 1 + 2 + 3 AS no_initial, + 3 AS no_initial_one + FROM + foo "); } @@ -6265,7 +6312,7 @@ select { no_initial_err = tuple_reduce add {} } "###, - ).unwrap_err(), @r###" + ).unwrap_err(), @" Error: ╭─[ :4:37 ] │ @@ -6275,7 +6322,7 @@ select { │ │ Help: try adding an initial: parameter ───╯ - "###); + "); } #[test] diff --git a/web/book/src/lib.rs b/web/book/src/lib.rs index 53293e15ac8a..2b4c23effa4a 100644 --- a/web/book/src/lib.rs +++ b/web/book/src/lib.rs @@ -320,13 +320,14 @@ fn test_admonition() -> Result<()> { > This is a warning. "#; - assert_snapshot!(replace_examples(md)?, @r#" + assert_snapshot!(replace_examples(md)?, @" + > [!NOTE] > This is a note. > [!WARNING] > This is a warning. - "#); + "); Ok(()) } diff --git a/web/book/src/reference/stdlib/date.md b/web/book/src/reference/stdlib/date.md index a41c31634853..5618c0473c4b 100644 --- a/web/book/src/reference/stdlib/date.md +++ b/web/book/src/reference/stdlib/date.md @@ -74,6 +74,36 @@ select (event_time | date.trunc "day") ``` +### `floor` + +Truncates a timestamp to the start of a fixed interval. + + +> [!NOTE] +> Since support and SQL syntax differs by database, PRQL +> **requires an explicit dialect** to be specified. + + +> [!NOTE] +> For now the supported DBs are: BigQuery, ClickHouse, DuckDB and Postgres. + +```prql +prql target:sql.postgres + +from events +select (event_time | date.floor 15 minute) + +``` + +The SQL output varies by dialect: + +| Dialect | SQL output | +| ---------- | --------------------------------------------------------------------- | +| BigQuery | `TIMESTAMP_BUCKET(CAST(event_time AS TIMESTAMP), INTERVAL 15 minute)` | +| ClickHouse | `toStartOfInterval(event_time, INTERVAL 15 minute)` | +| DuckDB | `time_bucket(INTERVAL '15 minute', event_time)` | +| Postgres | `date_bin('15 minute', event_time, TIMESTAMP '1970-01-01 00:00:00')` | + ### Date & time format specifiers PRQL specifiers for date and time formatting is a subset of specifiers used by diff --git a/web/book/tests/documentation/snapshots/documentation__book__project__target__version__0.snap b/web/book/tests/documentation/snapshots/documentation__book__project__target__version__0.snap index af4e4240f4d2..3043ebd21e77 100644 --- a/web/book/tests/documentation/snapshots/documentation__book__project__target__version__0.snap +++ b/web/book/tests/documentation/snapshots/documentation__book__project__target__version__0.snap @@ -1,6 +1,6 @@ --- source: web/book/tests/documentation/book.rs -expression: "prql version:\"0.13.4\"\n\nfrom employees\n" +expression: "prql version:\"0.13.12\"\n\nfrom employees\n" --- SELECT * diff --git a/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__4.snap b/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__4.snap index b44502013b30..fa6309c5a01b 100644 --- a/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__4.snap +++ b/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__4.snap @@ -1,6 +1,5 @@ --- source: web/book/tests/documentation/book.rs -assertion_line: 75 expression: "prql target:sql.postgres\n\nfrom events\nselect (event_time | date.trunc \"day\")\n\n" --- SELECT diff --git a/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__5.snap b/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__5.snap new file mode 100644 index 000000000000..e4ca609601a2 --- /dev/null +++ b/web/book/tests/documentation/snapshots/documentation__book__reference__stdlib__date__date-functions__5.snap @@ -0,0 +1,12 @@ +--- +source: web/book/tests/documentation/book.rs +expression: "prql target:sql.postgres\n\nfrom events\nselect (event_time | date.floor 15 minute)\n\n" +--- +SELECT + date_bin( + '15 minute', + event_time, + TIMESTAMP '1970-01-01 00:00:00' + ) +FROM + events diff --git a/web/book/tests/documentation/snapshots/documentation__book__reference__syntax__pipes__ceci-nest-pas-une-pipe__0.snap b/web/book/tests/documentation/snapshots/documentation__book__reference__syntax__pipes__ceci-nest-pas-une-pipe__0.snap index ee6c6801b795..1764309f9281 100644 --- a/web/book/tests/documentation/snapshots/documentation__book__reference__syntax__pipes__ceci-nest-pas-une-pipe__0.snap +++ b/web/book/tests/documentation/snapshots/documentation__book__reference__syntax__pipes__ceci-nest-pas-une-pipe__0.snap @@ -1,6 +1,6 @@ --- source: web/book/tests/documentation/book.rs -expression: "[\n {a=2} # No pipe from line break before & after this list item\n]\nderive {\n c = 2 * a, # No pipe from line break before & after this tuple item\n}\n" +expression: "[\n {a=2} # No pipe from line break before & after this array item\n]\nderive {\n c = 2 * a, # No pipe from line break before & after this tuple item\n}\n" --- WITH table_0 AS ( SELECT