Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Treat multiple tables separated by comma as COMMA JOIN (CROSS JOIN) #221

Open
abbashus opened this issue Oct 17, 2019 · 0 comments
Open
Labels
enhancement New feature or request SQL

Comments

@abbashus
Copy link
Contributor

Right now queries such as SELECT firstname, lastname FROM table1, table2 WHERE lastname = 'ABC' are treated a single query applied on multiple tables instead of Cross Join which the user would expect as per SQL standard.

--- Current behavior ---

/table1,table2/_search?
{
  "from" : 0,
  "size" : 200,
  "query" : {
    "bool" : {
      "filter" : [
        {
          "bool" : {
            "must" : [
              {
                "term" : {
                  "firstname" : {
                    "value" : "ABC",
                    "boost" : 1.0
                  }
                }
              }
            ],
            "adjust_pure_negative" : true,
            "boost" : 1.0
          }
        }
      ],
      "adjust_pure_negative" : true,
      "boost" : 1.0
    }
  },
  "_source" : {
    "includes" : [
      "firstname",
      "lastname"
    ],
    "excludes" : [ ]
  }
}

Either we should treat and implement it as Cross Join (Comma Join) or should throw 4XX exception when multiple tables are passed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request SQL
Projects
None yet
Development

No branches or pull requests

2 participants