public class CustomAvroKeyGenerator extends BaseKeyGenerator
properties.put("hoodie.datasource.write.partitionpath.field", "field1:PartitionKeyType1,field2:PartitionKeyType2").
The complete partition path is created as
Few points to consider: 1. If you want to customize some partition path field on a timestamp basis, you can use field1:timestampBased 2. If you simply want to have the value of your configured
field in the partition path, use field1:simple 3. If you want your table to be non partitioned, simply leave it as blank.
RecordKey is internally generated using either SimpleKeyGenerator or ComplexKeyGenerator.
| Modifier and Type | Class and Description |
|---|---|
static class |
CustomAvroKeyGenerator.PartitionKeyType
Used as a part of config in CustomKeyGenerator.java.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
SPLIT_REGEX |
consistentLogicalTimestampEnabled, encodePartitionPath, hiveStylePartitioning, partitionPathFields, recordKeyFieldsconfig| Constructor and Description |
|---|
CustomAvroKeyGenerator(TypedProperties props) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultPartitionPathSeparator() |
String |
getPartitionPath(org.apache.avro.generic.GenericRecord record) |
String |
getRecordKey(org.apache.avro.generic.GenericRecord record) |
getKey, getPartitionPathFields, getRecordKeyFieldNames, getRecordKeyFields, isConsistentLogicalTimestampEnabledpublic static final String SPLIT_REGEX
public CustomAvroKeyGenerator(TypedProperties props)
public String getPartitionPath(org.apache.avro.generic.GenericRecord record)
getPartitionPath in class BaseKeyGeneratorpublic String getRecordKey(org.apache.avro.generic.GenericRecord record)
getRecordKey in class BaseKeyGeneratorpublic String getDefaultPartitionPathSeparator()
Copyright © 2022 The Apache Software Foundation. All rights reserved.