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

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

Open
LantaoJin opened this issue Jul 13, 2024 · 0 comments · May be fixed by #2827
Open

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

LantaoJin opened this issue Jul 13, 2024 · 0 comments · May be fixed by #2827
Labels
bug Something isn't working

Comments

@LantaoJin
Copy link
Member

What is the bug?
Scientific notation typically follows the format: $significand × 10^{exponent}$
where the $significand$ is a decimal number, and the $exponent$ is an integer. The significand can have a positive or negative sign, and the exponent can be preceded by 𝑒 or 𝐸, and can also have a positive or negative sign.

Scientific notation can be recognized in SQL, but not in PPL.

How can one reproduce the bug?

POST /_plugins/_sql
{
  "query": """
  SELECT 9e1;
  """
}

returns 90, but

POST /_plugins/_ppl
{
  "query": """
  search source=t | eval `9e1`=9e1 | fields `9e1`
  """
}

throws SyntaxCheckException

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

What is the expected behavior?

{
  "schema": [
    {
      "name": "9e1",
      "type": "double"
    }
  ],
  "datarows": [
    [
      90
    ]
  ],
  "total": 1,
  "size": 1
}

What is your host/environment?

  • Version 2.16
  • Plugins SQL

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

@LantaoJin LantaoJin added bug Something isn't working untriaged labels Jul 13, 2024
@LantaoJin LantaoJin linked a pull request Jul 13, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant