Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1947501: Create AST API in JDBC #2112

Merged

Conversation

sfc-gh-rysun
Copy link

@sfc-gh-rysun sfc-gh-rysun commented Mar 4, 2025

Overview

SNOW-1947501

Pre-review self checklist

  • PR branch is updated with all the changes from master branch
  • The code is correctly formatted (run mvn -P check-style validate)
  • New public API is not unnecessary exposed (run mvn verify and inspect target/japicmp/japicmp.html)
  • The pull request name is prefixed with SNOW-XXXX:
  • Code is in compliance with internal logging requirements

External contributors - please answer these questions before submitting a pull request. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Issue: #NNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency or upgrading an existing one
    • I am adding new public/protected component not marked with @SnowflakeJdbcInternalApi (note that public/protected methods/fields in classes marked with this annotation are already internal)
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

@sfc-gh-rysun sfc-gh-rysun requested a review from a team as a code owner March 4, 2025 17:42
Copy link

github-actions bot commented Mar 4, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@@ -787,7 +791,10 @@ public SFBaseResultSet execute(
throws SQLException, SFException {
TelemetryService.getInstance().updateContext(session.getSnowflakeConnectionString());

// todo: if (dataframeAst == null)
if (dataframeAst != null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of return early, just use if statement to skip all sql functions, then we can benefit from feature changes related to non-sql part.

@sfc-gh-rysun sfc-gh-rysun changed the title Added params and finished Todos SNOW-1947501: Create AST API in JDBC Mar 5, 2025
@sfc-gh-rysun
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Collaborator

@sfc-gh-bli sfc-gh-bli left a comment

Choose a reason for hiding this comment

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

Let's add some test

@@ -787,22 +791,23 @@ public SFBaseResultSet execute(
throws SQLException, SFException {
TelemetryService.getInstance().updateContext(session.getSnowflakeConnectionString());

// todo: if (dataframeAst == null)
sanityCheckQuery(sql);
if (dataframeAst == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

write a comment above this line, to mention why we skip those code.

@@ -175,7 +175,13 @@ public ResultSet executeAsyncQuery(String sql) throws SQLException {
return rs;
}

// todo: add doc
/**
* Execute SQL query asynchronously
Copy link
Collaborator

Choose a reason for hiding this comment

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

asynchronously ?

Copy link
Collaborator

@sfc-gh-bli sfc-gh-bli left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-bli sfc-gh-bli merged commit 4acc0b3 into snowflakedb:dataframe_ast_poc Mar 11, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants