Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LATERAL rewrites treat integers as booleans #77

Open
lordpretzel opened this issue Jun 12, 2021 · 0 comments
Open

LATERAL rewrites treat integers as booleans #77

lordpretzel opened this issue Jun 12, 2021 · 0 comments
Labels

Comments

@lordpretzel
Copy link
Collaborator

The LATERAL rewrites in lateral_prov_main.c use integers instead of booleans, but then treat these integers as booleans in selection conditions, e.g.,

Projection [a ] (a: DT_INT) [0x7fec08c0a07b]()
  Selection [nesting_eval_1] (a: DT_INT, b: DT_INT, nesting_eval_1: DT_BOOL) [0x7fec08c09e46](0x7fec08c0a07b)    NestingOperator[EXISTS] [] (a: DT_INT, b: DT_INT, nesting_eval_1: DT_BOOL) [0x7fec08c09c85](0x7fec08c09e4      TableAccess [r] (a: DT_INT, b: DT_INT) [0x7fec08c09184](0x7fec08c09c85)
      Projection [b ] (b: DT_INT) [0x7fec08c09504](0x7fec08c09c85)
        TableAccess [s] (c: DT_INT, d: DT_INT) [0x7fec08c09302](0x7fec08c09504)

is translated into

Projection [a ] (a: DT_INT) [0x7fec08a08268]()
  Selection [nesting_eval_1] (a: DT_INT, b: DT_INT, nesting_eval_1: DT_INT) [0x7fec08a08585](0x7fec08a08268)
    NestingOperator[LATERAL] [] (a: DT_INT, b: DT_INT, nesting_eval_1: DT_INT) [0x7fec08a086af](0x7fec08a0858      TableAccess [r] (a: DT_INT, b: DT_INT) [0x7fec08a087e2](0x7fec08a086af)
      Projection [(CASE  WHEN (AGGR_0 > 0) THEN 1 ELSE 0 END) ] (nesting_eval_1: DT_INT) [0x7fec08a0a22e](0x7        Aggregation [(COUNT(1))] (AGGR_0: DT_STRING) [0x7fec08a09af4](0x7fec08a0a22e)
          Projection [b ] (b: DT_INT) [0x7fec08a08932](0x7fec08a09af4)
            TableAccess [s] (c: DT_INT, d: DT_INT) [0x7fec08a08a0f](0x7fec08a08932)

We need to either change the rewrites to rewrite conditions into nesting_eval_xxx = 1 or use booleans instead (and for the Oracle serializer call the method the translates booleans in places where they are not allowed into comparisons).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant