Skip to content

[BUG] eval returns integer division result instead of decimal #3946

Closed

Description

@penghuo

What is the bug?
A clear and concise description of the bug.

How can one reproduce the bug?
The value of v is returned as 0

source=test002 | eval v=5/10

What is the expected behavior?
The expected result is:

v = 0.5

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22], 3.1
  • Plugins, SQL

Do you have any screenshots?
n/a

Do you have any additional context?
n/a

Activity

  1. added
    bug
    and removed on Jul 30, 2025
  2. added
    PPL
    and removed
    bug
    on Jul 30, 2025
  3. added
    bug
    on Jul 30, 2025
  4. moved this from Not Started to Won't do in PPL Trackeron Aug 11, 2025
  5. LantaoJin commented on Aug 11, 2025

    @LantaoJin
    Member

    In most database, 5/10 should return 0 instead of 0.5. User should change to 5.0/10 or 5d/10 for example.

  6. self-assigned this
    on Sep 23, 2025
  7. penghuo commented on Sep 23, 2025

    @penghuo
    CollaboratorAuthor

    In most database, 5/10 should return 0 instead of 0.5. User should change to 5.0/10 or 5d/10 for example.

    Spark results is expected.

    spark-sql (default)> select 4/2, 2/4, 2/40;
    (4 / 2) (2 / 4) (2 / 40)
    2.0 0.5 0.05
    Time taken: 0.046 seconds, Fetched 1 row(s)

  8. moved this from Won't do to Not Started in PPL Trackeron Sep 23, 2025
  9. assigned and unassigned on Oct 9, 2025
  10. moved this from Not Started to Done in PPL Trackeron Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

PPLbugv3.4.0

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions