public final class HiveUtil extends Object
Modifier and Type | Method and Description |
---|---|
static long |
bigintPartitionKey(String value,
String name) |
static boolean |
booleanPartitionKey(String value,
String name) |
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) |
static long |
datePartitionKey(String value,
String name) |
static String |
decodeViewData(String data) |
static double |
doublePartitionKey(String value,
String name) |
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 List<HiveColumnHandle> |
getPartitionKeyColumnHandles(Table table) |
static List<HiveColumnHandle> |
getPhysicalHiveColumnHandles(List<HiveColumnHandle> columns,
boolean useOrcColumnNames,
OrcReader reader,
Path path) |
static String |
getPrefilledColumnValue(HiveColumnHandle columnHandle,
HivePartitionKey partitionKey,
Path path,
OptionalInt bucketNumber) |
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(String partitionName,
String value,
Type type,
org.joda.time.DateTimeZone timeZone) |
static SchemaTableName |
schemaTableName(ConnectorTableHandle tableHandle) |
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 org.apache.hadoop.mapred.RecordReader<?,?> createRecordReader(org.apache.hadoop.conf.Configuration configuration, Path path, long start, long length, Properties schema, List<HiveColumnHandle> columns)
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 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(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 SchemaTableName schemaTableName(ConnectorTableHandle tableHandle)
public static List<HiveColumnHandle> hiveColumnHandles(Table table)
public static List<HiveColumnHandle> getRegularColumnHandles(Table table)
public static List<HiveColumnHandle> getPartitionKeyColumnHandles(Table table)
public static String getPrefilledColumnValue(HiveColumnHandle columnHandle, HivePartitionKey partitionKey, Path path, OptionalInt bucketNumber)
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, OrcReader reader, Path path)
public static List<ColumnMetadata> translateHiveUnsupportedTypesForTemporaryTable(List<ColumnMetadata> columns, TypeManager typeManager)
public static Type translateHiveUnsupportedTypeForTemporaryTable(Type type, TypeManager typeManager)
Copyright © 2012–2020. All rights reserved.