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

SQL: extending the grammar #41195

Closed
3 of 4 tasks
astefan opened this issue Apr 15, 2019 · 3 comments
Closed
3 of 4 tasks

SQL: extending the grammar #41195

astefan opened this issue Apr 15, 2019 · 3 comments
Labels
:Analytics/SQL SQL querying >enhancement Team:QL (Deprecated) Meta label for query languages team

Comments

@astefan
Copy link
Contributor

astefan commented Apr 15, 2019

  • at the moment we support FIRST/LAST functions which have an equivalent meaning with MIN/MAX for String fields. We should allow MIN/MAX for strings and delegate to FIRST/LAST functions.
  • TRUNC/TRUNCATE function is available in many RDBs. We support this one in the TRUNCATE form, but Oracle, Postgresql supports the TRUNC variant. We should consider simply adding an alias for the already available TRUNCATE function.
  • ATAN2(param1, param2) should be equivalent to ATAN(param1 / param2) called with two parameters and MySQL allows the ATAN function to receive one or two parameters.
  • maybe consider adding a TRIM(param) function that should be the equivalent of LTRIM(RTRIM(param)).
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@costin
Copy link
Member

costin commented Apr 15, 2019

Adding to the list

  • TOP - as a synonym to LIMIT

matriv added a commit to matriv/elasticsearch that referenced this issue Apr 16, 2019
Although the translation rule was implemented in the `Optimizer`,
the rule was not added in the list of rules to be executed.

Relates to elastic#41195
Follows elastic#37936
matriv added a commit that referenced this issue Apr 16, 2019
Although the translation rule was implemented in the `Optimizer`,
the rule was not added in the list of rules to be executed.

Relates to #41195
Follows #37936
matriv added a commit that referenced this issue Apr 16, 2019
Although the translation rule was implemented in the `Optimizer`,
the rule was not added in the list of rules to be executed.

Relates to #41195
Follows #37936


(cherry picked from commit f426a33)
matriv added a commit that referenced this issue Apr 16, 2019
Although the translation rule was implemented in the `Optimizer`,
the rule was not added in the list of rules to be executed.

Relates to #41195
Follows #37936


(cherry picked from commit f426a33)
matriv added a commit that referenced this issue Apr 16, 2019
Although the translation rule was implemented in the `Optimizer`,
the rule was not added in the list of rules to be executed.

Relates to #41195
Follows #37936


(cherry picked from commit f426a33)
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this issue May 27, 2019
Although the translation rule was implemented in the `Optimizer`,
the rule was not added in the list of rules to be executed.

Relates to elastic#41195
Follows elastic#37936
matriv added a commit to matriv/elasticsearch that referenced this issue Nov 25, 2019
Add TRUNC as alias to already implemented TRUNCATE
numeric function which is the flavour supported by
Oracle and PostgreSQL.

Relates to: elastic#41195
matriv added a commit that referenced this issue Nov 26, 2019
Add TRUNC as alias to already implemented TRUNCATE
numeric function which is the flavour supported by
Oracle and PostgreSQL.

Relates to: #41195
matriv added a commit that referenced this issue Nov 26, 2019
Add TRUNC as alias to already implemented TRUNCATE
numeric function which is the flavour supported by
Oracle and PostgreSQL.

Relates to: #41195

(cherry picked from commit f2aa7f0)
@rjernst rjernst added the Team:QL (Deprecated) Meta label for query languages team label May 4, 2020
matriv added a commit to matriv/elasticsearch that referenced this issue Jun 1, 2020
Add basic support for `TOP X` as a synonym to LIMIT X which is used
by [MS-SQL server](https://docs.microsoft.com/en-us/sql/t-sql/queries/top-transact-sql?view=sql-server-ver15),
e.g.:

```
SELECT TOP 5 a, b, c FROM test
```

TOP in SQL server also supports the `PERCENTAGE` amd `WITH TIES`
keywords which this implementation doesn't.

Don't allow usage of both TOP and LIMIT in the same query.

Refers to elastic#41195
matriv added a commit that referenced this issue Jun 2, 2020
Add basic support for `TOP X` as a synonym to LIMIT X which is used
by [MS-SQL server](https://docs.microsoft.com/en-us/sql/t-sql/queries/top-transact-sql?view=sql-server-ver15),
e.g.:

```
SELECT TOP 5 a, b, c FROM test
```

TOP in SQL server also supports the `PERCENTAGE` and `WITH TIES`
keywords which this implementation doesn't.

Don't allow usage of both TOP and LIMIT in the same query.

Refers to #41195
matriv added a commit that referenced this issue Jun 2, 2020
Add basic support for `TOP X` as a synonym to LIMIT X which is used
by [MS-SQL server](https://docs.microsoft.com/en-us/sql/t-sql/queries/top-transact-sql?view=sql-server-ver15),
e.g.:

```
SELECT TOP 5 a, b, c FROM test
```

TOP in SQL server also supports the `PERCENTAGE` and `WITH TIES`
keywords which this implementation doesn't.

Don't allow usage of both TOP and LIMIT in the same query.

Refers to #41195

(cherry picked from commit 2f5ab81)
matriv added a commit to matriv/elasticsearch that referenced this issue Jun 2, 2020
Add `TRIM` function which combines the functionality of both
`LTRIM` and `RTRIM` by stripping both leading and trailinng
whitespaces.

Refers to elastic#41195
matriv added a commit that referenced this issue Jun 3, 2020
Add `TRIM` function which combines the functionality of both
`LTRIM` and `RTRIM` by stripping both leading and trailing
whitespaces.

Refers to #41195
matriv added a commit that referenced this issue Jun 3, 2020
Add `TRIM` function which combines the functionality of both
`LTRIM` and `RTRIM` by stripping both leading and trailing
whitespaces.

Refers to #41195

(cherry picked from commit 6c86c91)
@matriv
Copy link
Contributor

matriv commented Jun 3, 2020

ATAN with two arguments seems to be supported MySQL thing
where as MS-SQL server only supports the one arg version. Currently there is no need to support atan() with 2 args, therefore I'm closing this issue as the rest of the enhancements are implemented.

@matriv matriv closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying >enhancement Team:QL (Deprecated) Meta label for query languages team
Projects
None yet
Development

No branches or pull requests

5 participants