You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2022/11/16 08:58:31 UTC

[GitHub] [phoenix] symat commented on a diff in pull request #1527: PHOENIX-6818 Remove dependency on the i18n-util library

symat commented on code in PR #1527:
URL: https://github.com/apache/phoenix/pull/1527#discussion_r1023703876


##########
phoenix-core/src/main/java/org/apache/phoenix/util/i18n/OracleUpper.java:
##########
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.phoenix.util.i18n;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * This utility class was partially copied from Salesforce's internationalization utility library
+ * (com.salesforce.i18n:i18n-util:1.0.4), which was released under the 3-clause BSD License.
+ * The i18n-util library is not maintained anymore, and it was using vulnerable dependencies.
+ * For more info, see: https://issues.apache.org/jira/browse/PHOENIX-6818
+ *
+ * OracleUpper is used in combination with OracleUpperTable to generate upper-case output
+ * consistent particular chosen Oracle expressions.
+ *
+ * @see OracleUpperTable
+ */
+public class OracleUpper {

Review Comment:
   thanks for checking!
   
   yes, all these OracleUpper related shenanigans are needed if in the CollatinKeyFunction we go with `linguisticSort.getUpperCaseCollator`: 
   
   https://github.com/apache/phoenix/blob/8820d69fa21e2f38b90119eb1203d11e0266f988/phoenix-core/src/main/java/org/apache/phoenix/expression/function/CollationKeyFunction.java#L159-L160
   
   In this case the LinguisticSort is using these OracleUpper classes.
   
   I also missed this on the first look, but 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?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org