Package io.trino.plugin.hive.util
Class HiveWriteUtils
java.lang.Object
io.trino.plugin.hive.util.HiveWriteUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) 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 LocationcreateTemporaryPath(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path targetPath, String temporaryStagingDirectoryPath) static Objectstatic 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.hive.serde2.objectinspector.ObjectInspectorgetRowColumnInspector(Type type) static List<org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector>getRowColumnInspectors(List<Type> types) static LocationgetTableDefaultLocation(HdfsContext context, SemiTransactionalHiveMetastore metastore, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName) static LocationgetTableDefaultLocation(Database database, 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(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) static booleanisS3FileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) static booleanisViewFileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) static booleanisWritableType(HiveType hiveType) static booleanpathExists(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path)
-
Method Details
-
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
-
getField
-
checkTableIsWritable
-
checkPartitionIsWritable
-
getTableDefaultLocation
public static Location getTableDefaultLocation(HdfsContext context, SemiTransactionalHiveMetastore metastore, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName) -
getTableDefaultLocation
public static Location getTableDefaultLocation(Database database, HdfsContext context, HdfsEnvironment hdfsEnvironment, String schemaName, String tableName) -
pathExists
public static boolean pathExists(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) -
isS3FileSystem
public static boolean isS3FileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) -
isViewFileSystem
public static boolean isViewFileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) -
isHdfsEncrypted
public static boolean isHdfsEncrypted(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path path) -
isFileCreatedByQuery
-
createTemporaryPath
public static Location createTemporaryPath(HdfsContext context, HdfsEnvironment hdfsEnvironment, org.apache.hadoop.fs.Path targetPath, String temporaryStagingDirectoryPath) -
createDirectory
public static void createDirectory(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
-
getRowColumnInspectors
-
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)
-