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

[CALCITE-6693] Add Source SQL Dialect to RelToSqlConverterTest #4050

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hannerwang
Copy link

@hannerwang hannerwang commented Nov 16, 2024

What changes were proposed in this pull request?

Add Source SQL Dialect to RelToSqlConverterTest to make dialect translation more clear.

Why are the changes needed?

Currently, RelToSqlConverterTest converts the original SQL to RelNode using the default validator config and the target dialect's type system, which is confusing. We should ensure the conversion conforms to the source dialect's specifications, and then convert from the source dialect's RelNode to the target dialect's SQL.

Does this PR introduce any user-facing change?

Yes, the null collation the PlannerImpl use will be validator config's null collation when calcite connection property unset.

@caicancai
Copy link
Member

Please fix CLI

@hannerwang hannerwang force-pushed the null_collation_order_by_mismatch branch from db271e5 to 2002efa Compare November 17, 2024 03:05
@hannerwang
Copy link
Author

Please fix CLI

Thanks for the reminder, it's fixed.

Copy link
Contributor

@mihaibudiu mihaibudiu left a comment

Choose a reason for hiding this comment

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

I am approving this, let's see if anyone has any other comments.

@@ -559,7 +562,7 @@ private static String toSql(RelNode root, SqlDialect dialect,
+ "FROM `foodmart`.`product`\n"
+ "GROUP BY `product_class_id`, `product_id` WITH CUBE";
sql(query).withHive().ok(expected);
SqlDialect sqlDialect = sql(query).withHive().dialect;
SqlDialect sqlDialect = sql(query).withHive().targetDialect;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a very useful change, the naming is indeed confusing.

@mihaibudiu mihaibudiu added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Nov 17, 2024
@julianhyde
Copy link
Contributor

-1 let's discuss in jira

@mihaibudiu mihaibudiu removed the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Nov 18, 2024
@mihaibudiu
Copy link
Contributor

removed label until the discussion in JIRA is settled.

Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@calcite.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants