public final class HiveUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CUSTOM_FILE_SPLIT_CLASS_KEY |
static String |
PRESTO_CLIENT_INFO |
static String |
PRESTO_METASTORE_HEADER |
static String |
PRESTO_QUERY_ID |
static String |
PRESTO_QUERY_SOURCE |
static String |
PRESTO_USER_NAME |
Modifier and Type | Method and Description |
---|---|
static long |
bigintPartitionKey(String value,
String name) |
static boolean |
booleanPartitionKey(String value,
String name) |
static Map<String,String> |
buildDirectoryContextProperties(ConnectorSession session) |
static io.airlift.slice.Slice |
charPartitionKey(String value,
String name,
Type columnType) |
static void |
closeWithSuppression(RecordCursor recordCursor,
Throwable throwable) |
static String |
columnExtraInfo(boolean partitionKey) |
static org.apache.hadoop.mapred.RecordReader<?,?> |
createRecordReader(org.apache.hadoop.conf.Configuration configuration,
Path path,
long start,
long length,
Properties schema,
List<HiveColumnHandle> columns,
Map<String,String> customSplitInfo) |
static long |
datePartitionKey(String value,
String name) |
static String |
decodeMaterializedViewData(String data) |
static String |
decodeViewData(String data) |
static <T> T |
deserializeZstdCompressed(com.facebook.airlift.json.Codec<T> codec,
byte[] bytes) |
static double |
doublePartitionKey(String value,
String name) |
static String |
encodeMaterializedViewData(String data) |
static String |
encodeViewData(String data) |
static List<String> |
extractStructFieldNames(HiveType hiveType) |
static List<HiveType> |
extractStructFieldTypes(HiveType hiveType) |
static long |
floatPartitionKey(String value,
String name) |
static Optional<org.apache.hadoop.io.compress.CompressionCodec> |
getCompressionCodec(org.apache.hadoop.mapred.TextInputFormat inputFormat,
Path file) |
static Optional<DecimalType> |
getDecimalType(HiveType hiveType) |
static Optional<DecimalType> |
getDecimalType(String hiveTypeName) |
static org.apache.hadoop.hive.serde2.Deserializer |
getDeserializer(org.apache.hadoop.conf.Configuration configuration,
Properties schema) |
static String |
getDeserializerClassName(Properties schema) |
static int |
getFooterCount(Properties schema) |
static int |
getHeaderCount(Properties schema) |
static org.apache.hadoop.mapred.InputFormat<?,?> |
getInputFormat(org.apache.hadoop.conf.Configuration configuration,
String inputFormatName,
boolean symlinkTarget) |
static List<HiveColumnHandle> |
getPartitionKeyColumnHandles(Table table) |
static List<HiveColumnHandle> |
getPhysicalHiveColumnHandles(List<HiveColumnHandle> columns,
boolean useOrcColumnNames,
List<OrcType> types,
Path path) |
static Optional<String> |
getPrefilledColumnValue(HiveColumnHandle columnHandle,
HivePartitionKey partitionKey,
Path path,
OptionalInt bucketNumber,
long fileSize,
long fileModifiedTime) |
static List<HiveColumnHandle> |
getRegularColumnHandles(Table table) |
static org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector |
getTableObjectInspector(org.apache.hadoop.hive.serde2.Deserializer deserializer) |
static List<HiveColumnHandle> |
hiveColumnHandles(Table table) |
static long |
integerPartitionKey(String value,
String name) |
static boolean |
isDeserializerClass(Properties schema,
Class<?> deserializerClass) |
static boolean |
isHiveNull(byte[] bytes) |
static boolean |
isSplittable(org.apache.hadoop.mapred.InputFormat<?,?> inputFormat,
FileSystem fileSystem,
Path path) |
static boolean |
isStructuralType(HiveType hiveType) |
static boolean |
isStructuralType(Type type) |
static io.airlift.slice.Slice |
longDecimalPartitionKey(String value,
DecimalType type,
String name) |
static long |
parseHiveDate(String value) |
static long |
parseHiveTimestamp(String value,
org.joda.time.DateTimeZone timeZone) |
static NullableValue |
parsePartitionValue(HivePartitionKey key,
Type type,
org.joda.time.DateTimeZone timeZone) |
static NullableValue |
parsePartitionValue(String partitionName,
String value,
Type type,
org.joda.time.DateTimeZone timeZone) |
static <T> byte[] |
serializeZstdCompressed(com.facebook.airlift.json.Codec<T> codec,
T instance) |
static void |
setReadColumns(org.apache.hadoop.conf.Configuration configuration,
List<Integer> readHiveColumnIndexes) |
static long |
shortDecimalPartitionKey(String value,
DecimalType type,
String name) |
static long |
smallintPartitionKey(String value,
String name) |
static long |
timestampPartitionKey(String value,
org.joda.time.DateTimeZone zone,
String name) |
static long |
tinyintPartitionKey(String value,
String name) |
static Type |
translateHiveUnsupportedTypeForTemporaryTable(Type type,
TypeManager typeManager) |
static List<ColumnMetadata> |
translateHiveUnsupportedTypesForTemporaryTable(List<ColumnMetadata> columns,
TypeManager typeManager)
Translates Presto type that is incompatible (cannot be stored in a Hive table) to a compatible type with the same physical layout.
|
static Object |
typedPartitionKey(String value,
Type type,
String name,
org.joda.time.DateTimeZone hiveStorageTimeZone) |
static io.airlift.slice.Slice |
varcharPartitionKey(String value,
String name,
Type columnType) |
static void |
verifyPartitionTypeSupported(String partitionName,
Type type) |
public static final String CUSTOM_FILE_SPLIT_CLASS_KEY
public static final String PRESTO_QUERY_ID
public static final String PRESTO_QUERY_SOURCE
public static final String PRESTO_CLIENT_INFO
public static final String PRESTO_USER_NAME
public static final String PRESTO_METASTORE_HEADER
public static org.apache.hadoop.mapred.RecordReader<?,?> createRecordReader(org.apache.hadoop.conf.Configuration configuration, Path path, long start, long length, Properties schema, List<HiveColumnHandle> columns, Map<String,String> customSplitInfo)
public static void setReadColumns(org.apache.hadoop.conf.Configuration configuration, List<Integer> readHiveColumnIndexes)
public static Optional<org.apache.hadoop.io.compress.CompressionCodec> getCompressionCodec(org.apache.hadoop.mapred.TextInputFormat inputFormat, Path file)
public static org.apache.hadoop.mapred.InputFormat<?,?> getInputFormat(org.apache.hadoop.conf.Configuration configuration, String inputFormatName, boolean symlinkTarget)
public static long parseHiveDate(String value)
public static long parseHiveTimestamp(String value, org.joda.time.DateTimeZone timeZone)
public static boolean isSplittable(org.apache.hadoop.mapred.InputFormat<?,?> inputFormat, FileSystem fileSystem, Path path)
public static org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector getTableObjectInspector(org.apache.hadoop.hive.serde2.Deserializer deserializer)
public static boolean isDeserializerClass(Properties schema, Class<?> deserializerClass)
public static String getDeserializerClassName(Properties schema)
public static org.apache.hadoop.hive.serde2.Deserializer getDeserializer(org.apache.hadoop.conf.Configuration configuration, Properties schema)
public static boolean isHiveNull(byte[] bytes)
public static void verifyPartitionTypeSupported(String partitionName, Type type)
public static NullableValue parsePartitionValue(HivePartitionKey key, Type type, org.joda.time.DateTimeZone timeZone)
public static NullableValue parsePartitionValue(String partitionName, String value, Type type, org.joda.time.DateTimeZone timeZone)
public static Optional<DecimalType> getDecimalType(HiveType hiveType)
public static Optional<DecimalType> getDecimalType(String hiveTypeName)
public static boolean isStructuralType(Type type)
public static boolean isStructuralType(HiveType hiveType)
public static long timestampPartitionKey(String value, org.joda.time.DateTimeZone zone, String name)
public static long shortDecimalPartitionKey(String value, DecimalType type, String name)
public static io.airlift.slice.Slice longDecimalPartitionKey(String value, DecimalType type, String name)
public static io.airlift.slice.Slice varcharPartitionKey(String value, String name, Type columnType)
public static io.airlift.slice.Slice charPartitionKey(String value, String name, Type columnType)
public static List<HiveColumnHandle> hiveColumnHandles(Table table)
public static List<HiveColumnHandle> getRegularColumnHandles(Table table)
public static List<HiveColumnHandle> getPartitionKeyColumnHandles(Table table)
public static Optional<String> getPrefilledColumnValue(HiveColumnHandle columnHandle, HivePartitionKey partitionKey, Path path, OptionalInt bucketNumber, long fileSize, long fileModifiedTime)
public static void closeWithSuppression(RecordCursor recordCursor, Throwable throwable)
public static int getHeaderCount(Properties schema)
public static int getFooterCount(Properties schema)
public static Object typedPartitionKey(String value, Type type, String name, org.joda.time.DateTimeZone hiveStorageTimeZone)
public static List<HiveColumnHandle> getPhysicalHiveColumnHandles(List<HiveColumnHandle> columns, boolean useOrcColumnNames, List<OrcType> types, Path path)
public static List<ColumnMetadata> translateHiveUnsupportedTypesForTemporaryTable(List<ColumnMetadata> columns, TypeManager typeManager)
public static Type translateHiveUnsupportedTypeForTemporaryTable(Type type, TypeManager typeManager)
public static <T> byte[] serializeZstdCompressed(com.facebook.airlift.json.Codec<T> codec, T instance)
public static <T> T deserializeZstdCompressed(com.facebook.airlift.json.Codec<T> codec, byte[] bytes)
public static Map<String,String> buildDirectoryContextProperties(ConnectorSession session)
Copyright © 2012–2022. All rights reserved.