Skip to content

Minor: Use execution error in ScalarValue::iter_to_array for incorrect usage#11999

Merged
jayzhan211 merged 3 commits intoapache:mainfrom
jayzhan211:err-fix
Aug 16, 2024
Merged

Minor: Use execution error in ScalarValue::iter_to_array for incorrect usage#11999
jayzhan211 merged 3 commits intoapache:mainfrom
jayzhan211:err-fix

Conversation

@jayzhan211
Copy link
Copy Markdown
Contributor

@jayzhan211 jayzhan211 commented Aug 15, 2024

Which issue does this PR close?

Closes #.
Part of #11992

Since ScalarValue::iter_to_array is a widely used directly function, I think it makes sense to return execution error instead of internal error.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
@github-actions github-actions Bot added the common Related to common crate label Aug 15, 2024
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
@jayzhan211 jayzhan211 marked this pull request as ready for review August 15, 2024 09:33
@jayzhan211 jayzhan211 changed the title Fix: Use execution error in ScalarValue::iter_to_array for incorrect usage Minor: Use execution error in ScalarValue::iter_to_array for incorrect usage Aug 15, 2024
Copy link
Copy Markdown
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

I personally think the internal error makes more sense but I don't have a problem changing this

I think the idea about returning internal error was that if these errors get hit, then it signals some bug in the datafusion code -- it is not something you can likely fix by updating your query

@jayzhan211
Copy link
Copy Markdown
Contributor Author

jayzhan211 commented Aug 15, 2024

I personally think the internal error makes more sense but I don't have a problem changing this
I think the idea about returning internal error was that if these errors get hit, then it signals some bug in the datafusion code

I think the problem is typically for a function that is both used directly from down stream project and internally. We return internal error even it is used incorrectly from down stream project, which is actually not the bug from datafusion. #11992 is one of the case. I'm still struggle with what error should I used AGAIN 😆

@jayzhan211 jayzhan211 merged commit 9f77021 into apache:main Aug 16, 2024
@jayzhan211 jayzhan211 deleted the err-fix branch August 16, 2024 02:55
@jayzhan211
Copy link
Copy Markdown
Contributor Author

Thanks @alamb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants