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

Add select expression without query support #542

Conversation

dai-chen
Copy link
Member

@dai-chen dai-chen commented Jun 30, 2020

Issue #, if available: #545, #264, #256

Description of changes: Recently a new SQL module was added and integrate with new query engine. As first feature, select literal without query (FROM clause) was supported. In this PR, support for more expression selected without query is added to lay the foundation for future SQL functions work. In particular, the changes include:

  1. Support select arithmetic expression without query: SELECT 1 + 2
  2. Support select function expression without query: SELECT abs(-1)

Out of scope: Only one function abs is added in this PR as a sample. More functions and other expression such as predicate expression will be covered in future PR separately.

Testing: As comparison test framework is enable by default, new test convention is followed:

  1. Comparison test: add test cases in arithmetics.txt and functions.txt
  2. Edge case test: add ExpressionIT to test edge case like divide by zero

Documentation: Add one doc in doctest https://github.com/dai-chen/sql/blob/add-select-expression-support/docs/user/dql/expressions.rst#arithmetic-expressions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dai-chen dai-chen added the SQL label Jun 30, 2020
@dai-chen dai-chen self-assigned this Jun 30, 2020
@dai-chen dai-chen changed the title Add select expression support Add select expression without query support Jun 30, 2020
@dai-chen dai-chen added the enhancement New feature or request label Jul 1, 2020
@dai-chen dai-chen marked this pull request as ready for review July 1, 2020 21:44
@dai-chen dai-chen requested review from chloe-zh and penghuo July 1, 2020 21:47
Copy link
Contributor

@penghuo penghuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dai-chen dai-chen merged commit dddef2e into opendistro-for-elasticsearch:develop Jul 8, 2020
@dai-chen dai-chen deleted the add-select-expression-support branch July 8, 2020 18:48
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

Successfully merging this pull request may close these issues.

None yet

3 participants