@Component public class Hive13DdlGenerator extends DdlGenerator
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_HIVE_FILE_FORMAT
Hive file format for JSON files.
|
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 |
REGEX_S3_EMPTY_PARTITION
The regular expression that represents an empty partition in S3, this is because hadoop file system implements directory support in S3 by creating empty
files with the "directoryname_$folder$" suffix.
|
static String |
TEXT_HIVE_FILE_FORMAT
Hive file format for text files.
|
NON_PARTITIONED_TABLE_LOCATION_CUSTOM_DDL_TOKEN, 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.
|
String |
generateCreateTableDdl(BusinessObjectDataDdlRequest request,
BusinessObjectFormatEntity businessObjectFormatEntity,
CustomDdlEntity customDdlEntity,
BusinessObjectDataStatusEntity businessObjectDataStatusEntity,
List<String> storageNames,
List<StorageEntity> requestedStorageEntities,
Map<String,StorageEntity> cachedStorageEntities,
Map<String,String> cachedS3BucketNames)
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.
|
String |
getHivePathRegex(List<SchemaColumn> partitionColumns)
Gets a regex to match Hive partition sub-directories.
|
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 static final String JSON_HIVE_FILE_FORMAT
public static final String REGEX_S3_EMPTY_PARTITION
public String escapeSingleQuotes(String string)
string - the input textpublic String generateCreateTableDdl(BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity, CustomDdlEntity customDdlEntity, BusinessObjectDataStatusEntity businessObjectDataStatusEntity, List<String> storageNames, List<StorageEntity> requestedStorageEntities, Map<String,StorageEntity> cachedStorageEntities, Map<String,String> cachedS3BucketNames)
generateCreateTableDdl in class DdlGeneratorrequest - the business object data DDL requestbusinessObjectFormatEntity - the business object format entitycustomDdlEntity - the optional custom DDL entitybusinessObjectDataStatusEntity - the business object data status for available business object datastorageNames - the list of storage namesrequestedStorageEntities - the list of storage entities per storage names specified in the requestcachedStorageEntities - the map of storage names in upper case to the relative storage entitiescachedS3BucketNames - 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 columnspublic String getHivePathRegex(List<SchemaColumn> partitionColumns)
partitionColumns - the list of partition columnsCopyright © 2021. All rights reserved.