Skip to content

[BUG] Self join doesn't work properly #277

Closed as not planned
Closed as not planned

Description

@Yury-Fridlyand

Describe the bug
Self join doesn't work properly.

To Reproduce

opensearchsql> SELECT c1.`key`, c1.num1, c2.str0 FROM calcs AS c1, calcs AS c2;
fetched rows / total rows = 17/17
+----------+-----------+-----------+
| c1.key   | c1.num1   | c2.str0   |
|----------+-----------+-----------|
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
| null     | null      | null      |
+----------+-----------+-----------+
opensearchsql> SELECT c1.`key`, c1.num1, c1.str0 FROM calcs AS c1;
fetched rows / total rows = 17/17
+-------+--------+-----------------+
| key   | num1   | str0            |
|-------+--------+-----------------|
| key00 | 8.42   | FURNITURE       |
| key01 | 6.71   | FURNITURE       |
| key02 | 9.78   | OFFICE SUPPLIES |
| key03 | 7.43   | OFFICE SUPPLIES |
| key04 | 9.05   | OFFICE SUPPLIES |
| key05 | 9.38   | OFFICE SUPPLIES |
| key06 | 16.42  | OFFICE SUPPLIES |
| key07 | 11.38  | OFFICE SUPPLIES |
| key08 | 9.47   | TECHNOLOGY      |
| key09 | 12.4   | TECHNOLOGY      |
| key10 | 10.32  | TECHNOLOGY      |
| key11 | 2.47   | TECHNOLOGY      |
| key12 | 12.05  | TECHNOLOGY      |
| key13 | 10.37  | TECHNOLOGY      |
| key14 | 7.1    | TECHNOLOGY      |
| key15 | 16.81  | TECHNOLOGY      |
| key16 | 7.12   | TECHNOLOGY      |
+-------+--------+-----------------+

Expected behavior
First query should yield the same result as the second one.

Activity

  1. added
    bug
    on Nov 9, 2021
  2. chloe-zh commented on Nov 11, 2021

    @chloe-zh
    Contributor

    @Yury-Fridlyand Thanks for reporting this issue, currently our syntax does not support self join yet. Will investigate and plan it if the support is necessary. Thanks!

  3. added
    enhancement
    and removed
    bug
    on Nov 11, 2021
  4. added
    tdvt
    on Nov 24, 2021
  5. added a commit that references this issue on Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLenhancementtdvt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions