You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2021/06/06 05:58:30 UTC

[GitHub] [hudi] garyli1019 commented on a change in pull request #2616: [HUDI-1625] Support range partition keygen

garyli1019 commented on a change in pull request #2616:
URL: https://github.com/apache/hudi/pull/2616#discussion_r646079155



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/RangePartitionAvroKeyGenerator.java
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.keygen;
+
+import org.apache.hudi.avro.HoodieAvroUtils;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.exception.HoodieKeyGeneratorException;
+import org.apache.hudi.exception.HoodieNotSupportedException;
+import org.apache.hudi.keygen.constant.KeyGeneratorOptions;
+
+import org.apache.avro.generic.GenericRecord;
+
+public class RangePartitionAvroKeyGenerator extends SimpleAvroKeyGenerator {
+
+  private final Long rangePerBucket;
+  private final String partitionName;
+
+  public static class Config {
+    public static final String RANGE_PER_PARTITION_PROP = "hoodie.keygen.range.partition.num";
+    public static final Long DEFAULT_RANGE_PER_PARTITION = 100000L;
+    public static final String RANGE_PARTITION_NAME_PROP = "hoodie.keygen.range.partition.name";
+    public static final String DEFAULT_RANGE_PARTITION_NAME = "rangePartition";

Review comment:
       for the CDC data has incremental primary key and only a few updates, this could speed up the ingestion, but nothing happens on the query side. It's also possible to implement some range query optimizer to use the range information to do some data skipping as well.
   I am not quite sure if we should move forward with this patch or we should aim for a bigger picture with a comprehensive range partition design. cc: @nsivabalan 




-- 
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.

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