René's URL Explorer Experiment


Title: fix(udf): declare scalar UDF signatures with Field, not ArrowType by LantaoJin · Pull Request #59 · apache/datafusion-java · GitHub

Open Graph Title: fix(udf): declare scalar UDF signatures with Field, not ArrowType by LantaoJin · Pull Request #59 · apache/datafusion-java

X Title: fix(udf): declare scalar UDF signatures with Field, not ArrowType by LantaoJin · Pull Request #59 · apache/datafusion-java

Description: Which issue does this PR close? Closes #58 . Rationale for this change ScalarFunction.argTypes() returned List and returnType() returned ArrowType. In Java Arrow, ArrowType is a leaf marker for the type kind: it is self-describing for primitives like Int32 or Float64, but for nested types (List, Struct, Map, FixedSizeList) the element / member / key / value types live on the parent Field's children list, not inside ArrowType. ArrowType.List is literally a no-field marker class. A Java UDF author therefore had no way to declare a typed nested signature. Trying argTypes() = List.of(new ArrowType.List()) blew up at registration time: IllegalArgumentException: Lists have one child Field. Found: none at SessionContext.serializeSchemaIpc(SessionContext.java:398) at SessionContext.registerUdf(SessionContext.java:391) This blocked the entire family of nested-type UDFs that exist as built-ins in DataFusion's datafusion-functions-nested crate (array_length, cardinality, array_has, array_position, flatten, map_keys, map_values, arrows_zip, ...). Anyone porting Spark UDFs over ArrayType / StructType / MapType columns to DataFusion-Java hit this on the first attempt. The Rust API does not have this problem because DataType::List(Arc) carries the child field inline. Switching the Java interface from ArrowType to Field is the structural mirror: Field is the only type that can carry children, so it's the type the interface has always needed to use. What changes are included in this PR? See commit log Are these changes tested? Yes -- 5 new tests over and above the existing 12. Are there any user-facing changes? Yes -- a source-breaking signature change to the public ScalarFunction interface. Existing primitive UDFs become slightly more verbose: // Before: public List argTypes() { return List.of(INT32); } public ArrowType returnType() { return INT32; } // After: public List argFields() { return List.of(Field.nullable("arg0", INT32)); } public Field returnField() { return Field.nullable("return", INT32); } Nested-type UDFs that were previously impossible to declare can now be expressed by attaching child fields. For example, a UDF over List returning the list length: // List argument: the element type lives in the Field's children list. public List argFields() { return List.of( new Field( "vals", FieldType.nullable(new ArrowType.List()), List.of(Field.nullable("item", INT32)))); } public Field returnField() { return Field.nullable("len", INT32); } Same shape works for Struct (children are the member fields) and Map (children describe the key/value entries struct). The repo is pre-release, which makes this the right time to tighten the interface before downstream callers accumulate.

Open Graph Description: Which issue does this PR close? Closes #58 . Rationale for this change ScalarFunction.argTypes() returned List<ArrowType> and returnType() returned ArrowType. In Java Arrow, ArrowType is a ...

X Description: Which issue does this PR close? Closes #58 . Rationale for this change ScalarFunction.argTypes() returned List&lt;ArrowType&gt; and returnType() returned ArrowType. In Java Arrow, ArrowTy...

Opengraph URL: https://github.com/apache/datafusion-java/pull/59

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5513f975-d318-b52d-e88b-654e557522ad
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBEF6:81334:73A8:9BBE:6B046A5E
html-safe-nonce6c4d9fd2ca4791e5e2563bd090e7e8823b84d66cb0b0771198646bed7b410b78
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUY2OjgxMzM0OjczQTg6OUJCRTo2QjA0NkE1RSIsInZpc2l0b3JfaWQiOiI0MjQ2NDMyNTk5Njg3NTg4NDQ2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac027ebd6941e702c1b8024b976592a1c09e32ff79442962bed621bec4c88d36ca
hovercard-subject-tagpull_request:3700482244
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/apache/datafusion-java/pull/59/files
twitter:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1853780?s=400&v=4
og:image:altWhich issue does this PR close? Closes #58 . Rationale for this change ScalarFunction.argTypes() returned List<ArrowType> and returnType() returned ArrowType. In Java Arrow, ArrowType is a ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/apache/datafusion-java git https://github.com/apache/datafusion-java.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id1237105117
octolytics-dimension-repository_nwoapache/datafusion-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1237105117
octolytics-dimension-repository_network_root_nwoapache/datafusion-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/datafusion-java/pull/59/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F59%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fdatafusion-java%2Fpull%2F59%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=apache%2Fdatafusion-java
Reloadhttps://github.com/apache/datafusion-java/pull/59/files
Reloadhttps://github.com/apache/datafusion-java/pull/59/files
Reloadhttps://github.com/apache/datafusion-java/pull/59/files
apachehttps://github.com/apache
datafusion-javahttps://github.com/apache/datafusion-java
Codehttps://github.com/apache/datafusion-java
Issues10 (10)https://github.com/apache/datafusion-java/issues
Pull requests10 (10)https://github.com/apache/datafusion-java/pulls
Discussionshttps://github.com/apache/datafusion-java/discussions
Actionshttps://github.com/apache/datafusion-java/actions
Security and qualityhttps://github.com/apache/datafusion-java/security
Insightshttps://github.com/apache/datafusion-java/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fapache%2Fdatafusion-java%2Fissues%2Fnew%2Fchoose
andygrovehttps://github.com/andygrove
apache:mainhttps://github.com/apache/datafusion-java/tree/main
LantaoJin:fix/udf-nested-arrow-typeshttps://github.com/LantaoJin/datafusion-java/tree/fix/udf-nested-arrow-types
Conversation 5 https://github.com/apache/datafusion-java/pull/59
Commits 4 https://github.com/apache/datafusion-java/pull/59/commits
Checks 2 https://github.com/apache/datafusion-java/pull/59/checks
Files changed https://github.com/apache/datafusion-java/pull/59/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/59/files
fix(udf): declare scalar UDF signatures with Field, not ArrowType https://github.com/apache/datafusion-java/pull/59/files#top
Show all changes 4 commits https://github.com/apache/datafusion-java/pull/59/files
fd66076 fix(udf): declare scalar UDF signatures with Field, not ArrowType LantaoJin May 18, 2026 https://github.com/apache/datafusion-java/pull/59/commits/fd660761739c8346dbc29d2f0d9de6f38386c659
305da43 Merge remote-tracking branch 'upstream/main' into fix/udf-nested-arro… LantaoJin May 19, 2026 https://github.com/apache/datafusion-java/pull/59/commits/305da43f11839a013861b894a3ad9f7716fbe254
e637d46 Merge remote-tracking branch 'upstream/main' into fix/udf-nested-arro… LantaoJin May 22, 2026 https://github.com/apache/datafusion-java/pull/59/commits/e637d46c08da6068e37433b14ef8420871bdfe44
04e857e address comments LantaoJin May 22, 2026 https://github.com/apache/datafusion-java/pull/59/commits/04e857e7f47da367c8ee422657016ea3299db6fc
Clear filters https://github.com/apache/datafusion-java/pull/59/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/59/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/59/files
ScalarFunction.java https://github.com/apache/datafusion-java/pull/59/files#diff-bd89b23d6028824ee8aa496782bd8683b521588c78f471de76829dd3a74aadd3
ScalarUdf.java https://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
SessionContext.java https://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
ScalarUdfTest.java https://github.com/apache/datafusion-java/pull/59/files#diff-44b18e4a141ffd448eb762005708913dfd7d6209335637e5fdf6291a63410b26
scalar-udf.md https://github.com/apache/datafusion-java/pull/59/files#diff-0c0208f26eacc9b3a2c6e9c178bc140ab31ff32d4d097b4971bfda47674626e9
AddOneExample.java https://github.com/apache/datafusion-java/pull/59/files#diff-69812f77b37e69bcc057b6c77b21304b26cf9af77d2692a827e3ca28188e4222
NestedTypeUdfExample.java https://github.com/apache/datafusion-java/pull/59/files#diff-fb0b0108f4f7237bacf5a54e3f0efd65f13bac958d2066603afc5cf5136c3f3f
lib.rs https://github.com/apache/datafusion-java/pull/59/files#diff-697685fba8d3d4a3a8a287bad6e1369e50e1c98bd878823415758c2a642cbb6e
udf.rs https://github.com/apache/datafusion-java/pull/59/files#diff-1c9a0800b6151fc16f2965eb70c73bcf80208567d7d14d2f6f28de9f59cdda8a
core/src/main/java/org/apache/datafusion/ScalarFunction.javahttps://github.com/apache/datafusion-java/pull/59/files#diff-bd89b23d6028824ee8aa496782bd8683b521588c78f471de76829dd3a74aadd3
View file https://github.com/LantaoJin/datafusion-java/blob/04e857e7f47da367c8ee422657016ea3299db6fc/core/src/main/java/org/apache/datafusion/ScalarFunction.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/59/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/59/files#diff-bd89b23d6028824ee8aa496782bd8683b521588c78f471de76829dd3a74aadd3
https://github.com/apache/datafusion-java/pull/59/files#diff-bd89b23d6028824ee8aa496782bd8683b521588c78f471de76829dd3a74aadd3
https://github.com/apache/datafusion-java/pull/59/files#diff-bd89b23d6028824ee8aa496782bd8683b521588c78f471de76829dd3a74aadd3
core/src/main/java/org/apache/datafusion/ScalarUdf.javahttps://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
View file https://github.com/LantaoJin/datafusion-java/blob/04e857e7f47da367c8ee422657016ea3299db6fc/core/src/main/java/org/apache/datafusion/ScalarUdf.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/59/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
https://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
https://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
https://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
https://github.com/apache/datafusion-java/pull/59/files#diff-4e8a48ce1cf63fee2680588a132d8b235f86ba7c44a2afb9c817dd738a2c4de7
core/src/main/java/org/apache/datafusion/SessionContext.javahttps://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
View file https://github.com/LantaoJin/datafusion-java/blob/04e857e7f47da367c8ee422657016ea3299db6fc/core/src/main/java/org/apache/datafusion/SessionContext.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/apache/datafusion-java/pull/59/{{ revealButtonHref }}
https://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
https://github.com/apache/datafusion-java/pull/59/files#diff-9aa9338a7364e93d5e2e4547564e7eb08e65a70f6d51b6fa896325cd4d87451e
Please reload this pagehttps://github.com/apache/datafusion-java/pull/59/files
Please reload this pagehttps://github.com/apache/datafusion-java/pull/59/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.