Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Example produces incorrect results #44

@andygrove

Description

@andygrove

The tips.py runs a grouping query but the result set has duplicate keys:

0    Male     No  0.160669
1  Female    Yes  0.182150
      sex smoker   tip_pct
0  Female     No  0.156921
1    Male    Yes  0.152771

Debug logging:

Planning select sex, smoker, avg(tip/total_bill) as tip_pct from tips group by sex, smoker
Query stage #0:
RayShuffleWriterExec(stage_id=0, output_partitioning=Hash([Column { name: "sex", index: 0 }, Column { name: "smoker", index: 1 }], 2))
  AggregateExec: mode=Partial, gby=[sex@2 as sex, smoker@3 as smoker], aggr=[AVG(tips.tip / tips.total_bill)]
    ParquetExec: limit=None, partitions={1 group: [[home/andy/git/personal/ray-sql/examples/tips.parquet]]}, projection=[total_bill, tip, sex, smoker]

Query stage #1:
CoalescePartitionsExec
  ProjectionExec: expr=[sex@0 as sex, smoker@1 as smoker, AVG(tips.tip / tips.total_bill)@2 as tip_pct]
    AggregateExec: mode=FinalPartitioned, gby=[sex@0 as sex, smoker@1 as smoker], aggr=[AVG(tips.tip / tips.total_bill)]
      CoalesceBatchesExec: target_batch_size=16384
        RayShuffleReaderExec(stage_id=0, input_partitioning=Hash([Column { name: "sex", index: 0 }, Column { name: "smoker", index: 1 }], 2))

Scheduling query stage #0 with 1 input partitions and 2 output partitions
Forcing reduce stage concurrency from 2 to 1
Scheduling query stage #1 with 1 input partitions and 1 output partitions
      sex smoker   tip_pct
0    Male     No  0.160669
1  Female    Yes  0.182150
      sex smoker   tip_pct
0  Female     No  0.156921
1    Male    Yes  0.152771

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions