Package io.trino.plugin.hive.util
Class HiveWriteUtils
- java.lang.Object
-
- io.trino.plugin.hive.util.HiveWriteUtils
-
public final class HiveWriteUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckedDelete(org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path file, boolean recursive)static voidcheckPartitionIsWritable(String partitionName, Partition partition)static voidcheckTableIsWritable(Table table, boolean writesToNonManagedTablesEnabled)static voidcreateDirectory(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)static List<String>createPartitionValues(List<Type> partitionColumnTypes, Page partitionColumns, int position)static org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWritercreateRecordWriter(org.apache.hadoop.fs.Path target, org.apache.hadoop.mapred.JobConf conf, Properties properties, String outputFormatName, ConnectorSession session)static org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWritercreateRecordWriter(org.apache.hadoop.fs.Path target, org.apache.hadoop.mapred.JobConf conf, Properties properties, String outputFormatName, ConnectorSession session, Optional<TextHeaderWriter> textHeaderWriter)static org.apache.hadoop.fs.PathcreateTemporaryPath(ConnectorSession session, HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path targetPath)static ObjectgetField(org.joda.time.DateTimeZone localZone, Type type, Block block, int position)static org.apache.hadoop.hive.common.type.HiveDecimalgetHiveDecimal(DecimalType decimalType, Block block, int position)static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorgetJavaObjectInspector(Type type)static org.apache.hadoop.fs.FileSystemgetRawFileSystem(org.apache.hadoop.fs.FileSystem fileSystem)static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorgetRowColumnInspector(Type type)static List<org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector>getRowColumnInspectors(List<Type> types)static org.apache.hadoop.fs.PathgetTableDefaultLocation(HdfsEnvironment.HdfsContext context, SemiTransactionalHiveMetastore metastore, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName)static org.apache.hadoop.fs.PathgetTableDefaultLocation(Database database, HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName)static org.apache.hadoop.hive.serde2.SerializerinitializeSerializer(org.apache.hadoop.conf.Configuration conf, Properties properties, String serializerName)static booleanisFileCreatedByQuery(String fileName, String queryId)static booleanisHdfsEncrypted(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)static booleanisS3FileSystem(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)static booleanisViewFileSystem(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)static booleanisWritableType(HiveType hiveType)static booleanpathExists(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
-
-
Method Detail
-
createRecordWriter
public static org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter createRecordWriter(org.apache.hadoop.fs.Path target, org.apache.hadoop.mapred.JobConf conf, Properties properties, String outputFormatName, ConnectorSession session)
-
createRecordWriter
public static org.apache.hadoop.hive.ql.exec.FileSinkOperator.RecordWriter createRecordWriter(org.apache.hadoop.fs.Path target, org.apache.hadoop.mapred.JobConf conf, Properties properties, String outputFormatName, ConnectorSession session, Optional<TextHeaderWriter> textHeaderWriter)
-
initializeSerializer
public static org.apache.hadoop.hive.serde2.Serializer initializeSerializer(org.apache.hadoop.conf.Configuration conf, Properties properties, String serializerName)
-
getJavaObjectInspector
public static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getJavaObjectInspector(Type type)
-
createPartitionValues
public static List<String> createPartitionValues(List<Type> partitionColumnTypes, Page partitionColumns, int position)
-
getField
public static Object getField(org.joda.time.DateTimeZone localZone, Type type, Block block, int position)
-
checkTableIsWritable
public static void checkTableIsWritable(Table table, boolean writesToNonManagedTablesEnabled)
-
checkPartitionIsWritable
public static void checkPartitionIsWritable(String partitionName, Partition partition)
-
getTableDefaultLocation
public static org.apache.hadoop.fs.Path getTableDefaultLocation(HdfsEnvironment.HdfsContext context, SemiTransactionalHiveMetastore metastore, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName)
-
getTableDefaultLocation
public static org.apache.hadoop.fs.Path getTableDefaultLocation(Database database, HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName)
-
pathExists
public static boolean pathExists(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
isS3FileSystem
public static boolean isS3FileSystem(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
isViewFileSystem
public static boolean isViewFileSystem(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
getRawFileSystem
public static org.apache.hadoop.fs.FileSystem getRawFileSystem(org.apache.hadoop.fs.FileSystem fileSystem)
-
isHdfsEncrypted
public static boolean isHdfsEncrypted(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
createTemporaryPath
public static org.apache.hadoop.fs.Path createTemporaryPath(ConnectorSession session, HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path targetPath)
-
createDirectory
public static void createDirectory(HdfsEnvironment.HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
checkedDelete
public static void checkedDelete(org.apache.hadoop.fs.FileSystem fileSystem, org.apache.hadoop.fs.Path file, boolean recursive) throws IOException- Throws:
IOException
-
isWritableType
public static boolean isWritableType(HiveType hiveType)
-
getRowColumnInspectors
public static List<org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector> getRowColumnInspectors(List<Type> types)
-
getRowColumnInspector
public static org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector getRowColumnInspector(Type type)
-
getHiveDecimal
public static org.apache.hadoop.hive.common.type.HiveDecimal getHiveDecimal(DecimalType decimalType, Block block, int position)
-
-