Skip to content

Panic when calling min/max (without a Primary Key?) #2915

@kylebrandt

Description

@kylebrandt

I'm hitting a nil panic when I use min/max (not sum) with my provider (https://github.com/grafana/grafana/blob/main/pkg/expr/sql/frame_table.go). (e.g. select min(myNumCol) from myTable, note: if I add a group by to this, it doesn't panic) - It seems to be at:

github.com/dolthub/[email protected]/sql/analyzer/replace_sort.go:260 (0x3d9f37f)
    replaceAgg.func1: if !strings.EqualFold(pkIdx.Expressions()[0], sf.Column.String()) {

My guess is I'm hitting this because my tables don't have a primary key

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions