-
Notifications
You must be signed in to change notification settings - Fork 994
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
PHOENIX-6818 Remove dependency on the i18n-util library #1527
Conversation
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 moving these into Phoenix. Just a question about whether we need all of these files.
* | ||
* @see OracleUpperTable | ||
*/ | ||
public class OracleUpper { |
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.
Are the OracleUpper, OracleUpperTable, and OracleUpperTableGenratorTest actually used within Phoenix? I just see references to LocaleUtils and LinguisticSort in Phoenix, and I don't see a reference to the three Oracle* classes from either of those. Did I miss a dependency?
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 checking!
yes, all these OracleUpper related shenanigans are needed if in the CollatinKeyFunction we go with linguisticSort.getUpperCaseCollator
:
phoenix/phoenix-core/src/main/java/org/apache/phoenix/expression/function/CollationKeyFunction.java
Lines 159 to 160 in 8820d69
collator = BooleanUtils.isTrue(useSpecialUpperCaseCollator) ? linguisticSort.getUpperCaseCollator(false) | |
: linguisticSort.getCollator(); |
In this case the LinguisticSort is using these OracleUpper classes.
I also missed this on the first look, and it made the patch a bit more complex than how I originally thought.
Actually the OracleUpperTableGenratorTest
could be removed. That is not really a test, but a code generator utility in disguise. I just left it there because I thought if we need to fix anything in OracleUpperTable later, then maybe we can use that generator again. But it is rather unlikely that we will ever need this in Phoenix. What do you think?
I'd prefer the pulled in code to live its own package, i.e org.apache.phoenix.i18nutil. Update: Now I see that most of it is already under org.apache.phoenix.i18. That's fine. |
yes, the only "copied" code which I put directly to |
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.
+1 LGTM but let's wait for Geoffrey's response before pushing.
@symat - if we keep the code generator, let's change it to output the Apache license rather than the Salesforce one. Other than that, lgtm. |
@stoty, @gjacoby126, thank you both for the quick reviews!!
nice catch, I fixed this. |
Yetus doesn't like the ASF license formatting in a few files. Please address the checkstyle and author checks above. (actually, not it's below) |
Thank you! I went through the problems reported by yetus. Some of them were valid, but many of them were already fixed in the previous commits. Anyway, let's see if the checks succeed this time. |
@stoty , can you please take a look on these yetus checks? Maybe I missed something... it is my first PR in Phoenix, as far as I remember :)
This was indeed an issue in the original patch, but was fixed in my second commit.
Here I see two remaining checkstyle failures on SortablePicklistItem.java. This class was part of my first commit, but later I realized that we don't need it and I deleted this class. Yet it appears in the latest checkstyle report for some reason. |
would it help if I would create a new PR with a single squashed commit? Or force-push a single squashed commit here to this PR? |
@symat - let's try squashing to a single commit and force-pushing. I don't see the author tags it's complaining about either. |
i18n-util is not maintained anymore, but uses icu4j dependencies having CVE issues. To avoid these problems, I copied the relevant code from i18n-util and used the latest icu4j version.
Pushed to master and 5.1 |
thank you @gjacoby126 and @stoty for the help! |
i18n-util is not maintained anymore, but uses icu4j dependencies having CVE issues. To avoid these problems, I copied the relevant code from i18n-util and used the latest icu4j version.