Skip to content

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

Closed
hannerwang wants to merge 1 commit intoapache:mainfrom
hannerwang:null_collation_order_by_mismatch
Closed

[CALCITE-6693] Add Source SQL Dialect to RelToSqlConverterTest#4050
hannerwang wants to merge 1 commit intoapache:mainfrom
hannerwang:null_collation_order_by_mismatch

Conversation

@hannerwang
Copy link
Copy Markdown

@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
Copy Markdown
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
@sonarqubecloud
Copy link
Copy Markdown

@hannerwang
Copy link
Copy Markdown
Author

Please fix CLI

Thanks for the reminder, it's fixed.

Copy link
Copy Markdown
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.

+ "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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

removed label until the discussion in JIRA is settled.

@github-actions
Copy link
Copy Markdown

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.

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