Comments (5)
The panic is in the same spot as #4037 but I'm guessing the cause is different. The backtrace shows that the problem starts when lowering the "sorts" that are defined in the pipeline:
32: prql_compiler::semantic::lowering::Lowerer::lower_pipeline::hd5286dcbc239425a
at /Users/kgutwin/github/prql/prqlc/prql-compiler/src/semantic/lowering.rs:491
489 │ vec![]
490 │ },
491 > sort: self.lower_sorts(transform_call.sort)?,
492 │ };
493 │ self.window = Some(window);
I think there's an issue related to the order of the lowering process in lower_pipeline()
somehow. I ran the compiler with RUST_LOG=debug
and got more informative messages:
[ ... snip ... ]
[DEBUG prql_compiler::semantic::lowering] lookup for main pipeline in []
[DEBUG prql_compiler::semantic::lowering] lowering table None, columns = [Single(Some("xyz")), Single(Some("key")), Wildcard]
[DEBUG prql_compiler::semantic::lowering] lowering table None, columns = [Single(Some("key")), Wildcard]
[DEBUG prql_compiler::semantic::lowering] lowering an instance of table default_db.a (id=127)...
[DEBUG prql_compiler::semantic::lowering] ... columns = [(Single(Some("key")), column-0), (Wildcard, column-1)]
[DEBUG prql_compiler::semantic::lowering] lowering ident this.b.xyz (target Some(121))
The application panicked (crashed).
Message: cannot find cid by id=121
Location: prqlc/prql-compiler/src/semantic/lowering.rs:949
So it looks like the table default_db.b
is not lowered before ident this.b.xyz
. I'm not sure why, though. The table is successfully resolved (earlier in the debug log):
[DEBUG prql_compiler::semantic::resolver::expr] resolving ident b...
[DEBUG prql_compiler::semantic::resolver::expr] ... resolved to default_db.b
[DEBUG prql_compiler::semantic::resolver::expr] ... which is TableDecl: [{*..}] LocalTable
[DEBUG prql_compiler::semantic::resolver::inference] instanced table default_db.b as Lineage { columns: [All { input_id: 121, except: {} }], inputs: [LineageInput { id: 121, name: "b", table: Ident { path: ["default_db"], name: "b" } }], prev_columns: [] }
[DEBUG prql_compiler::semantic::resolver::functions] resolved arg to Ident
[DEBUG prql_compiler::semantic::resolver::functions] resolved arg to Ident
[DEBUG prql_compiler::semantic::resolver::expr] resolving ident xyz...
[DEBUG prql_compiler::semantic::resolver::names] inferring xyz to be from table default_db.b
[DEBUG prql_compiler::semantic::resolver::expr] ... resolved to this.b.xyz
[DEBUG prql_compiler::semantic::resolver::expr] ... which is Column (target 121)
from prql.
Thanks for the issue — I think this is a dupe of the issue from #4037...
from prql.
As an aside, I noticed that even without the panic, the
sort
does not translate into anORDER BY
in thefrom_b
CTE.
Right, good spot, the result should have an ORDER BY
.
Assuming this is a duplicate, shall we copy-paste that narrower example into a new issue?
from prql.
Super, thanks for tracking that down
from prql.
FYI this is no longer a panic, instead now points to #3870
from prql.
Related Issues (20)
- Some aggregation functions need ORDER BY clause
- Unexpected result with s-string including UNNEST HOT 1
- Nightly tests failed HOT 1
- Nightly tests failed HOT 1
- RUSTSEC-2024-0336: `rustls::ConnectionCommon::complete_io` could fall into an infinite loop based on network input HOT 1
- Nightly tests failed
- Nightly tests failed
- Nightly tests failed
- Compiler crash on `from_text` with zero rows HOT 4
- unexpected error on non-prql file HOT 1
- Add sampling extension support to PRQL HOT 3
- DISTINCT ON does not ensure columns exist
- [Docker] the 'cargo' binary ... is not applicable to the '1.77.2-aarch64-unknown-linux-gnu' toolchain HOT 3
- Arrow type system as base for the type system HOT 1
- 'std' panics on lowering HOT 2
- Dev Container: can't run playground or book (can run website) HOT 19
- Incorrect Postgres interval syntax HOT 1
- Query optimization: join prunning and "uniqeness" HOT 3
- std.in operator does not support expression on left-hand-side HOT 2
- Named Unions as function parameters HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prql.