public final class HiveUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PRESTO_VIEW_FLAG |
| Modifier and Type | Method and Description |
|---|---|
static long |
bigintPartitionKey(String value,
String name) |
static boolean |
booleanPartitionKey(String value,
String name) |
static ConnectorViewDefinition |
buildHiveViewConnectorDefinition(CatalogName catalogName,
Table view) |
static io.airlift.slice.Slice |
charPartitionKey(String value,
String name,
Type columnType) |
static void |
checkCondition(boolean condition,
ErrorCodeSupplier errorCode,
String formatString,
Object... args) |
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,
org.apache.hadoop.fs.Path path,
long start,
long length,
Properties schema,
List<HiveColumnHandle> columns) |
static long |
datePartitionKey(String value,
String name) |
static ConnectorViewDefinition |
decodeViewData(String data) |
static double |
doublePartitionKey(String value,
String name) |
static String |
encodeViewData(ConnectorViewDefinition definition) |
static List<HiveType> |
extractStructFieldTypes(HiveType hiveType) |
static long |
floatPartitionKey(String value,
String name) |
static List<String> |
getColumnNames(Properties schema) |
static List<HiveType> |
getColumnTypes(Properties schema) |
static Optional<org.apache.hadoop.io.compress.CompressionCodec> |
getCompressionCodec(org.apache.hadoop.mapred.TextInputFormat inputFormat,
org.apache.hadoop.fs.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,
Properties schema,
boolean symlinkTarget) |
static String |
getInputFormatName(Properties schema) |
static List<HiveColumnHandle> |
getPartitionKeyColumnHandles(Table table,
TypeManager typeManager) |
static String |
getPrefilledColumnValue(HiveColumnHandle columnHandle,
HivePartitionKey partitionKey,
org.apache.hadoop.fs.Path path,
OptionalInt bucketNumber,
long fileSize,
long fileModifiedTime) |
static List<HiveColumnHandle> |
getRegularColumnHandles(Table table,
TypeManager typeManager) |
static org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector |
getTableObjectInspector(org.apache.hadoop.hive.serde2.Deserializer deserializer) |
static List<HiveColumnHandle> |
hiveColumnHandles(Table table,
TypeManager typeManager) |
static long |
integerPartitionKey(String value,
String name) |
static boolean |
isArrayType(Type type) |
static boolean |
isDeserializerClass(Properties schema,
Class<?> deserializerClass) |
static boolean |
isHiveNull(byte[] bytes) |
static boolean |
isMapType(Type type) |
static boolean |
isPrestoView(Table table) |
static boolean |
isRowType(Type type) |
static boolean |
isSplittable(org.apache.hadoop.mapred.InputFormat<?,?> inputFormat,
org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.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 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,
boolean shouldPackWithTimeZone) |
static long |
tinyintPartitionKey(String value,
String name) |
static List<String> |
toPartitionValues(String partitionName) |
static io.airlift.slice.Slice |
varcharPartitionKey(String value,
String name,
Type columnType) |
static void |
verifyPartitionTypeSupported(String partitionName,
Type type) |
public static final String PRESTO_VIEW_FLAG
public static org.apache.hadoop.mapred.RecordReader<?,?> createRecordReader(org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.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, org.apache.hadoop.fs.Path file)
public static org.apache.hadoop.mapred.InputFormat<?,?> getInputFormat(org.apache.hadoop.conf.Configuration configuration,
Properties schema,
boolean symlinkTarget)
public static String getInputFormatName(Properties schema)
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,
org.apache.hadoop.fs.FileSystem fileSystem,
org.apache.hadoop.fs.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 boolean isPrestoView(Table table)
public static String encodeViewData(ConnectorViewDefinition definition)
public static ConnectorViewDefinition decodeViewData(String data)
public static ConnectorViewDefinition buildHiveViewConnectorDefinition(CatalogName catalogName, Table view)
public static Optional<DecimalType> getDecimalType(HiveType hiveType)
public static Optional<DecimalType> getDecimalType(String hiveTypeName)
public static boolean isArrayType(Type type)
public static boolean isMapType(Type type)
public static boolean isRowType(Type type)
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, boolean shouldPackWithTimeZone)
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, TypeManager typeManager)
public static List<HiveColumnHandle> getRegularColumnHandles(Table table, TypeManager typeManager)
public static List<HiveColumnHandle> getPartitionKeyColumnHandles(Table table, TypeManager typeManager)
public static void checkCondition(boolean condition,
ErrorCodeSupplier errorCode,
String formatString,
Object... args)
public static String getPrefilledColumnValue(HiveColumnHandle columnHandle, HivePartitionKey partitionKey, org.apache.hadoop.fs.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 List<String> getColumnNames(Properties schema)
public static List<HiveType> getColumnTypes(Properties schema)
Copyright © 2012–2020. All rights reserved.