[ 
https://issues.apache.org/jira/browse/PHOENIX-6818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17634755#comment-17634755
 ] 

ASF GitHub Bot commented on PHOENIX-6818:
-----------------------------------------

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, 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?





> Remove dependency on the i18n-util library
> ------------------------------------------
>
>                 Key: PHOENIX-6818
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6818
>             Project: Phoenix
>          Issue Type: Improvement
>          Components: core
>            Reporter: Istvan Toth
>            Assignee: Mate Szalay-Beko
>            Priority: Major
>
> i18n-util development seems to have stopped.
> We should copy the few relevant classes that we use from it, and maintain 
> them in Phoenix.
> This also means that we need to depend explicitly on the icu4j library that 
> i18n-util depends on.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to