Skip to content

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

@Yury-Fridlyand

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLenhancementNew feature or requesttdvtTableau test framework

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions