Repository navigation
Closed as not planned
Labels
Description
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
chloe-zh commentedon Nov 11, 2021
@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!
Add _routing to SQL includes list (#277) (#1771)
Add _routing to SQL includes list (#277) (#1771)
Add _routing to SQL includes list (#277) (#1771) (#1831)
Add _routing to SQL includes list (#277) (#1771)
Add _routing to SQL includes list (#277) (#1771) (#1843)