You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ./bin/partiql --typing-mode=PERMISSIVE --environment ../fdb_rl.env
Welcome to the PartiQL shell!
Typing mode: PERMISSIVE
Using version: 0.14.4-6634bc04
PartiQL> SELECT VALUE
| { 'repeat_me': (
| SELECT VALUE fdb_rl_value
| FROM repeat_me.fdb_rl_value AS x AT i ORDER BY i )
| }
| FROM record AS r, r.fdb_rl_value.repeat_me AS repeat_me
|
==='
<<
{
'repeat_me': [
'Boxes',
'Bowls'
]
}
>>
---
OK!
PartiQL>
However, when I attempt to run the same query in Rust, it fails with the following error.
$ cargo test --lib -- --nocapture
Compiling failing-test v0.1.0 (/home/rajiv/temp-partiql/repro/failing-test)
Finished `test` profile [unoptimized + debuginfo] target(s) in 2.91s
Running unittests src/lib.rs (target/debug/deps/failing_test-01f57f1dbe588fee)
running 1 test
thread 'tests::failing' panicked at src/lib.rs:78:64:
called `Result::unwrap()` on an `Err` value: AstTransformationError { errors: [IllegalState("env.len() is not even")] }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test tests::failing ... FAILED
failures:
failures:
tests::failing
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
Below is the code for the failing test.
#[cfg(test)]mod tests {use partiql_catalog::PartiqlCatalog;use partiql_eval::env::basic::MapBindings;use partiql_logical_planner::LogicalPlanner;use partiql_parser::Parser;use partiql_value::{list, tuple,Value};#[test]fnfailing(){// Generated from//// ```proto// message TestScalarFieldAccess {// optional string field = 1;// repeated string repeat_me = 2;// optional bytes bytes_field = 3;// optional fdb_rl.field.v1.UUID uuid_field = 4;// }// ```//// ```rust// let test_scalar_field_access = TestScalarFieldAccess {// field: Some("Plants".to_string()),// repeat_me: vec!["Boxes".to_string(), "Bowls".to_string()],// bytes_field: None,// uuid_field: None,// };// ```let partiql_value = Value::from(tuple![("fdb_rl_type", "message_TestScalarFieldAccess"),
("fdb_rl_value",
tuple![("field",
tuple![("fdb_rl_type", "string"), ("fdb_rl_value", "Plants"),]),
("repeat_me",
tuple![("fdb_rl_type", "repeated_string"),
("fdb_rl_value",
list![
tuple![("fdb_rl_type", "string"), ("fdb_rl_value", "Boxes")],
tuple![("fdb_rl_type", "string"), ("fdb_rl_value", "Bowls")],
]),
]),
("bytes_field",
tuple![("fdb_rl_type", "bytes"), ("fdb_rl_value", Value::Null),]),
("uuid_field",
tuple![("fdb_rl_type", "message_fdb_rl.field.v1.UUID"),
("fdb_rl_value", Value::Null),
]),
]),
]);letmut bindings = MapBindings::default();
bindings.insert("record", partiql_value);let catalog = PartiqlCatalog::default();let logical_planner = LogicalPlanner::new(&catalog);let parser = Parser::default();let parsed_ast = parser.parse("SELECT VALUE { 'repeat_me': ( SELECT VALUE fdb_rl_value FROM repeat_me.fdb_rl_value AS x AT i ORDER BY i ) } FROM record AS r, r.fdb_rl_value.repeat_me AS repeat_me").unwrap();let _logical_plan = logical_planner.lower(&parsed_ast).unwrap();}}
The text was updated successfully, but these errors were encountered:
I noticed this issue during the discussion #79.
When I have the following PartiQL enviornment
Using PartiQL CLI, following query works.
However, when I attempt to run the same query in Rust, it fails with the following error.
Below is the code for the failing test.
The text was updated successfully, but these errors were encountered: