public final class Utilities extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Utilities.CollectionPersistenceDelegate |
static class |
Utilities.MissingBucketsContext |
static class |
Utilities.PartitionDetails |
static class |
Utilities.ReduceField
ReduceField:
KEY: record key
VALUE: record value
|
static class |
Utilities.SQLCommand<T> |
static class |
Utilities.StreamStatus
StreamStatus.
|
static interface |
Utilities.SupplierWithCheckedException<T,X extends Exception> |
| Modifier and Type | Method and Description |
|---|---|
static String |
abbreviate(String str,
int max)
convert "From src insert blah blah" to "From src insert ...
|
static void |
addDependencyJars(org.apache.hadoop.conf.Configuration conf,
Class<?>... classes)
Sets up the job so that all necessary jars ar passed that contain classes from the given argument of this method.
|
static void |
addSchemaEvolutionToTableScanOperator(StructObjectInspector structOI,
TableScanOperator tableScanOp) |
static void |
addSchemaEvolutionToTableScanOperator(Table table,
TableScanOperator tableScanOp) |
static void |
addTableSchemaToConf(org.apache.hadoop.conf.Configuration conf,
TableScanOperator tableScanOp) |
static boolean |
arePathsEqualOrWithin(org.apache.hadoop.fs.Path p1,
org.apache.hadoop.fs.Path p2) |
static void |
cacheBaseWork(org.apache.hadoop.conf.Configuration conf,
String name,
BaseWork work,
org.apache.hadoop.fs.Path hiveScratchDir) |
static void |
cacheMapWork(org.apache.hadoop.conf.Configuration conf,
MapWork work,
org.apache.hadoop.fs.Path hiveScratchDir) |
static void |
clearWork(org.apache.hadoop.conf.Configuration conf) |
static void |
clearWorkMap(org.apache.hadoop.conf.Configuration conf) |
static void |
clearWorkMapForConf(org.apache.hadoop.conf.Configuration conf) |
static Connection |
connectWithRetry(String connectionString,
long waitWindow,
int maxRetries)
Retry connecting to a database with random backoff (same as the one implemented in HDFS-767).
|
static StandardStructObjectInspector |
constructVectorizedReduceRowOI(StructObjectInspector keyInspector,
StructObjectInspector valueInspector)
Create row key and value object inspectors for reduce vectorization.
|
static boolean |
contentsEqual(InputStream is1,
InputStream is2,
boolean ignoreWhitespace) |
static void |
copyJobSecretToTableProperties(TableDesc tbl)
Copy job credentials to table properties
|
static void |
copyTableJobPropertiesToConf(TableDesc tbl,
org.apache.hadoop.mapred.JobConf job)
Copies the storage handler properties configured for a table descriptor to a runtime job
configuration.
|
static void |
copyTablePropertiesToConf(TableDesc tbl,
org.apache.hadoop.mapred.JobConf job)
Copies the storage handler properties configured for a table descriptor to a runtime job
configuration.
|
static OutputStream |
createCompressedStream(org.apache.hadoop.mapred.JobConf jc,
OutputStream out,
boolean isCompressed)
Convert an output stream to a compressed output stream based on codecs codecs in the Job
Configuration.
|
static boolean |
createDirsWithPermission(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path mkdirPath,
org.apache.hadoop.fs.permission.FsPermission fsPermission,
boolean recursive) |
static RCFile.Writer |
createRCFileWriter(org.apache.hadoop.mapred.JobConf jc,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
boolean isCompressed,
org.apache.hadoop.util.Progressable progressable)
Create a RCFile output stream based on job configuration Uses user supplied compression flag
(rather than obtaining it from the Job Configuration).
|
static org.apache.hadoop.io.SequenceFile.Writer |
createSequenceWriter(org.apache.hadoop.mapred.JobConf jc,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
Class<?> keyClass,
Class<?> valClass,
boolean isCompressed,
org.apache.hadoop.util.Progressable progressable)
Create a sequencefile output stream based on job configuration Uses user supplied compression
flag (rather than obtaining it from the Job Configuration).
|
static void |
createTmpDirs(org.apache.hadoop.conf.Configuration conf,
MapWork mWork)
Hive uses tmp directories to capture the output of each FileSinkOperator.
|
static void |
createTmpDirs(org.apache.hadoop.conf.Configuration conf,
ReduceWork rWork)
Hive uses tmp directories to capture the output of each FileSinkOperator.
|
static List<String> |
decodeColumnNames(String colNamesStr) |
static String |
encodeColumnNames(List<String> colNames) |
static void |
ensurePathIsWritable(org.apache.hadoop.fs.Path rootHDFSDirPath,
HiveConf conf)
Checks if path passed in exists and has writable permissions.
|
static String |
escapeSqlLike(String key)
Escape the '_', '%', as well as the escape characters inside the string key.
|
static int |
estimateNumberOfReducers(HiveConf conf,
org.apache.hadoop.fs.ContentSummary inputSummary,
MapWork work,
boolean finalMapRed)
Estimate the number of reducers needed for this job, based on job input,
and configuration parameters.
|
static int |
estimateReducers(long totalInputFileSize,
long bytesPerReducer,
int maxReducers,
boolean powersOfTwo) |
static <T> T |
executeWithRetry(Utilities.SQLCommand<T> cmd,
PreparedStatement stmt,
long baseWindow,
int maxRetries)
Retry SQL execution with random backoff (same as the one implemented in HDFS-767).
|
static String |
formatBinaryString(byte[] array,
int start,
int length) |
static String |
formatMsecToStr(long msec)
Format number of milliseconds to strings
|
static String |
generateFileName(Byte tag,
String bigBucketFileName) |
static String |
generatePath(org.apache.hadoop.fs.Path baseURI,
String filename) |
static org.apache.hadoop.fs.Path |
generatePath(org.apache.hadoop.fs.Path basePath,
String dumpFilePrefix,
Byte tag,
String bigBucketFileName) |
static String |
generateTarFileName(String name) |
static org.apache.hadoop.fs.Path |
generateTarPath(org.apache.hadoop.fs.Path basePath,
String filename) |
static org.apache.hadoop.fs.Path |
generateTmpPath(org.apache.hadoop.fs.Path basePath,
String id) |
static String |
getAclStringWithHiveModification(org.apache.hadoop.conf.Configuration tezConf,
String propertyName,
boolean addHs2User,
String user,
String hs2User) |
static String |
getBucketFileNameFromPathSubString(String bucketName) |
static int |
getBucketIdFromFile(String bucketName) |
static int |
getBucketingVersion(String versionStr) |
static Collection<Class<?>> |
getClassNamesFromConfig(HiveConf hiveConf,
HiveConf.ConfVars confVar) |
static List<String> |
getColumnNames(org.apache.hadoop.conf.Configuration conf) |
static List<String> |
getColumnNames(Properties props)
Note: This will not return the correct number of columns in the case of
Avro serde using an external schema URL, unless these properties have been
used to initialize the Avro SerDe (which updates these properties).
|
static List<String> |
getColumnNamesFromFieldSchema(List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols) |
static List<String> |
getColumnNamesFromSortCols(List<org.apache.hadoop.hive.metastore.api.Order> sortCols) |
static List<String> |
getColumnTypes(Properties props) |
static String[] |
getDbTableName(String dbtable)
Deprecated.
use
TableName or HiveTableName instead |
static String[] |
getDbTableName(String defaultDb,
String dbtable)
Deprecated.
use
TableName or HiveTableName instead |
static int |
getDefaultNotificationInterval(org.apache.hadoop.conf.Configuration hconf)
Gets the default notification interval to send progress updates to the tracker.
|
static org.apache.hadoop.fs.Path[] |
getDirectInsertDirectoryCandidates(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
int dpLevels,
org.apache.hadoop.fs.PathFilter filter,
long writeId,
int stmtId,
org.apache.hadoop.conf.Configuration conf,
Boolean isBaseDir,
AcidUtils.Operation acidOperation) |
static int |
getDPColOffset(FileSinkDesc conf) |
static List<String> |
getFieldSchemaString(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fl) |
static String |
getFileExtension(org.apache.hadoop.mapred.JobConf jc,
boolean isCompressed,
HiveOutputFormat<?,?> hiveOutputFormat)
Based on compression option, output format, and configured output codec -
get extension for output file.
|
static int |
getFooterCount(TableDesc table,
org.apache.hadoop.mapred.JobConf job)
Get footer line count for a table.
|
static Map<org.apache.hadoop.fs.Path,Utilities.PartitionDetails> |
getFullDPSpecs(org.apache.hadoop.conf.Configuration conf,
DynamicPartitionCtx dpCtx,
Map<String,List<org.apache.hadoop.fs.Path>> dynamicPartitionSpecs)
Construct a list of full partition spec from Dynamic Partition Context and the directory names
corresponding to these dynamic partitions.
|
static String |
getHdfsResourceFiles(org.apache.hadoop.conf.Configuration conf,
SessionState.ResourceType type) |
static int |
getHeaderCount(TableDesc table)
Get header line count for a table.
|
static double |
getHighestSamplePercentage(MapWork work)
Returns the highest sample percentage of any alias in the given MapWork
|
static List<org.apache.hadoop.fs.Path> |
getInputPaths(org.apache.hadoop.mapred.JobConf job,
MapWork work,
org.apache.hadoop.fs.Path hiveScratchDir,
Context ctx,
boolean skipDummy)
Computes a list of all input paths needed to compute the given MapWork.
|
static List<org.apache.hadoop.fs.Path> |
getInputPathsTez(org.apache.hadoop.mapred.JobConf job,
MapWork work)
On Tez we're not creating dummy files when getting/setting input paths.
|
static org.apache.hadoop.fs.ContentSummary |
getInputSummary(Context ctx,
MapWork work,
org.apache.hadoop.fs.PathFilter filter)
Calculate the total size of input files.
|
static List<String> |
getInternalColumnNamesFromSignature(List<ColumnInfo> colInfos) |
static boolean |
getIsVectorized(org.apache.hadoop.conf.Configuration conf)
Returns true if a plan is both configured for vectorized execution
and the node is vectorized.
|
static boolean |
getIsVectorized(org.apache.hadoop.conf.Configuration conf,
MapWork mapWork) |
static String |
getLocalResourceFiles(org.apache.hadoop.conf.Configuration conf,
SessionState.ResourceType type) |
static MapredWork |
getMapRedWork(org.apache.hadoop.conf.Configuration conf) |
static MapWork |
getMapWork(org.apache.hadoop.conf.Configuration conf) |
static BaseWork |
getMergeWork(org.apache.hadoop.conf.Configuration jconf) |
static BaseWork |
getMergeWork(org.apache.hadoop.conf.Configuration jconf,
String prefix) |
static List<ExecDriver> |
getMRTasks(List<Task<?>> tasks) |
static String |
getNameMessage(Throwable e) |
static TableName |
getNullableTableName(String dbTableName)
Deprecated.
handle null values and use
TableName.fromString(String, String, String) |
static TableName |
getNullableTableName(String dbTableName,
String defaultDb)
Deprecated.
handle null values and use
TableName.fromString(String, String, String) |
static int |
getNumClusterJobs(List<Task<?>> tasks) |
static List<String> |
getPartitionColumnNames(org.apache.hadoop.conf.Configuration conf)
Returns a list with partition column names present in the configuration,
or empty if there is no such information available.
|
static PartitionDesc |
getPartitionDesc(Partition part,
TableDesc tableDesc) |
static PartitionDesc |
getPartitionDescFromTableDesc(TableDesc tblDesc,
Partition part,
boolean usePartSchemaProperties) |
static String |
getPasswdFromKeystore(String keystore,
String key) |
static String |
getPasswdFromUri(String uriString)
Load password from the given uri.
|
static org.apache.hadoop.fs.Path |
getPlanPath(org.apache.hadoop.conf.Configuration conf) |
static String |
getQualifiedPath(HiveConf conf,
org.apache.hadoop.fs.Path path)
Convert path to qualified path.
|
static long |
getRandomWaitTime(long baseWindow,
int failures,
Random r)
Introducing a random factor to the wait time before another retry.
|
static ReduceWork |
getReduceWork(org.apache.hadoop.conf.Configuration conf) |
static String |
getResourceFiles(org.apache.hadoop.conf.Configuration conf,
SessionState.ResourceType t) |
static ClassLoader |
getSessionSpecifiedClassLoader()
get session specified class loader and get current class loader if fall
|
static StatsPublisher |
getStatsPublisher(org.apache.hadoop.mapred.JobConf jc) |
static List<String> |
getStatsTmpDirs(BaseWork work,
org.apache.hadoop.conf.Configuration conf) |
static TableDesc |
getTableDesc(String cols,
String colTypes) |
static TableDesc |
getTableDesc(Table tbl) |
static String |
getTableOrMVSuffix(Context context,
boolean createTableOrMVUseSuffix) |
static String |
getTaskId(org.apache.hadoop.conf.Configuration hconf)
Gets the task id if we are running as a Hadoop job.
|
static String |
getTaskIdFromFilename(String filename)
Get the task id from the filename.
|
static List<TezTask> |
getTezTasks(List<Task<?>> tasks) |
static long |
getTotalInputFileSize(org.apache.hadoop.fs.ContentSummary inputSummary,
MapWork work,
double highestSamplePercentage)
Computes the total input file size.
|
static long |
getTotalInputNumFiles(org.apache.hadoop.fs.ContentSummary inputSummary,
MapWork work,
double highestSamplePercentage)
Computes the total number of input files.
|
static List<org.apache.hadoop.fs.Path> |
getValidMmDirectoriesFromTableOrPart(org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
ValidWriteIdList validWriteIdList) |
static VectorizedRowBatchCtx |
getVectorizedRowBatchCtx(org.apache.hadoop.conf.Configuration conf) |
static String |
getVertexCounterName(String counter,
String vertexName)
Appends vertex name to specified counter name.
|
static void |
handleDirectInsertTableFinalPath(org.apache.hadoop.fs.Path specPath,
String unionSuffix,
org.apache.hadoop.conf.Configuration hconf,
boolean success,
int dpLevels,
int lbLevels,
Utilities.MissingBucketsContext mbc,
long writeId,
int stmtId,
org.apache.hadoop.mapred.Reporter reporter,
boolean isMmTable,
boolean isMmCtas,
boolean isInsertOverwrite,
boolean isDirectInsert,
String staticSpec,
AcidUtils.Operation acidOperation,
FileSinkDesc conf) |
static String |
humanReadableByteCount(long bytes) |
static boolean |
isCopyFile(String filepath) |
static boolean |
isEmptyPath(org.apache.hadoop.conf.Configuration job,
org.apache.hadoop.fs.Path dirPath) |
static boolean |
isEmptyPath(org.apache.hadoop.mapred.JobConf job,
org.apache.hadoop.fs.Path dirPath,
Context ctx) |
static boolean |
isHiveManagedFile(org.apache.hadoop.fs.Path path) |
static boolean |
isInputFileFormatSelfDescribing(PartitionDesc pd) |
static boolean |
isInputFileFormatVectorized(PartitionDesc pd) |
static boolean |
isPerfOrAboveLogging(HiveConf conf)
Checks if the current HiveServer2 logging operation level is >= PERFORMANCE.
|
static boolean |
isSchemaEvolutionEnabled(org.apache.hadoop.conf.Configuration conf,
boolean isAcid) |
static String |
jarFinderGetJar(Class klass)
Returns the full path to the Jar containing the class.
|
static String |
join(String... elements) |
static org.apache.hadoop.fs.FileStatus[] |
listNonHiddenFileStatus(org.apache.hadoop.conf.Configuration job,
org.apache.hadoop.fs.Path dirPath) |
static org.apache.hadoop.fs.FileStatus[] |
listStatusIfExists(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.FileSystem fs)
returns null if path is not exist
|
static ArrayList |
makeList(Object... olist) |
static Properties |
makeProperties(String... olist) |
static List<String> |
mergeUniqElems(List<String> src,
List<String> dest) |
static org.apache.hadoop.fs.Path |
moveFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path srcFile,
org.apache.hadoop.fs.Path destDir,
String destFileName)
Rename src to dst, or in the case dst already exists, move files in src to dst.
|
static void |
moveSpecifiedFilesInParallel(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path srcPath,
org.apache.hadoop.fs.Path destPath,
Set<String> filesToMove)
move specified files to destination in parallel mode.
|
static void |
mvFileToFinalPath(org.apache.hadoop.fs.Path specPath,
String unionSuffix,
org.apache.hadoop.conf.Configuration hconf,
boolean success,
org.slf4j.Logger log,
DynamicPartitionCtx dpCtx,
FileSinkDesc conf,
org.apache.hadoop.mapred.Reporter reporter) |
static String |
now() |
static int |
parseSplitBucket(org.apache.hadoop.mapred.InputSplit split) |
static PreparedStatement |
prepareWithRetry(Connection conn,
String stmt,
long waitWindow,
int maxRetries)
Retry preparing a SQL statement with random backoff (same as the one implemented in HDFS-767).
|
static Utilities.StreamStatus |
readColumn(DataInput in,
OutputStream out) |
static String |
realFile(String newFile,
org.apache.hadoop.conf.Configuration conf)
Shamelessly cloned from GenericOptionsParser.
|
static void |
removeFromClassPath(String[] pathsToRemove)
Remove elements from the classpath, if possible.
|
static List<org.apache.hadoop.fs.Path> |
removeTempOrDuplicateFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.FileStatus[] fileStats,
String unionSuffix,
int dpLevels,
int numBuckets,
org.apache.hadoop.conf.Configuration hconf,
Long writeId,
int stmtId,
boolean isMmTable,
Set<org.apache.hadoop.fs.FileStatus> filesKept,
boolean isBaseDir) |
static void |
removeTempOrDuplicateFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration hconf,
boolean isBaseDir)
Remove all temporary files and duplicate (double-committed) files from a given directory.
|
static List<org.apache.hadoop.fs.Path> |
removeTempOrDuplicateFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
DynamicPartitionCtx dpCtx,
FileSinkDesc conf,
org.apache.hadoop.conf.Configuration hconf,
boolean isBaseDir) |
static String |
removeValueTag(String column) |
static void |
rename(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
Rename src to dst, or in the case dst already exists, move files in src to dst.
|
static void |
renameOrMoveFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
Rename src to dst, or in the case dst already exists, move files in src to dst.
|
static void |
renameOrMoveFilesInParallel(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
Rename src to dst, or in the case dst already exists, move files in src
to dst.
|
static String |
replaceTaskId(String taskId,
int bucketNum)
Replace taskId with input bucketNum.
|
static String |
replaceTaskIdFromFilename(String filename,
int bucketNum)
Replace the task id from the filename.
|
static String |
replaceTaskIdFromFilename(String filename,
String fileId) |
static void |
restoreSessionSpecifiedClassLoader(ClassLoader prev) |
static void |
reworkMapRedWork(Task<?> task,
boolean reworkMapredWork,
HiveConf conf)
The check here is kind of not clean.
|
static void |
setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op) |
static void |
setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op,
boolean excludeVCs) |
static void |
setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema) |
static void |
setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema,
boolean excludeVCs) |
static void |
setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op) |
static void |
setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op,
boolean excludeVCs) |
static void |
setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema) |
static void |
setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema,
boolean excludeVCs) |
static void |
setInputAttributes(org.apache.hadoop.conf.Configuration conf,
MapWork mWork)
Set hive input format, and input format file if necessary.
|
static void |
setInputPaths(org.apache.hadoop.mapred.JobConf job,
List<org.apache.hadoop.fs.Path> pathsToAdd)
setInputPaths add all the paths in the provided list to the Job conf object
as input paths for the job.
|
static void |
setMapRedWork(org.apache.hadoop.conf.Configuration conf,
MapredWork w,
org.apache.hadoop.fs.Path hiveScratchDir) |
static void |
setMapWork(org.apache.hadoop.conf.Configuration conf,
MapWork work) |
static org.apache.hadoop.fs.Path |
setMapWork(org.apache.hadoop.conf.Configuration conf,
MapWork w,
org.apache.hadoop.fs.Path hiveScratchDir,
boolean useCache) |
static org.apache.hadoop.fs.Path |
setMergeWork(org.apache.hadoop.mapred.JobConf conf,
MergeJoinWork mergeJoinWork,
org.apache.hadoop.fs.Path mrScratchDir,
boolean useCache) |
static void |
setPartitionColumnNames(org.apache.hadoop.conf.Configuration conf,
TableScanOperator tableScanOp)
Sets partition column names to the configuration, if there is available info in the operator.
|
static void |
setQueryTimeout(Statement stmt,
int timeout) |
static void |
setReduceWork(org.apache.hadoop.conf.Configuration conf,
ReduceWork work) |
static org.apache.hadoop.fs.Path |
setReduceWork(org.apache.hadoop.conf.Configuration conf,
ReduceWork w,
org.apache.hadoop.fs.Path hiveScratchDir,
boolean useCache) |
static boolean |
shouldAvoidRename(FileSinkDesc conf,
org.apache.hadoop.conf.Configuration hConf) |
static double |
showTime(long time) |
static <K,V> boolean |
skipHeader(org.apache.hadoop.mapred.RecordReader<K,V> currRecReader,
int headerCount,
K key,
V value)
Skip header lines in the table file when reading the record.
|
static long |
sumOf(Map<String,Long> aliasToSize,
Set<String> aliases) |
static long |
sumOfExcept(Map<String,Long> aliasToSize,
Set<String> aliases,
Set<String> excepts) |
static org.apache.hadoop.fs.Path |
toTaskTempPath(org.apache.hadoop.fs.Path orig) |
static org.apache.hadoop.fs.Path |
toTempPath(org.apache.hadoop.fs.Path orig) |
static org.apache.hadoop.fs.Path |
toTempPath(String orig)
Given a path, convert to a temporary path.
|
static void |
tryLoggingClassPaths(org.apache.hadoop.mapred.JobConf job,
org.slf4j.Logger logger)
Logs the class paths of the job class loader and the thread context class loader to the passed logger.
|
static void |
unsetSchemaEvolution(org.apache.hadoop.conf.Configuration conf) |
static void |
validateColumnNames(List<String> colNames,
List<String> checkCols) |
static void |
writeCommitManifest(List<org.apache.hadoop.fs.Path> commitPaths,
org.apache.hadoop.fs.Path specPath,
org.apache.hadoop.fs.FileSystem fs,
String taskId,
Long writeId,
int stmtId,
String unionSuffix,
boolean isInsertOverwrite,
boolean hasDynamicPartitions,
Set<String> dynamicPartitionSpecs,
String staticSpec,
boolean isDelete) |
public static final com.fasterxml.jackson.databind.ObjectMapper JSON_MAPPER
public static final org.slf4j.Logger FILE_OP_LOGGER
public static final org.slf4j.Logger LOGGER
public static final String HADOOP_LOCAL_FS
public static final String HADOOP_LOCAL_FS_SCHEME
public static final String MAP_PLAN_NAME
public static final String REDUCE_PLAN_NAME
public static final String MERGE_PLAN_NAME
public static final String INPUT_NAME
public static final String HAS_MAP_WORK
public static final String HAS_REDUCE_WORK
public static final String MAPRED_MAPPER_CLASS
public static final String MAPRED_REDUCER_CLASS
public static final String HIVE_ADDED_JARS
public static final String VECTOR_MODE
public static final String USE_VECTORIZED_INPUT_FILE_FORMAT
public static final String MAPNAME
public static final String REDUCENAME
public static final String ENSURE_OPERATORS_EXECUTED
public static final String SNAPSHOT_REF
@Deprecated protected static final String DEPRECATED_MAPRED_DFSCLIENT_PARALLELISM_MAX
public static final char[] COMMON_WHITESPACE_CHARS
public static final String BLOB_MANIFEST_FILE
public static TableDesc defaultTd
public static final int carriageReturnCode
public static final int newLineCode
public static final int tabCode
public static final int ctrlaCode
public static final String INDENT
public static final String nullStringStorage
public static final String nullStringOutput
public static final String NSTR
public static final String COPY_KEYWORD
public static final String suffix
public static final char sqlEscapeChar
public static void clearWork(org.apache.hadoop.conf.Configuration conf)
public static MapredWork getMapRedWork(org.apache.hadoop.conf.Configuration conf)
public static void cacheMapWork(org.apache.hadoop.conf.Configuration conf,
MapWork work,
org.apache.hadoop.fs.Path hiveScratchDir)
public static void setMapWork(org.apache.hadoop.conf.Configuration conf,
MapWork work)
public static MapWork getMapWork(org.apache.hadoop.conf.Configuration conf)
public static void setReduceWork(org.apache.hadoop.conf.Configuration conf,
ReduceWork work)
public static ReduceWork getReduceWork(org.apache.hadoop.conf.Configuration conf)
public static org.apache.hadoop.fs.Path setMergeWork(org.apache.hadoop.mapred.JobConf conf,
MergeJoinWork mergeJoinWork,
org.apache.hadoop.fs.Path mrScratchDir,
boolean useCache)
public static BaseWork getMergeWork(org.apache.hadoop.conf.Configuration jconf)
public static BaseWork getMergeWork(org.apache.hadoop.conf.Configuration jconf, String prefix)
public static void cacheBaseWork(org.apache.hadoop.conf.Configuration conf,
String name,
BaseWork work,
org.apache.hadoop.fs.Path hiveScratchDir)
public static List<String> getFieldSchemaString(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fl)
public static void setMapRedWork(org.apache.hadoop.conf.Configuration conf,
MapredWork w,
org.apache.hadoop.fs.Path hiveScratchDir)
public static org.apache.hadoop.fs.Path setMapWork(org.apache.hadoop.conf.Configuration conf,
MapWork w,
org.apache.hadoop.fs.Path hiveScratchDir,
boolean useCache)
public static org.apache.hadoop.fs.Path setReduceWork(org.apache.hadoop.conf.Configuration conf,
ReduceWork w,
org.apache.hadoop.fs.Path hiveScratchDir,
boolean useCache)
public static org.apache.hadoop.fs.Path getPlanPath(org.apache.hadoop.conf.Configuration conf)
public static String getTaskId(org.apache.hadoop.conf.Configuration hconf)
public static Properties makeProperties(String... olist)
public static PartitionDesc getPartitionDesc(Partition part, TableDesc tableDesc) throws HiveException
HiveExceptionpublic static PartitionDesc getPartitionDescFromTableDesc(TableDesc tblDesc, Partition part, boolean usePartSchemaProperties) throws HiveException
HiveExceptionpublic static boolean contentsEqual(InputStream is1, InputStream is2, boolean ignoreWhitespace) throws IOException
IOExceptionpublic static String abbreviate(String str, int max)
public static Utilities.StreamStatus readColumn(DataInput in, OutputStream out) throws IOException
IOExceptionpublic static OutputStream createCompressedStream(org.apache.hadoop.mapred.JobConf jc, OutputStream out, boolean isCompressed) throws IOException
jc - Job Configurationout - Output Stream to be converted into compressed output streamisCompressed - whether the output stream needs to be compressed or notIOExceptionpublic static String getFileExtension(org.apache.hadoop.mapred.JobConf jc, boolean isCompressed, HiveOutputFormat<?,?> hiveOutputFormat)
The property hive.output.file.extension is used to determine
the extension - if set, it will override other logic for choosing an
extension.
jc - Job ConfigurationisCompressed - Whether the output file is compressed or nothiveOutputFormat - The output format, used to detect if the format is textpublic static org.apache.hadoop.io.SequenceFile.Writer createSequenceWriter(org.apache.hadoop.mapred.JobConf jc,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path file,
Class<?> keyClass,
Class<?> valClass,
boolean isCompressed,
org.apache.hadoop.util.Progressable progressable)
throws IOException
jc - Job configurationfs - File System to create file infile - Path to be createdkeyClass - Java Class for keyvalClass - Java Class for valueIOExceptionpublic static RCFile.Writer createRCFileWriter(org.apache.hadoop.mapred.JobConf jc, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path file, boolean isCompressed, org.apache.hadoop.util.Progressable progressable) throws IOException
jc - Job configurationfs - File System to create file infile - Path to be createdIOExceptionpublic static String realFile(String newFile, org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionpublic static org.apache.hadoop.fs.Path toTaskTempPath(org.apache.hadoop.fs.Path orig)
public static org.apache.hadoop.fs.Path toTempPath(org.apache.hadoop.fs.Path orig)
public static org.apache.hadoop.fs.Path toTempPath(String orig)
public static void rename(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws IOException,
HiveException
fs - the FileSystem where src and dst are on.src - the src directorydst - the target directoryIOExceptionHiveExceptionpublic static org.apache.hadoop.fs.Path moveFile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path srcFile,
org.apache.hadoop.fs.Path destDir,
String destFileName)
throws IOException,
HiveException
fs - the FileSystem where src and dst are on.srcFile - the src filedestDir - the target directorydestFileName - the target filenameIOExceptionHiveExceptionpublic static void renameOrMoveFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws IOException,
HiveException
fs - the FileSystem where src and dst are on.src - the src directorydst - the target directoryIOExceptionHiveExceptionpublic static void renameOrMoveFilesInParallel(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path src,
org.apache.hadoop.fs.Path dst)
throws IOException,
HiveException
conf - fs - the FileSystem where src and dst are on.src - the src directorydst - the target directoryIOExceptionHiveExceptionpublic static String getTaskIdFromFilename(String filename)
filename - filename to extract taskid frompublic static String replaceTaskIdFromFilename(String filename, int bucketNum)
filename - filename to replace taskid "0_0" or "0_0.gz" by 33 to "33_0" or "33_0.gz"public static String replaceTaskIdFromFilename(String filename, String fileId)
public static String replaceTaskId(String taskId, int bucketNum)
taskId - bucketNum - public static boolean shouldAvoidRename(FileSinkDesc conf, org.apache.hadoop.conf.Configuration hConf)
public static org.apache.hadoop.fs.FileStatus[] listStatusIfExists(org.apache.hadoop.fs.Path path,
org.apache.hadoop.fs.FileSystem fs)
throws IOException
IOExceptionpublic static void mvFileToFinalPath(org.apache.hadoop.fs.Path specPath,
String unionSuffix,
org.apache.hadoop.conf.Configuration hconf,
boolean success,
org.slf4j.Logger log,
DynamicPartitionCtx dpCtx,
FileSinkDesc conf,
org.apache.hadoop.mapred.Reporter reporter)
throws IOException,
HiveException
IOExceptionHiveExceptionpublic static void moveSpecifiedFilesInParallel(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path srcPath,
org.apache.hadoop.fs.Path destPath,
Set<String> filesToMove)
throws HiveException,
IOException
conf - fs - srcPath - destPath - filesToMove - HiveExceptionIOExceptionpublic static void removeTempOrDuplicateFiles(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration hconf,
boolean isBaseDir)
throws IOException
IOExceptionpublic static List<org.apache.hadoop.fs.Path> removeTempOrDuplicateFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, DynamicPartitionCtx dpCtx, FileSinkDesc conf, org.apache.hadoop.conf.Configuration hconf, boolean isBaseDir) throws IOException
IOExceptionpublic static List<org.apache.hadoop.fs.Path> removeTempOrDuplicateFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.FileStatus[] fileStats, String unionSuffix, int dpLevels, int numBuckets, org.apache.hadoop.conf.Configuration hconf, Long writeId, int stmtId, boolean isMmTable, Set<org.apache.hadoop.fs.FileStatus> filesKept, boolean isBaseDir) throws IOException
IOExceptionpublic static boolean isCopyFile(String filepath)
public static String getBucketFileNameFromPathSubString(String bucketName)
public static int parseSplitBucket(org.apache.hadoop.mapred.InputSplit split)
public static int getBucketIdFromFile(String bucketName)
public static String getResourceFiles(org.apache.hadoop.conf.Configuration conf, SessionState.ResourceType t)
public static String getHdfsResourceFiles(org.apache.hadoop.conf.Configuration conf, SessionState.ResourceType type)
public static String getLocalResourceFiles(org.apache.hadoop.conf.Configuration conf, SessionState.ResourceType type)
public static ClassLoader getSessionSpecifiedClassLoader()
public static void restoreSessionSpecifiedClassLoader(ClassLoader prev)
public static void removeFromClassPath(String[] pathsToRemove) throws IOException
pathsToRemove - Array of classpath elementsIOExceptionpublic static String formatBinaryString(byte[] array, int start, int length)
public static List<String> getColumnNamesFromSortCols(List<org.apache.hadoop.hive.metastore.api.Order> sortCols)
public static List<String> getColumnNamesFromFieldSchema(List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols)
public static List<String> getInternalColumnNamesFromSignature(List<ColumnInfo> colInfos)
public static List<String> getColumnNames(Properties props)
props - TableDesc propertiespublic static List<String> getColumnTypes(Properties props)
@Deprecated public static String[] getDbTableName(String dbtable) throws SemanticException
TableName or HiveTableName insteaddbtable - SemanticException@Deprecated public static String[] getDbTableName(String defaultDb, String dbtable) throws SemanticException
TableName or HiveTableName insteaddefaultDb - dbtable - SemanticExceptionpublic static void validateColumnNames(List<String> colNames, List<String> checkCols) throws SemanticException
SemanticException@Deprecated public static TableName getNullableTableName(String dbTableName) throws SemanticException
TableName.fromString(String, String, String)TableName. All parts can be null.dbTableName - TableNameSemanticException@Deprecated public static TableName getNullableTableName(String dbTableName, String defaultDb) throws SemanticException
TableName.fromString(String, String, String)TableName. All parts can be null.dbTableName - defaultDb - TableNameSemanticExceptionpublic static int getDefaultNotificationInterval(org.apache.hadoop.conf.Configuration hconf)
hconf - public static void copyTableJobPropertiesToConf(TableDesc tbl, org.apache.hadoop.mapred.JobConf job) throws HiveException
tbl - table descriptor from which to readjob - configuration which receives configured propertiesHiveExceptionpublic static void copyTablePropertiesToConf(TableDesc tbl, org.apache.hadoop.mapred.JobConf job) throws HiveException
copyTablePropertiesToConf(org.apache.hadoop.hive.ql.plan.TableDesc, org.apache.hadoop.mapred.JobConf)
in that it does not allow parameters already set in the job to override the values from the
table. This is important for setting the config up for reading,
as the job may already have values in it from another table.tbl - job - HiveExceptionpublic static void copyJobSecretToTableProperties(TableDesc tbl) throws IOException
tbl - IOExceptionpublic static org.apache.hadoop.fs.ContentSummary getInputSummary(Context ctx, MapWork work, org.apache.hadoop.fs.PathFilter filter) throws IOException
ctx - the hadoop job contextwork - map reduce job planfilter - filter to apply to the input paths before calculating sizeIOExceptionpublic static long sumOfExcept(Map<String,Long> aliasToSize, Set<String> aliases, Set<String> excepts)
public static boolean isEmptyPath(org.apache.hadoop.mapred.JobConf job,
org.apache.hadoop.fs.Path dirPath,
Context ctx)
throws Exception
Exceptionpublic static boolean isEmptyPath(org.apache.hadoop.conf.Configuration job,
org.apache.hadoop.fs.Path dirPath)
throws IOException
IOExceptionpublic static org.apache.hadoop.fs.FileStatus[] listNonHiddenFileStatus(org.apache.hadoop.conf.Configuration job,
org.apache.hadoop.fs.Path dirPath)
throws IOException
IOExceptionpublic static List<ExecDriver> getMRTasks(List<Task<?>> tasks)
public static Map<org.apache.hadoop.fs.Path,Utilities.PartitionDetails> getFullDPSpecs(org.apache.hadoop.conf.Configuration conf, DynamicPartitionCtx dpCtx, Map<String,List<org.apache.hadoop.fs.Path>> dynamicPartitionSpecs) throws HiveException
HiveExceptionpublic static StatsPublisher getStatsPublisher(org.apache.hadoop.mapred.JobConf jc)
public static void setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema)
public static void setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema,
boolean excludeVCs)
public static void setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op)
public static void setColumnNameList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op,
boolean excludeVCs)
public static void setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema)
public static void setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
RowSchema rowSchema,
boolean excludeVCs)
public static void setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op)
public static void setColumnTypeList(org.apache.hadoop.mapred.JobConf jobConf,
Operator op,
boolean excludeVCs)
public static org.apache.hadoop.fs.Path generatePath(org.apache.hadoop.fs.Path basePath,
String dumpFilePrefix,
Byte tag,
String bigBucketFileName)
public static org.apache.hadoop.fs.Path generateTmpPath(org.apache.hadoop.fs.Path basePath,
String id)
public static org.apache.hadoop.fs.Path generateTarPath(org.apache.hadoop.fs.Path basePath,
String filename)
public static String now()
public static double showTime(long time)
public static void reworkMapRedWork(Task<?> task, boolean reworkMapredWork, HiveConf conf) throws SemanticException
task - reworkMapredWork - conf - SemanticExceptionpublic static <T> T executeWithRetry(Utilities.SQLCommand<T> cmd, PreparedStatement stmt, long baseWindow, int maxRetries) throws SQLException
cmd - the SQL commandstmt - the prepared statement of SQL.baseWindow - The base time window (in milliseconds) before the next retry.
see getRandomWaitTime(long, int, java.util.Random) for details.maxRetries - the maximum # of retries when getting a SQLTransientException.SQLException - throws SQLRecoverableException or SQLNonTransientException the
first time it is caught, or SQLTransientException when the maxRetries has reached.public static Connection connectWithRetry(String connectionString, long waitWindow, int maxRetries) throws SQLException
connectionString - the JDBC connection string.waitWindow - The base time window (in milliseconds) before the next retry.
see getRandomWaitTime(long, int, java.util.Random) for details.maxRetries - the maximum # of retries when getting a SQLTransientException.SQLException - throws SQLRecoverableException or SQLNonTransientException the
first time it is caught, or SQLTransientException when the maxRetries has reached.public static PreparedStatement prepareWithRetry(Connection conn, String stmt, long waitWindow, int maxRetries) throws SQLException
conn - a JDBC connection.stmt - the SQL statement to be prepared.waitWindow - The base time window (in milliseconds) before the next retry.
see getRandomWaitTime(long, int, java.util.Random) for details.maxRetries - the maximum # of retries when getting a SQLTransientException.SQLException - throws SQLRecoverableException or SQLNonTransientException the
first time it is caught, or SQLTransientException when the maxRetries has reached.public static void setQueryTimeout(Statement stmt, int timeout) throws SQLException
SQLExceptionpublic static long getRandomWaitTime(long baseWindow,
int failures,
Random r)
baseWindow - the base waiting window.failures - number of failures so far.r - a random generator.public static String escapeSqlLike(String key)
key - the string that will be used for the SQL LIKE operator.public static String formatMsecToStr(long msec)
msec - millisecondspublic static int estimateNumberOfReducers(HiveConf conf, org.apache.hadoop.fs.ContentSummary inputSummary, MapWork work, boolean finalMapRed) throws IOException
IOExceptionpublic static int estimateReducers(long totalInputFileSize,
long bytesPerReducer,
int maxReducers,
boolean powersOfTwo)
public static long getTotalInputFileSize(org.apache.hadoop.fs.ContentSummary inputSummary,
MapWork work,
double highestSamplePercentage)
inputSummary - work - highestSamplePercentage - public static long getTotalInputNumFiles(org.apache.hadoop.fs.ContentSummary inputSummary,
MapWork work,
double highestSamplePercentage)
inputSummary - work - highestSamplePercentage - public static double getHighestSamplePercentage(MapWork work)
public static List<org.apache.hadoop.fs.Path> getInputPathsTez(org.apache.hadoop.mapred.JobConf job, MapWork work) throws Exception
Exceptionpublic static String getVertexCounterName(String counter, String vertexName)
counter - counter to be appended withvertexName - vertex namepublic static List<org.apache.hadoop.fs.Path> getInputPaths(org.apache.hadoop.mapred.JobConf job, MapWork work, org.apache.hadoop.fs.Path hiveScratchDir, Context ctx, boolean skipDummy) throws Exception
job - JobConf used to run the jobwork - MapWork encapsulating the info about the taskhiveScratchDir - The tmp dir used to create dummy files if neededctx - Context objectExceptionpublic static void setInputPaths(org.apache.hadoop.mapred.JobConf job,
List<org.apache.hadoop.fs.Path> pathsToAdd)
job - pathsToAdd - public static void setInputAttributes(org.apache.hadoop.conf.Configuration conf,
MapWork mWork)
public static void createTmpDirs(org.apache.hadoop.conf.Configuration conf,
MapWork mWork)
throws IOException
conf - Used to get the right FileSystemmWork - Used to find FileSinkOperatorsIOExceptionpublic static void createTmpDirs(org.apache.hadoop.conf.Configuration conf,
ReduceWork rWork)
throws IOException
conf - Used to get the right FileSystemrWork - Used to find FileSinkOperatorsIOExceptionpublic static boolean createDirsWithPermission(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path mkdirPath,
org.apache.hadoop.fs.permission.FsPermission fsPermission,
boolean recursive)
throws IOException
IOExceptionpublic static boolean getIsVectorized(org.apache.hadoop.conf.Configuration conf)
public static boolean getIsVectorized(org.apache.hadoop.conf.Configuration conf,
MapWork mapWork)
public static VectorizedRowBatchCtx getVectorizedRowBatchCtx(org.apache.hadoop.conf.Configuration conf)
conf - public static void clearWorkMapForConf(org.apache.hadoop.conf.Configuration conf)
public static void clearWorkMap(org.apache.hadoop.conf.Configuration conf)
public static <K,V> boolean skipHeader(org.apache.hadoop.mapred.RecordReader<K,V> currRecReader,
int headerCount,
K key,
V value)
throws IOException
currRecReader - Record reader.headerCount - Header line number of the table files.key - Key of current reading record.value - Value of current reading record.IOExceptionpublic static int getHeaderCount(TableDesc table) throws IOException
table - Table description for target table.IOExceptionpublic static int getFooterCount(TableDesc table, org.apache.hadoop.mapred.JobConf job) throws IOException
table - Table description for target table.job - Job configuration for current job.IOExceptionpublic static String getQualifiedPath(HiveConf conf, org.apache.hadoop.fs.Path path) throws HiveException
conf - Hive configuration.path - Path to convert.HiveExceptionpublic static boolean isPerfOrAboveLogging(HiveConf conf)
conf - Hive configuration.public static String jarFinderGetJar(Class klass)
klass - class.public static void addDependencyJars(org.apache.hadoop.conf.Configuration conf,
Class<?>... classes)
throws IOException
conf - jobConf instance to setupclasses - the classes to look in jars forIOExceptionpublic static int getDPColOffset(FileSinkDesc conf)
public static List<String> getStatsTmpDirs(BaseWork work, org.apache.hadoop.conf.Configuration conf)
public static boolean isSchemaEvolutionEnabled(org.apache.hadoop.conf.Configuration conf,
boolean isAcid)
public static boolean isInputFileFormatSelfDescribing(PartitionDesc pd)
public static boolean isInputFileFormatVectorized(PartitionDesc pd)
public static Collection<Class<?>> getClassNamesFromConfig(HiveConf hiveConf, HiveConf.ConfVars confVar)
public static void addSchemaEvolutionToTableScanOperator(Table table, TableScanOperator tableScanOp)
public static void addSchemaEvolutionToTableScanOperator(StructObjectInspector structOI, TableScanOperator tableScanOp)
public static void unsetSchemaEvolution(org.apache.hadoop.conf.Configuration conf)
public static void addTableSchemaToConf(org.apache.hadoop.conf.Configuration conf,
TableScanOperator tableScanOp)
public static void setPartitionColumnNames(org.apache.hadoop.conf.Configuration conf,
TableScanOperator tableScanOp)
public static List<String> getPartitionColumnNames(org.apache.hadoop.conf.Configuration conf)
public static StandardStructObjectInspector constructVectorizedReduceRowOI(StructObjectInspector keyInspector, StructObjectInspector valueInspector) throws HiveException
keyInspector - valueInspector - HiveExceptionpublic static String humanReadableByteCount(long bytes)
public static org.apache.hadoop.fs.Path[] getDirectInsertDirectoryCandidates(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
int dpLevels,
org.apache.hadoop.fs.PathFilter filter,
long writeId,
int stmtId,
org.apache.hadoop.conf.Configuration conf,
Boolean isBaseDir,
AcidUtils.Operation acidOperation)
throws IOException
IOExceptionpublic static void writeCommitManifest(List<org.apache.hadoop.fs.Path> commitPaths, org.apache.hadoop.fs.Path specPath, org.apache.hadoop.fs.FileSystem fs, String taskId, Long writeId, int stmtId, String unionSuffix, boolean isInsertOverwrite, boolean hasDynamicPartitions, Set<String> dynamicPartitionSpecs, String staticSpec, boolean isDelete) throws HiveException
HiveExceptionpublic static void handleDirectInsertTableFinalPath(org.apache.hadoop.fs.Path specPath,
String unionSuffix,
org.apache.hadoop.conf.Configuration hconf,
boolean success,
int dpLevels,
int lbLevels,
Utilities.MissingBucketsContext mbc,
long writeId,
int stmtId,
org.apache.hadoop.mapred.Reporter reporter,
boolean isMmTable,
boolean isMmCtas,
boolean isInsertOverwrite,
boolean isDirectInsert,
String staticSpec,
AcidUtils.Operation acidOperation,
FileSinkDesc conf)
throws IOException,
HiveException
IOExceptionHiveExceptionpublic static List<org.apache.hadoop.fs.Path> getValidMmDirectoriesFromTableOrPart(org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, ValidWriteIdList validWriteIdList) throws IOException
IOExceptionpublic static String getAclStringWithHiveModification(org.apache.hadoop.conf.Configuration tezConf, String propertyName, boolean addHs2User, String user, String hs2User) throws IOException
IOExceptionpublic static boolean isHiveManagedFile(org.apache.hadoop.fs.Path path)
public static void ensurePathIsWritable(org.apache.hadoop.fs.Path rootHDFSDirPath,
HiveConf conf)
throws IOException
rootHDFSDirPath - conf - IOExceptionpublic static int getBucketingVersion(String versionStr)
public static String getPasswdFromKeystore(String keystore, String key) throws IOException
IOExceptionpublic static String getPasswdFromUri(String uriString) throws IOException, URISyntaxException, HiveException
uriString - The URI which is used to load the password.IOExceptionURISyntaxExceptionHiveExceptionpublic static String encodeColumnNames(List<String> colNames) throws SemanticException
SemanticExceptionpublic static List<String> decodeColumnNames(String colNamesStr) throws SemanticException
SemanticExceptionpublic static void tryLoggingClassPaths(org.apache.hadoop.mapred.JobConf job,
org.slf4j.Logger logger)
public static boolean arePathsEqualOrWithin(org.apache.hadoop.fs.Path p1,
org.apache.hadoop.fs.Path p2)
Copyright © 2024 The Apache Software Foundation. All rights reserved.