Skip to content

Conversation

@Jefffrey
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

See issue.

What changes are included in this PR?

Add new TypeSignatureClass variant Any and refactor arrow_typeof and arrow_metadata function signatures to use this.

Are these changes tested?

Existing tests.

Are there any user-facing changes?

No.

@github-actions github-actions bot added logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Dec 25, 2025
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 25, 2025
SELECT arrow_cast('1')

query error DataFusion error: Execution error: arrow_cast requires its second argument to be a non\-empty constant string
query error Expect TypeSignatureClass::Native\(LogicalType\(Native\(String\), String\)\) but received NativeType::Int64, DataType: Int64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably should start looking in #19004 properly to try pretty up these new error messages 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

These are really ugly I agree it would be nice if it was neater. But the current status quo is not good so this is no better or worse imo.

@Jefffrey Jefffrey marked this pull request as ready for review December 25, 2025 02:32
Copy link
Contributor

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

Thanks @Jefffrey !

Comment on lines +359 to +360
// TODO: might be too much info to return every single type here
// maybe https://github.com/apache/datafusion/issues/14761 will help here?
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

SELECT arrow_cast('1')

query error DataFusion error: Execution error: arrow_cast requires its second argument to be a non\-empty constant string
query error Expect TypeSignatureClass::Native\(LogicalType\(Native\(String\), String\)\) but received NativeType::Int64, DataType: Int64
Copy link
Contributor

Choose a reason for hiding this comment

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

These are really ugly I agree it would be nice if it was neater. But the current status quo is not good so this is no better or worse imo.

@Jefffrey Jefffrey added this pull request to the merge queue Dec 30, 2025
Merged via the queue into apache:main with commit 13f3843 Dec 30, 2025
33 checks passed
@Jefffrey Jefffrey deleted the typesignatureclass-any branch December 30, 2025 03:55
@Jefffrey
Copy link
Contributor Author

Thanks @adriangb

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

Labels

documentation Improvements or additions to documentation functions Changes to functions implementation logical-expr Logical plan and expressions sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding TypeSignatureClass::Any variant

2 participants