@Component public class Hive13DdlGenerator extends DdlGenerator
| Modifier and Type | Field and Description |
|---|---|
static String |
NO_PARTITIONING_PARTITION_KEY
The partition key value for business object data without partitioning.
|
static String |
NO_PARTITIONING_PARTITION_VALUE
The partition value for business object data without partitioning.
|
static String |
ORC_HIVE_FILE_FORMAT
Hive file format for ORC files.
|
static String |
PARQUET_HIVE_FILE_FORMAT
Hive file format for PARQUET files.
|
static String |
TEXT_HIVE_FILE_FORMAT
Hive file format for text files.
|
NON_PARTITIONED_TABLE_LOCATION_CUSTOM_DDL_TOKEN, TABLE_NAME_CUSTOM_DDL_TOKEN| Constructor and Description |
|---|
Hive13DdlGenerator() |
| Modifier and Type | Method and Description |
|---|---|
String |
escapeSingleQuotes(String string)
Escapes single quote characters, if not already escaped, with an extra backslash.
|
protected List<StorageUnitAvailabilityDto> |
excludeDuplicateBusinessObjectData(List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos,
List<String> storageNames)
Eliminate storage units that belong to the same business object data by picking storage unit registered in a storage listed earlier in the list of
storage names specified in the request.
|
String |
generateCreateTableDdl(BusinessObjectDataDdlRequest request,
BusinessObjectFormatEntity businessObjectFormatEntity,
CustomDdlEntity customDdlEntity,
List<String> storageNames,
Map<String,StorageEntity> storageEntities,
Map<String,String> s3BucketNames)
Generates the create table Hive 13 DDL as per specified business object data DDL request.
|
String |
generateCreateTableDdl(BusinessObjectFormatDdlRequest request,
BusinessObjectFormatEntity businessObjectFormatEntity,
CustomDdlEntity customDdlEntity)
Generates the create table Hive 13 DDL as per specified business object format DDL request.
|
String |
generateReplaceColumnsStatement(BusinessObjectFormatDdlRequest request,
BusinessObjectFormatEntity businessObjectFormatEntity) |
String |
getDdlCharacterValue(String string)
Gets the DDL character value based on the specified configured character value.
|
String |
getDdlCharacterValue(String string,
boolean escapeSingleBackslash)
Gets the DDL character value based on the specified configured character value.
|
BusinessObjectDataDdlOutputFormatEnum |
getDdlOutputFormat()
Gets the supported DDL output format that this generator can support.
|
List<HivePartitionDto> |
getHivePartitions(BusinessObjectDataKey businessObjectDataKey,
List<SchemaColumn> autoDiscoverableSubPartitionColumns,
String s3KeyPrefix,
Collection<String> storageFiles,
String storageName)
Gets a list of Hive partitions.
|
Pattern |
getHivePathPattern(List<SchemaColumn> partitionColumns)
Gets a pattern to match Hive partition sub-directories.
|
protected void |
notAllowNonAvailableRegisteredSubPartitions(BusinessObjectFormatKey businessObjectFormatKey,
List<List<String>> matchedAvailablePartitionFilters,
List<List<String>> availablePartitions,
List<String> storageNames)
Searches for and fails on any of "non-available" registered sub-partitions as per list of "matched" partition filters.
|
public static final String NO_PARTITIONING_PARTITION_KEY
public static final String NO_PARTITIONING_PARTITION_VALUE
public static final String ORC_HIVE_FILE_FORMAT
public static final String PARQUET_HIVE_FILE_FORMAT
public static final String TEXT_HIVE_FILE_FORMAT
public String escapeSingleQuotes(String string)
string - the input textpublic String generateCreateTableDdl(BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity, CustomDdlEntity customDdlEntity, List<String> storageNames, Map<String,StorageEntity> storageEntities, Map<String,String> s3BucketNames)
generateCreateTableDdl in class DdlGeneratorrequest - the business object data DDL requestbusinessObjectFormatEntity - the business object format entitycustomDdlEntity - the optional custom DDL entitystorageNames - the list of storage namesstorageEntities - the map of storage names in upper case to the relative storage entitiess3BucketNames - the map of storage names in upper case to the relative S3 bucket namespublic String generateCreateTableDdl(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity, CustomDdlEntity customDdlEntity)
generateCreateTableDdl in class DdlGeneratorrequest - the business object format DDL requestbusinessObjectFormatEntity - the business object format entitycustomDdlEntity - the optional custom DDL entitypublic String generateReplaceColumnsStatement(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity)
generateReplaceColumnsStatement in class DdlGeneratorpublic String getDdlCharacterValue(String string)
string - the configured character value.public String getDdlCharacterValue(String string, boolean escapeSingleBackslash)
string - the configured character value.escapeSingleBackslash - specifies if we need to escape a single backslash character with an extra backslashpublic BusinessObjectDataDdlOutputFormatEnum getDdlOutputFormat()
DdlGeneratorgetDdlOutputFormat in class DdlGeneratorpublic List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns, String s3KeyPrefix, Collection<String> storageFiles, String storageName)
businessObjectDataKey - the business object data keyautoDiscoverableSubPartitionColumns - the auto-discoverable sub-partition columnss3KeyPrefix - the S3 key prefixstorageFiles - the storage filesstorageName - the storage namepublic Pattern getHivePathPattern(List<SchemaColumn> partitionColumns)
partitionColumns - the list of partition columnsprotected List<StorageUnitAvailabilityDto> excludeDuplicateBusinessObjectData(List<StorageUnitAvailabilityDto> storageUnitAvailabilityDtos, List<String> storageNames) throws IllegalArgumentException
storageUnitAvailabilityDtos - the list of storage unit availability DTOsstorageNames - the list of storage namesIllegalArgumentException - on business object data being registered in multiple storage and storage names are not specified to resolve thisprotected void notAllowNonAvailableRegisteredSubPartitions(BusinessObjectFormatKey businessObjectFormatKey, List<List<String>> matchedAvailablePartitionFilters, List<List<String>> availablePartitions, List<String> storageNames)
businessObjectFormatKey - the business object format keymatchedAvailablePartitionFilters - the list of "matched" partition filtersavailablePartitions - the list of already discovered "available" partitions, where each partition consists of primary and optional sub-partition
valuesstorageNames - the list of storage namesCopyright © 2019. All rights reserved.