codope commented on code in PR #12455:
URL: https://github.com/apache/hudi/pull/12455#discussion_r1886698547


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/expression/ExpressionIndexSparkFunctions.java:
##########
@@ -0,0 +1,609 @@
+/*
+ * 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.hudi.index.expression;
+
+import org.apache.hudi.common.util.ValidationUtils;
+
+import org.apache.spark.sql.Column;
+import org.apache.spark.sql.functions;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.DAYS_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.EXPRESSION_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.FORMAT_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.LENGTH_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.PATTERN_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.POSITION_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.REGEX_GROUP_INDEX_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.REPLACEMENT_OPTION;
+import static 
org.apache.hudi.index.expression.HoodieExpressionIndex.TRIM_STRING_OPTION;
+
+public class ExpressionIndexSparkFunctions {
+
+  private static final String SPARK_DATE_FORMAT = "date_format";
+  private static final String SPARK_DAY = "day";
+  private static final String SPARK_MONTH = "month";
+  private static final String SPARK_YEAR = "year";
+  private static final String SPARK_HOUR = "hour";
+  private static final String SPARK_FROM_UNIXTIME = "from_unixtime";
+  private static final String SPARK_UNIX_TIMESTAMP = "unix_timestamp";
+  private static final String SPARK_TO_DATE = "to_date";
+  private static final String SPARK_TO_TIMESTAMP = "to_timestamp";
+  private static final String SPARK_DATE_ADD = "date_add";
+  private static final String SPARK_DATE_SUB = "date_sub";
+  private static final String SPARK_SUBSTRING = "substring";
+  private static final String SPARK_UPPER = "upper";
+  private static final String SPARK_LOWER = "lower";
+  private static final String SPARK_TRIM = "trim";
+  private static final String SPARK_LTRIM = "ltrim";
+  private static final String SPARK_RTRIM = "rtrim";
+  private static final String SPARK_LENGTH = "length";
+  private static final String SPARK_REGEXP_REPLACE = "regexp_replace";
+  private static final String SPARK_REGEXP_EXTRACT = "regexp_extract";
+  private static final String SPARK_SPLIT = "split";
+  public static final String IDENTITY_FUNCTION = "identity";
+
+  private static Map<String, SparkFunction> SPARK_FUNCTION_MAP = new 
HashMap<>();

Review Comment:
   final?



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/utils/SparkMetadataWriterUtils.java:
##########
@@ -37,7 +37,7 @@
 import org.apache.hudi.config.HoodieWriteConfig;
 import org.apache.hudi.data.HoodieJavaRDD;
 import org.apache.hudi.exception.HoodieIOException;
-import org.apache.hudi.index.functional.HoodieExpressionIndex;
+import org.apache.hudi.index.expression.HoodieExpressionIndex;

Review Comment:
   The package rename should not affect upgrade/downgrade as it is internal and 
classnames are not exposed to the user.



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/ExpressionIndexSupport.scala:
##########


Review Comment:
   Please create a JIRA to refactor this support class, mainly to enahance 
reussability between this and ColumnStatsIndexSupport.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to