Class HiveUtil

java.lang.Object
io.trino.plugin.hive.util.HiveUtil

public final class HiveUtil extends Object
  • Field Details

  • Method Details

    • splitError

      public static String splitError(Throwable t, Location location, long start, long length)
    • createRecordReader

      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)
    • getCompressionCodec

      public static Optional<org.apache.hadoop.io.compress.CompressionCodec> getCompressionCodec(org.apache.hadoop.mapred.TextInputFormat inputFormat, String file)
    • getInputFormat

      public static org.apache.hadoop.mapred.InputFormat<?,?> getInputFormat(org.apache.hadoop.conf.Configuration configuration, Properties schema, boolean symlinkTarget)
    • getInputFormatName

      public static String getInputFormatName(Properties schema)
    • parseHiveTimestamp

      public static long parseHiveTimestamp(String value)
    • isSplittable

      public static boolean isSplittable(org.apache.hadoop.mapred.InputFormat<?,?> inputFormat, org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path path)
    • getTableObjectInspector

      public static org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector getTableObjectInspector(org.apache.hadoop.hive.serde2.Deserializer deserializer)
    • getDeserializerClassName

      public static String getDeserializerClassName(Properties schema)
    • getDeserializer

      public static org.apache.hadoop.hive.serde2.Deserializer getDeserializer(org.apache.hadoop.conf.Configuration configuration, Properties schema)
    • verifyPartitionTypeSupported

      public static void verifyPartitionTypeSupported(String partitionName, Type type)
    • parsePartitionValue

      public static NullableValue parsePartitionValue(String partitionName, String value, Type type)
    • isStructuralType

      public static boolean isStructuralType(Type type)
    • hiveColumnHandles

      public static List<HiveColumnHandle> hiveColumnHandles(Table table, TypeManager typeManager, HiveTimestampPrecision timestampPrecision)
    • getRegularColumnHandles

      public static List<HiveColumnHandle> getRegularColumnHandles(Table table, TypeManager typeManager, HiveTimestampPrecision timestampPrecision)
    • getPartitionKeyColumnHandles

      public static List<HiveColumnHandle> getPartitionKeyColumnHandles(Table table, TypeManager typeManager)
    • checkCondition

      public static void checkCondition(boolean condition, ErrorCodeSupplier errorCode, String formatString, Object... args)
    • columnExtraInfo

      @Nullable public static String columnExtraInfo(boolean partitionKey)
    • toPartitionValues

      public static List<String> toPartitionValues(String partitionName)
    • getPrefilledColumnValue

      public static NullableValue getPrefilledColumnValue(HiveColumnHandle columnHandle, HivePartitionKey partitionKey, String path, OptionalInt bucketNumber, long fileSize, long fileModifiedTime, String partitionName)
    • extractStructFieldTypes

      public static List<HiveType> extractStructFieldTypes(HiveType hiveType)
    • getHeaderCount

      public static int getHeaderCount(Properties schema)
    • getFooterCount

      public static int getFooterCount(Properties schema)
    • getColumnNames

      public static List<String> getColumnNames(Properties schema)
    • getColumnTypes

      public static List<HiveType> getColumnTypes(Properties schema)
    • getOrcWriterOptions

      public static OrcWriterOptions getOrcWriterOptions(Properties schema, OrcWriterOptions orcWriterOptions)
    • sortingColumnFromString

      public static SortingColumn sortingColumnFromString(String name)
    • sortingColumnToString

      public static String sortingColumnToString(SortingColumn column)
    • isHiveSystemSchema

      public static boolean isHiveSystemSchema(String schemaName)
    • isDeltaLakeTable

      public static boolean isDeltaLakeTable(Table table)
    • isDeltaLakeTable

      public static boolean isDeltaLakeTable(Map<String,String> tableParameters)
    • isIcebergTable

      public static boolean isIcebergTable(Table table)
    • isIcebergTable

      public static boolean isIcebergTable(Map<String,String> tableParameters)
    • isHudiTable

      public static boolean isHudiTable(Table table)
    • isSparkBucketedTable

      public static boolean isSparkBucketedTable(Table table)
    • columnMetadataGetter

      public static Function<HiveColumnHandle,ColumnMetadata> columnMetadataGetter(Table table)
    • unescapePathName

      public static String unescapePathName(String path)
    • escapeSchemaName

      public static String escapeSchemaName(String schemaName)
    • escapeTableName

      public static String escapeTableName(String tableName)
    • escapePathName

      public static String escapePathName(String path)
    • makePartName

      public static String makePartName(List<String> columns, List<String> values)