Skip to content

Add native AST support for USING JAR/FILE/ARCHIVE in CREATE FUNCTION#7436

Open
hashwnath wants to merge 1 commit intotobymao:mainfrom
hashwnath:feat/7435-using-jar-ast
Open

Add native AST support for USING JAR/FILE/ARCHIVE in CREATE FUNCTION#7436
hashwnath wants to merge 1 commit intotobymao:mainfrom
hashwnath:feat/7435-using-jar-ast

Conversation

@hashwnath
Copy link
Copy Markdown

Summary

  • Adds a UsingProperty AST node to represent USING JAR/FILE/ARCHIVE clauses in Hive/Spark CREATE FUNCTION statements
  • Parses these clauses into proper AST nodes instead of falling back to the Command expression
  • Enables programmatic inspection and modification of the resource type and path

Previously, CREATE FUNCTION my_func AS 'com.MyFunc' USING JAR 's3://path' would be parsed as a Command node with the entire SQL as a raw string. Now it produces a proper Create node with a UsingProperty that can be inspected and modified.

Test plan

  • Added tests for USING JAR, USING FILE, and USING ARCHIVE roundtrip parsing
  • Added tests for CREATE OR REPLACE TEMPORARY FUNCTION ... USING JAR
  • Added tests for programmatic AST construction and modification
  • All 1072 existing + new tests pass

Fixes #7435

Parse Hive/Spark CREATE FUNCTION ... USING JAR/FILE/ARCHIVE statements
into proper AST nodes instead of falling back to the Command expression.

This adds a UsingProperty node that allows programmatic inspection and
modification of the resource type and path in CREATE FUNCTION statements.

Fixes tobymao#7435
@georgesittas
Copy link
Copy Markdown
Collaborator

Hey @hashwnath, thanks for the PR. Can you please run make style to resolve any styling issues and push again?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support USING JAR more natively

2 participants