Skip to content

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
    ]
  ]
}

Verified the feature works both in v2 and v3.

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>
dai-chen
dai-chen previously approved these changes Jul 16, 2024
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

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

YANG-DB
YANG-DB previously approved these changes Dec 30, 2024
@LantaoJin LantaoJin dismissed stale reviews from YANG-DB and dai-chen via 69baa3d December 31, 2024 06:43
@LantaoJin LantaoJin requested a review from noCharger as a code owner December 31, 2024 06:43
YANG-DB
YANG-DB previously approved these changes Dec 31, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@RyanL1997
Copy link
Collaborator

Hi @LantaoJin, just wanna check if this is still on track or we can close it?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants