-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-24889][table] Flink SQL Client should print correсtly multisets #17786
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
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit e876469 (Fri Nov 12 20:30:21 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
e876469
to
1518728
Compare
Hi, thank you for your pr. |
1518728
to
0716bba
Compare
Hi @slinkydeveloper thanks for letting know about mentioned refactoring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the casting logic is exactly the same, I don't think we need to have a separate rule for Multiset and Map. Just rename the map rule to MapAndMultisetToStringCastRule
, change the predicate and make sure the valueType
is the correct one.
...in/java/org/apache/flink/table/planner/functions/casting/MapAndMultisetToStringCastRule.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/flink/table/planner/functions/casting/MapAndMultisetToStringCastRule.java
Outdated
Show resolved
Hide resolved
… method use is(LogicalTypeFamily.COLLECTION) to check if multiset
@slinkydeveloper thanks for your feedback. P.S. I have no idea why Re-request review button does not work for me... |
...in/java/org/apache/flink/table/planner/functions/casting/MapAndMultisetToStringCastRule.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/flink/table/planner/functions/casting/MapAndMultisetToStringCastRule.java
Outdated
Show resolved
Hide resolved
…, do not extract mapToString generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a last minor nit comment, and then once the CI is green we can merge it. Thank you for the contribution!
...in/java/org/apache/flink/table/planner/functions/casting/MapAndMultisetToStringCastRule.java
Outdated
Show resolved
Hide resolved
thanks for the review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for jumping in so late. The PR looks good. I was just wondering if we would like to skip the null checking logic for values. Multiset values have always an integer. We can make the implementation a bit more efficient by skipping line 204 in MapAndMultisetToStringCastRule.
@twalthr Perhaps the point here is that |
… as they are always not null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update @snuyanzin. LGTM
What is the purpose of the change
The PR allows to pretty print for multisets
This change added tests and can be verified as follows:
A case for multiset has been added to org.apache.flink.table.utils.PrintUtilsTest#testNestedRowToString
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation