Skip to content

Conversation

@xonx4l
Copy link
Contributor

@xonx4l xonx4l commented Dec 21, 2025

Which issue does this PR close?

Closes #19356

Rationale for this change

This PR implements the arrow_metadata UDF as requested in issue #19356.

What changes are included in this PR?

Added arrow_metadata UDF
Refactored Tests

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes.

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions Changes to functions implementation labels Dec 21, 2025
Copy link
Contributor

@Jefffrey Jefffrey left a comment

Choose a reason for hiding this comment

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

I think we just need to add some documentation, see an example from arrow_typeof here:

#[user_doc(
doc_section(label = "Other Functions"),
description = "Returns the name of the underlying [Arrow data type](https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html) of the expression.",
syntax_example = "arrow_typeof(expression)",
sql_example = r#"```sql
> select arrow_typeof('foo'), arrow_typeof(1);
+---------------------------+------------------------+
| arrow_typeof(Utf8("foo")) | arrow_typeof(Int64(1)) |
+---------------------------+------------------------+
| Utf8 | Int64 |
+---------------------------+------------------------+
```
"#,
argument(
name = "expression",
description = "Expression to evaluate. The expression can be a constant, column, or function, and any combination of operators."
)
)]

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 21, 2025
@xonx4l
Copy link
Contributor Author

xonx4l commented Dec 21, 2025

@Jefffrey Done.

@comphead comphead added this pull request to the merge queue Dec 23, 2025
Merged via the queue into apache:main with commit d844f86 Dec 23, 2025
28 checks passed
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 sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add arrow_metadata(<expr>) UDF

3 participants