public class ImportSemanticAnalyzer extends BaseSemanticAnalyzer
BaseSemanticAnalyzer.AnalyzeRewriteContext, BaseSemanticAnalyzer.TableSpecacidFileSinks, cacheUsage, cContext, columnAccessInfo, conf, console, ctx, db, fetchTask, idToTableNameMap, inputs, linfo, outputs, prepareQuery, queryProperties, queryState, rootTasks, STATIC_LOG, tableAccessInfo, transactionalInQuery, txnManager, updateColumnAccessInfo, userSuppliedFunctions| Constructor and Description |
|---|
ImportSemanticAnalyzer(QueryState queryState) |
| Modifier and Type | Method and Description |
|---|---|
void |
analyzeInternal(ASTNode ast) |
static void |
checkTargetLocationEmpty(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path targetPath,
ReplicationSpec replicationSpec,
org.slf4j.Logger logger) |
static Table |
createNewTableMetadataObject(ImportTableDesc tblDesc,
boolean isRepl) |
boolean |
existsTable() |
static boolean |
isPartitioned(ImportTableDesc tblDesc) |
static String |
partSpecToString(Map<String,String> partSpec) |
static boolean |
prepareImport(boolean isImportCmd,
boolean isLocationSet,
boolean isExternalSet,
boolean isPartSpecSet,
boolean waitOnPrecursor,
String parsedLocation,
String parsedTableName,
String overrideDBName,
LinkedHashMap<String,String> parsedPartSpec,
String fromLocn,
EximUtil.SemanticAnalyzerWrapperContext x,
UpdatedMetaDataTracker updatedMetadata,
HiveTxnManager txnMgr,
long writeId,
MetaData rv)
The same code is used from both the "repl load" as well as "import".
|
static boolean |
prepareImport(boolean isImportCmd,
boolean isLocationSet,
boolean isExternalSet,
boolean isPartSpecSet,
boolean waitOnPrecursor,
String parsedLocation,
String parsedTableName,
String overrideDBName,
LinkedHashMap<String,String> parsedPartSpec,
String fromLocn,
EximUtil.SemanticAnalyzerWrapperContext x,
UpdatedMetaDataTracker updatedMetadata,
HiveTxnManager txnMgr,
long writeId,
MetaData rv,
String dumpRoot,
ReplicationMetricCollector metricCollector) |
static void |
setupDeferredContextFromMetadata(DeferredWorkContext deferredContext) |
static Table |
tableIfExists(ImportTableDesc tblDesc,
Hive db)
Utility method that returns a table if one corresponding to the destination
tblDesc is found.
|
addPropertyReadEntry, analyze, analyzeStoredAdDirs, charSetString, checkColumnName, constructListBucketingCtx, createFetchTask, createHiveDB, endAnalysis, escapeSQLString, executeUnParseTranslations, findTabRefIdxs, getAcidAnalyzeTable, getAcidDdlDesc, getAcidFileSinks, getAllInputs, getAllOutputs, getAllRootTasks, getAutoCommitValue, getCacheUsage, getCboInfo, getColumnAccessInfo, getColumnNames, getColumnNamesOrder, getColumns, getColumns, getColumns, getCtx, getDatabase, getDatabase, getDataConnector, getDataConnector, getDb, getDbTableNamePair, getFetchTask, getFullTableNameForSQL, getIdToTableNameMap, getInputs, getLineageInfo, getOutputs, getParseContext, getPartitionSpecs, getPartSpec, getProps, getQualifiedTableName, getQualifiedTableName, getQueryProperties, getQueryState, getResultSchema, getRootTasks, getSimpleTableNameBase, getTable, getTable, getTable, getTable, getTable, getTable, getTableAccessInfo, getTableAlias, getTxnMgr, getTypeStringFromAST, getUnescapedName, getUnescapedName, getUnescapedUnqualifiedTableName, getUpdateColumnAccessInfo, getUserSuppliedFunctions, getValidatedPartSpec, hasTransactionalInQuery, init, initCtx, isPrepareQuery, isValidPrefixSpec, processOrderSpec, raiseWrongType, readProps, reset, setAutoCommitValue, setCacheUsage, setColumnAccessInfo, setFetchTask, setLineageInfo, setTableAccessInfo, setUpdateColumnAccessInfo, skipAuthorization, startAnalysis, stripQuotes, toReadEntity, toReadEntity, toReadEntity, toWriteEntity, toWriteEntity, toWriteEntity, tryQualifyPath, unescapeIdentifier, unescapeSQLString, validate, validatePartColumnType, validatePartSpec, validateUnsupportedPartitionClausepublic ImportSemanticAnalyzer(QueryState queryState) throws SemanticException
SemanticExceptionpublic boolean existsTable()
public void analyzeInternal(ASTNode ast) throws SemanticException
analyzeInternal in class BaseSemanticAnalyzerSemanticExceptionpublic static boolean prepareImport(boolean isImportCmd,
boolean isLocationSet,
boolean isExternalSet,
boolean isPartSpecSet,
boolean waitOnPrecursor,
String parsedLocation,
String parsedTableName,
String overrideDBName,
LinkedHashMap<String,String> parsedPartSpec,
String fromLocn,
EximUtil.SemanticAnalyzerWrapperContext x,
UpdatedMetaDataTracker updatedMetadata,
HiveTxnManager txnMgr,
long writeId,
MetaData rv)
throws IOException,
org.apache.hadoop.hive.metastore.api.MetaException,
HiveException,
URISyntaxException
hence for import to work correctly we have to pass in the sessionState default Db via the parsedDbName parameter
public static boolean prepareImport(boolean isImportCmd,
boolean isLocationSet,
boolean isExternalSet,
boolean isPartSpecSet,
boolean waitOnPrecursor,
String parsedLocation,
String parsedTableName,
String overrideDBName,
LinkedHashMap<String,String> parsedPartSpec,
String fromLocn,
EximUtil.SemanticAnalyzerWrapperContext x,
UpdatedMetaDataTracker updatedMetadata,
HiveTxnManager txnMgr,
long writeId,
MetaData rv,
String dumpRoot,
ReplicationMetricCollector metricCollector)
throws IOException,
org.apache.hadoop.hive.metastore.api.MetaException,
HiveException,
URISyntaxException
public static void setupDeferredContextFromMetadata(DeferredWorkContext deferredContext) throws HiveException
HiveExceptionpublic static void checkTargetLocationEmpty(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path targetPath,
ReplicationSpec replicationSpec,
org.slf4j.Logger logger)
throws IOException,
SemanticException
IOExceptionSemanticExceptionpublic static Table createNewTableMetadataObject(ImportTableDesc tblDesc, boolean isRepl) throws SemanticException
SemanticExceptionpublic static boolean isPartitioned(ImportTableDesc tblDesc)
public static Table tableIfExists(ImportTableDesc tblDesc, Hive db) throws HiveException
HiveExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.