[
https://issues.apache.org/jira/browse/HUDI-1951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17379387#comment-17379387
]
ASF GitHub Bot commented on HUDI-1951:
--------------------------------------
leesf commented on a change in pull request #3173:
URL: https://github.com/apache/hudi/pull/3173#discussion_r667940589
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/keygen/BaseKeyGenerator.java
##########
@@ -71,11 +84,25 @@ public final HoodieKey getKey(GenericRecord record) {
}).collect(Collectors.toList());
}
+ public List<String> getIndexKeyFields() {
+ return indexKeyFields;
+ }
+
public List<String> getRecordKeyFields() {
return recordKeyFields;
}
public List<String> getPartitionPathFields() {
return partitionPathFields;
}
+
+ protected void validateIndexKeyField() {
+ if (indexKeyFields.size() != 0) {
Review comment:
would indexKeyFields be empty or mandatory when using hash index?
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/commit/BaseCommitActionExecutor.java
##########
@@ -75,6 +77,11 @@ public BaseCommitActionExecutor(HoodieEngineContext context,
HoodieWriteConfig c
// TODO : Remove this once we refactor and move out autoCommit method from
here, since the TxnManager is held in {@link AbstractHoodieWriteClient}.
this.txnManager = new TransactionManager(config,
table.getMetaClient().getFs());
this.lastCompletedTxn =
TransactionUtils.getLastCompletedTxnInstantAndMetadata(table.getMetaClient());
+ // TODO: HUDI-2155 bulk insert support bucket index, HUDI-2156 cluster the
table with bucket index.
+ if (this.config.getIndexType() == HoodieIndex.IndexType.BUCKET_INDEX
+ && (operationType == WriteOperationType.BULK_INSERT || operationType
== WriteOperationType.CLUSTER)) {
+ throw new HoodieIndexException("Executor " +
this.getClass().getSimpleName() + " is not compatible with bucket index");
Review comment:
NotSupportedException would be better?
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/utils/HiveHasher.java
##########
@@ -0,0 +1,362 @@
+/*
+ * 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.utils;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+import sun.misc.Unsafe;
+
+public class HiveHasher {
Review comment:
Please rename too.
##########
File path:
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/utils/HiveHasher.java
##########
@@ -0,0 +1,362 @@
+/*
+ * 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.utils;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+import sun.misc.Unsafe;
+
+public class HiveHasher {
Review comment:
Adding tests for the Class?
##########
File path:
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/utils/TestHiveBucketUtils.java
##########
@@ -0,0 +1,62 @@
+/*
+ * 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.utils;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.LinkedList;
+
+import org.junit.jupiter.api.Test;
+
+public class TestHiveBucketUtils {
Review comment:
rename
##########
File path:
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/bucket/SparkHiveBucketIndex.java
##########
@@ -0,0 +1,179 @@
+/*
+ * 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.bucket;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.engine.HoodieEngineContext;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.model.HoodieKey;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieRecordLocation;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.table.HoodieTableConfig;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Triple;
+import org.apache.hudi.config.HoodieIndexConfig;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieIndexException;
+import org.apache.hudi.index.HoodieIndexUtils;
+import org.apache.hudi.index.SparkHoodieIndex;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.utils.BucketUtils;
+import org.apache.spark.api.java.JavaRDD;
+
+public class SparkHiveBucketIndex<T extends HoodieRecordPayload> extends
SparkHoodieIndex<T> {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(SparkHiveBucketIndex.class);
+
+ private final int numBuckets;
+
+ public SparkHiveBucketIndex(HoodieWriteConfig config) {
+ super(config);
+ String tableNumBucket = config.getProps()
+ .getProperty(HoodieTableConfig.HOODIE_TABLE_NUM_BUCKETS.key());
+ String indexNumBucket = config.getProps()
+ .getProperty(HoodieIndexConfig.BUCKET_INDEX_BUCKET_NUM.key());
+ if (tableNumBucket == null && indexNumBucket == null) {
+ throw new IllegalArgumentException(
+ "Please set hoodie.index.hive.bucket.num or
hoodie.table.numbuckets(deprecated) to a positive integer.");
Review comment:
hoodie.table.numbuckets is not exist? and please change
`hoodie.index.hive.bucket.num` hardcoded to config.
##########
File path:
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/bucket/SparkHiveBucketIndex.java
##########
@@ -0,0 +1,179 @@
+/*
+ * 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.bucket;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.engine.HoodieEngineContext;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.model.HoodieKey;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieRecordLocation;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.table.HoodieTableConfig;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Triple;
+import org.apache.hudi.config.HoodieIndexConfig;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieIndexException;
+import org.apache.hudi.index.HoodieIndexUtils;
+import org.apache.hudi.index.SparkHoodieIndex;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.utils.BucketUtils;
+import org.apache.spark.api.java.JavaRDD;
+
+public class SparkHiveBucketIndex<T extends HoodieRecordPayload> extends
SparkHoodieIndex<T> {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(SparkHiveBucketIndex.class);
+
+ private final int numBuckets;
+
+ public SparkHiveBucketIndex(HoodieWriteConfig config) {
+ super(config);
+ String tableNumBucket = config.getProps()
+ .getProperty(HoodieTableConfig.HOODIE_TABLE_NUM_BUCKETS.key());
+ String indexNumBucket = config.getProps()
+ .getProperty(HoodieIndexConfig.BUCKET_INDEX_BUCKET_NUM.key());
+ if (tableNumBucket == null && indexNumBucket == null) {
+ throw new IllegalArgumentException(
+ "Please set hoodie.index.hive.bucket.num or
hoodie.table.numbuckets(deprecated) to a positive integer.");
+ }
+ this.numBuckets = Integer.parseInt(indexNumBucket != null ? indexNumBucket
: tableNumBucket);
+ LOG.info("use hive bucket index, numBuckets={}", numBuckets);
Review comment:
hive -> hudi
##########
File path:
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/index/bucket/SparkHiveBucketIndex.java
##########
@@ -0,0 +1,179 @@
+/*
+ * 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.bucket;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.hudi.client.WriteStatus;
+import org.apache.hudi.common.engine.HoodieEngineContext;
+import org.apache.hudi.common.model.HoodieBaseFile;
+import org.apache.hudi.common.model.HoodieKey;
+import org.apache.hudi.common.model.HoodieRecord;
+import org.apache.hudi.common.model.HoodieRecordLocation;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.table.HoodieTableConfig;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Triple;
+import org.apache.hudi.config.HoodieIndexConfig;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieIndexException;
+import org.apache.hudi.index.HoodieIndexUtils;
+import org.apache.hudi.index.SparkHoodieIndex;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.utils.BucketUtils;
+import org.apache.spark.api.java.JavaRDD;
+
+public class SparkHiveBucketIndex<T extends HoodieRecordPayload> extends
SparkHoodieIndex<T> {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(SparkHiveBucketIndex.class);
+
+ private final int numBuckets;
+
+ public SparkHiveBucketIndex(HoodieWriteConfig config) {
+ super(config);
+ String tableNumBucket = config.getProps()
+ .getProperty(HoodieTableConfig.HOODIE_TABLE_NUM_BUCKETS.key());
+ String indexNumBucket = config.getProps()
+ .getProperty(HoodieIndexConfig.BUCKET_INDEX_BUCKET_NUM.key());
+ if (tableNumBucket == null && indexNumBucket == null) {
+ throw new IllegalArgumentException(
+ "Please set hoodie.index.hive.bucket.num or
hoodie.table.numbuckets(deprecated) to a positive integer.");
+ }
+ this.numBuckets = Integer.parseInt(indexNumBucket != null ? indexNumBucket
: tableNumBucket);
+ LOG.info("use hive bucket index, numBuckets={}", numBuckets);
+ }
+
+ @Override
+ public JavaRDD<WriteStatus> updateLocation(JavaRDD<WriteStatus>
writeStatusRDD,
+ HoodieEngineContext context,
+ HoodieTable<T, JavaRDD<HoodieRecord<T>>, JavaRDD<HoodieKey>,
JavaRDD<WriteStatus>> hoodieTable)
+ throws HoodieIndexException {
+ return writeStatusRDD;
+ }
+
+ @Override
+ public JavaRDD<HoodieRecord<T>> tagLocation(JavaRDD<HoodieRecord<T>> records,
+ HoodieEngineContext context,
+ HoodieTable<T, JavaRDD<HoodieRecord<T>>, JavaRDD<HoodieKey>,
JavaRDD<WriteStatus>> hoodieTable)
+ throws HoodieIndexException {
+ List<String> partitions = records.map(HoodieRecord::getPartitionPath)
+ .distinct().collect();
+ Map<String, Map<Integer, List<Triple<String, String, String>>>>
partitionPathFileIDList =
+ loadPartitionBucketIdFileIdMapping(
+ context, hoodieTable, partitions);
+
+ if (partitionPathFileIDList.isEmpty()) {
+ // first write
+ return records;
+ }
+
+ JavaRDD<HoodieRecord<T>> taggedRecordRDD = records.map(record -> {
+ int bucketId = BucketUtils.bucketId(record.getKey().getIndexKey(),
numBuckets);
+ String partitionPath = record.getPartitionPath();
+ if (partitionPathFileIDList.containsKey(partitionPath)) {
+ if (partitionPathFileIDList.get(partitionPath).containsKey(bucketId)) {
+ Triple<String, String, String> triple = partitionPathFileIDList
+ .get(partitionPath)
+ .get(bucketId).get(0);
+ String fileId = triple.getMiddle();
+ String instanceTime = triple.getRight();
+ HoodieRecordLocation loc = new HoodieRecordLocation(instanceTime,
fileId);
+ return HoodieIndexUtils.getTaggedRecord(record, Option.of(loc));
+ }
+ }
+ return record;
+ });
+
+ return taggedRecordRDD;
+ }
+
+ @NotNull
+ private Map<String, Map<Integer, List<Triple<String, String, String>>>>
loadPartitionBucketIdFileIdMapping(
+ HoodieEngineContext context,
+ HoodieTable<T, JavaRDD<HoodieRecord<T>>, JavaRDD<HoodieKey>,
JavaRDD<WriteStatus>> hoodieTable,
+ List<String> partitions) {
+ // partitionPath -> bucketId -> fileIds
+ Map<String, Map<Integer, List<Triple<String, String, String>>>>
partitionPathFileIDList = new HashMap<>();
+ HoodieIndexUtils
+ .getLatestBaseFilesForAllPartitions(partitions, context, hoodieTable)
+ .forEach(pair -> {
+ String partitionPath = pair.getLeft();
+ HoodieBaseFile file = pair.getRight();
+ String fileId = file.getFileId();
+ String commitTime = file.getCommitTime();
+ int bucketId = BucketUtils.bucketIdFromFileId(fileId);
+ if (!partitionPathFileIDList.containsKey(partitionPath)) {
+ partitionPathFileIDList.put(partitionPath, new HashMap<>());
+ }
+ if
(!partitionPathFileIDList.get(partitionPath).containsKey(bucketId)) {
+ partitionPathFileIDList.get(partitionPath).put(bucketId, new
ArrayList<>());
+ }
+ partitionPathFileIDList.get(partitionPath).get(bucketId)
+ .add(Triple.of(partitionPath, fileId, commitTime));
+ });
+ // check if bucket data is valid
+ partitionPathFileIDList
+ .forEach((partitionPath, value) -> value.forEach((bucketId, value1) ->
{
+ if (value1.size() > 1) {
+ throw new RuntimeException("find multiple files at partition path="
+ + partitionPath + " belongs to the same bucket id = " +
bucketId);
+ }
+ }));
+ return partitionPathFileIDList;
+ }
+
+ @Override
+ public boolean rollbackCommit(String instantTime) {
+ return true;
+ }
+
+ @Override
+ public boolean isGlobal() {
+ return false;
+ }
+
+ @Override
+ public boolean canIndexLogFiles() {
+ // for hive bucket index, it's not safe to send inserts(new data in one
file group) to log files
Review comment:
rename hive
##########
File path:
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/SparkHiveBucketPartitioner.java
##########
@@ -0,0 +1,134 @@
+/*
+ * 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.table.action.commit;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import scala.Tuple2;
+
+import org.apache.hudi.common.engine.HoodieEngineContext;
+import org.apache.hudi.common.model.HoodieKey;
+import org.apache.hudi.common.model.HoodieRecordLocation;
+import org.apache.hudi.common.model.HoodieRecordPayload;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.config.HoodieWriteConfig;
+import org.apache.hudi.exception.HoodieException;
+import org.apache.hudi.index.bucket.SparkHiveBucketIndex;
+import org.apache.hudi.table.HoodieTable;
+import org.apache.hudi.table.WorkloadProfile;
+import org.apache.hudi.table.WorkloadStat;
+import org.apache.hudi.utils.BucketUtils;
+
+/**
+ * TODO: pruning empty task partitions.
+ *
+ * @param <T>
+ */
+public class SparkHiveBucketPartitioner<T extends HoodieRecordPayload<T>>
extends
Review comment:
rename
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java
##########
@@ -140,6 +140,12 @@
public static final String NO_OP_BOOTSTRAP_INDEX_CLASS =
NoOpBootstrapIndex.class.getName();
+ public static final ConfigProperty<String> HOODIE_TABLE_NUM_BUCKETS =
ConfigProperty
Review comment:
why not reuse `hoodie.bucket.index.bucket.num`?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java
##########
@@ -45,8 +45,9 @@
* The current version of the log block. Anytime the logBlock format changes
this version needs to be bumped and
* corresponding changes need to be made to {@link HoodieLogBlockVersion}
TODO : Change this to a class, something
* like HoodieLogBlockVersionV1/V2 and implement/override operations there
+ * BD version starts from 1000 to avoid conflict wth community.
*/
- public static int version = 1;
+ public static int version = 1000;
Review comment:
why need this change?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java
##########
@@ -45,8 +45,9 @@
* The current version of the log block. Anytime the logBlock format changes
this version needs to be bumped and
* corresponding changes need to be made to {@link HoodieLogBlockVersion}
TODO : Change this to a class, something
* like HoodieLogBlockVersionV1/V2 and implement/override operations there
+ * BD version starts from 1000 to avoid conflict wth community.
*/
- public static int version = 1;
+ public static int version = 1000;
Review comment:
why change to 1000?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/serializer/HoodieKeyV1Serializer.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.common.util.serializer;
+
+import com.esotericsoftware.kryo.Kryo;
+import com.esotericsoftware.kryo.Serializer;
+import com.esotericsoftware.kryo.io.Input;
+import com.esotericsoftware.kryo.io.Output;
+import
com.esotericsoftware.kryo.serializers.DefaultSerializers.StringSerializer;
+
+import org.apache.hudi.common.model.HoodieKey;
+
+/**
+ * Serializer for HoodieKey V1.
+ */
+public class HoodieKeyV1Serializer extends Serializer {
Review comment:
should we also introduce HoodieKeyV2Serializer?
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/util/serializer/HoodieKeyV1Serializer.java
##########
@@ -0,0 +1,45 @@
+/*
+ * 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.common.util.serializer;
+
+import com.esotericsoftware.kryo.Kryo;
+import com.esotericsoftware.kryo.Serializer;
+import com.esotericsoftware.kryo.io.Input;
+import com.esotericsoftware.kryo.io.Output;
+import
com.esotericsoftware.kryo.serializers.DefaultSerializers.StringSerializer;
+
+import org.apache.hudi.common.model.HoodieKey;
+
+/**
+ * Serializer for HoodieKey V1.
+ */
+public class HoodieKeyV1Serializer extends Serializer {
Review comment:
should we also introduce HoodieKeyV2Serialize accordingly?
--
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]
> Hash Index for HUDI
> -------------------
>
> Key: HUDI-1951
> URL: https://issues.apache.org/jira/browse/HUDI-1951
> Project: Apache Hudi
> Issue Type: New Feature
> Reporter: XiaoyuGeng
> Assignee: XiaoyuGeng
> Priority: Major
> Labels: pull-request-available
>
> https://cwiki.apache.org/confluence/display/HUDI/RFC+-+29%3A+Hash+Index
--
This message was sent by Atlassian Jira
(v8.3.4#803005)