Skip to content

[SQL] Rust compilation errors #5899

@wilmaontherun

Description

@wilmaontherun

Bug report: group-by_050

 ### Spark SQL

 **Schema**

 _empty_

 **Query**

 ```sql
 CREATE VIEW group-by_050 AS
 SELECT count(*)
 FROM VALUES (named_struct('b', array(map(1, 2, 2, 3), map(1, 3)))), (named_struct('b', array(map(2, 3), map(1, 3)))), (named_struct('b', array(map(2, 3, 1, 2), map(1, 3)))) as t(a)
 GROUP BY a;
 ```

 **Expected result**

 ```
 2
 1
 ```

 ### Feldera SQL (translated)

 **Schema**

 _empty_

 **Query**

 ```sql
 CREATE VIEW "group-by_050" AS
 SELECT COUNT(*)
 FROM (
   VALUES
     (CAST(ROW(ARRAY[MAP[1, 2, 2, 3], MAP[1, 3]]) AS ROW(b MAP<INT, INT> ARRAY))),
     (CAST(ROW(ARRAY[MAP[2, 3], MAP[1, 3]]) AS ROW(b MAP<INT, INT> ARRAY))),
     (CAST(ROW(ARRAY[MAP[2, 3, 1, 2], MAP[1, 3]]) AS ROW(b MAP<INT, INT> ARRAY)))
 ) AS t(a)
 GROUP BY a
 ```

 ### Status

 | Phase | Status |
 |---|---|
 | Translation | `success` |
 | Compilation | `ok` |
 | Execution   | `error` |
 | Match       | `False` |

 **Detail:** row count mismatch: feldera=0 spark=2

 ### Error

 ```
 The program failed to compile: RustError
 Rust Error: {'exit_code': 101, 'stdout': '', 'stderr': "warning: dbsp_adapters@0.266.0: not within a suitable 'git' worktree!
 warning: dbsp_adapters@0.266.0: VERGEN_GIT_SHA set to default
 warning: dbsp_adapters@0.266.0: VERGEN_GIT_DIRTY set to default
    Compiling feldera_pipe_operator_dd4fc6c2c5b9ed86 v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_dd4fc6c2c5b9ed86)
    Compiling feldera_pipe_operator_cda923815e78070b v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_cda923815e78070b)
    Compiling feldera_pipe_operator_bd537152fbfe8610 v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_bd537152fbfe8610)
    Compiling feldera_pipe_operator_25183f7abe968481 v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_25183f7abe968481)
    Compiling feldera_pipe_operator_0269bb98f62f16e9 v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_0269bb98f62f16e9)
    Compiling feldera_pipe_operator_a174b404f07c6517 v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_a174b404f07c6517)
    Compiling feldera_pipe_operator_fa18e0b2b218b26b v0.1.0 (/home/ubuntu/.feldera/compiler/rust-compilation/crates/feldera_pipe_operator_fa18e0b2b218b26b)
 error[E0507]: cannot move out of `*p1` which is behind a shared reference
   --> crates/feldera_pipe_operator_cda923815e78070b/src/lib.rs:80:17
    |
 80 |                 (*p1), (
    |                 ^^^^^ move occurs because `*p1` has type `Arc<BTreeMap<i32, i32>>`, which does not implement the `Copy` trait

 error[E0507]: cannot move out of `*p1` which is behind a shared reference
   --> crates/feldera_pipe_operator_0269bb98f62f16e9/src/lib.rs:80:17
    |
 80 |                 (*p1), (
    |                 ^^^^^ move occurs because `*p1` has type `Arc<BTreeMap<i32, i32>>`, which does not implement the `Copy` trait

 error[E0507]: cannot move out of `*p1` which is behind a shared reference
   --> crates/feldera_pipe_operator_dd4fc6c2c5b9ed86/src/lib.rs:79:17
    |
 79 |                 (*p1), (
    |                 ^^^^^ move occurs because `*p1` has type `Arc<BTreeMap<i32, i32>>`, which does not implement the `Copy` trait

 For more information about this error, try `rustc --explain E0507`.
 error: could not compile `feldera_pipe_operator_cda923815e78070b` (lib) due to 1 previous error
 warning: build failed, waiting for other jobs to finish...
 error: could not compile `feldera_pipe_operator_dd4fc6c2c5b9ed86` (lib) due to 1 previous error
 error: could not compile `feldera_pipe_operator_0269bb98f62f16e9` (lib) due to 1 previous error
 "}

 ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions