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

Support scientific notation representation in PPL #2827

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LantaoJin
Copy link
Member

@LantaoJin LantaoJin commented Jul 13, 2024

Description

Numbers of scientific notation can be recognized in SQL, but not in PPL. With this PR, numbers of scientific notation can be identified as double in PPL as same as in SQL.
Here are valid examples of scientific notation representations: 9e1, +9e+1, 900e-1, 9.0e1, 9.0e+1, 9.0E1, .9e+2, 0.09e+3, 900.0e-1, -900.0E-1.

  • Example query:
POST /_plugins/_ppl
{
  "query": """
  search source=t | eval `9e1`=9e1 | fields `9e1`
  """
}
  • Result without this PR:

SyntaxCheckException: Failed to parse query due to offending symbol [e1] at: ... | eval 9e1=9e1' <--- HERE`

  • Result with this PR:
{
  "schema": [
    {
      "name": "9e1",
      "type": "double"
    }
  ],
  "datarows": [
    [
      90
    ]
  ]
}

Issues Resolved

Resolves #2826

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Lantao Jin <ltjin@amazon.com>
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@LantaoJin
Copy link
Member Author

Gently ping @penghuo @vamsi-amazon @YANG-DB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Numbers in scientific notation can not be recognized in PPL
2 participants