Skip to content

Minor: Encapsulate type check in GroupValuesColumn, avoid panic - #12620

Merged
alamb merged 8 commits into
apache:mainfrom
alamb:alamb/minor_cleanup
Sep 26, 2024
Merged

Minor: Encapsulate type check in GroupValuesColumn, avoid panic#12620
alamb merged 8 commits into
apache:mainfrom
alamb:alamb/minor_cleanup

Conversation

@alamb

@alambalamb commented Sep 25, 2024

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Follow on to #12269 from @jayzhan211

Rationale for this change

I had some minor suggestions during review: #12269 (review)

What changes are included in this PR?

  1. Move type checking into the same module that it needs to be kepy in sync with
  2. return internal error than panic on bug

Are these changes tested?

CI

Are there any user-facing changes?

@goldmedalgoldmedal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alamb it looks good to me. Only one minor suggestion for error handling.

Comment threaddatafusion/physical-plan/src/aggregates/group_values/column_wise.rs Outdated
Comment threaddatafusion/physical-plan/src/aggregates/group_values/column_wise.rs Outdated
fn supported_type(data_type: &DataType) -> bool {
matches!(
*data_type,
DataType::Int8

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use DataType::is_signed_integerDataType::is_unsigned_integer

we can also use is_numeric but it includes Decimals

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list needs to be kept in sync with what special implementations are available in GroupValuesColumns -- I will add a comment to make that clearer

@compheadcomphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @alamb

@jayzhan211jayzhan211 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alamb

Copy link
Copy Markdown
ContributorAuthor

Thank you for the review @jayzhan211

@alamb
alamb merged commit 9a3f8d1 into apache:mainSep 26, 2024
@alamb

Copy link
Copy Markdown
ContributorAuthor

Thanks @comphead and @jayzhan211

@alamb
alamb deleted the alamb/minor_cleanup branch September 26, 2024 21:23
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-exprChanges to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@alamb@goldmedal@comphead@jayzhan211