public class ImportSemanticAnalyzer extends BaseSemanticAnalyzer
BaseSemanticAnalyzer.AnalyzeRewriteContext, BaseSemanticAnalyzer.TableSpec
acidFileSinks, cacheUsage, cContext, columnAccessInfo, conf, console, ctx, db, fetchTask, idToTableNameMap, inputs, linfo, outputs, prepareQuery, queryProperties, queryState, rootTasks, STATIC_LOG, tableAccessInfo, transactionalInQuery, txnManager, updateColumnAccessInfo
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, executeUnparseTranlations, findTabRefIdxs, getAcidAnalyzeTable, getAcidDdlDesc, getAcidFileSinks, getAllInputs, getAllOutputs, getAllRootTasks, getAutoCommitValue, getCacheUsage, getCboInfo, getColumnAccessInfo, getColumnNames, getColumnNamesOrder, getColumns, getColumns, getColumns, getCtx, getDatabase, getDatabase, getDataConnector, getDataConnector, getDb, getDbTableNamePair, getFetchTask, 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, getValidatedPartSpec, hasTransactionalInQuery, init, initCtx, isPrepareQuery, isValidPrefixSpec, 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, validateUnsupportedPartitionClause
public ImportSemanticAnalyzer(QueryState queryState) throws SemanticException
SemanticException
public boolean existsTable()
public void analyzeInternal(ASTNode ast) throws SemanticException
analyzeInternal
in class BaseSemanticAnalyzer
SemanticException
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) throws IOException, 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, MetaException, HiveException, URISyntaxException
public static void setupDeferredContextFromMetadata(DeferredWorkContext deferredContext) throws HiveException
HiveException
public static void checkTargetLocationEmpty(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path targetPath, ReplicationSpec replicationSpec, org.slf4j.Logger logger) throws IOException, SemanticException
IOException
SemanticException
public static Table createNewTableMetadataObject(ImportTableDesc tblDesc, boolean isRepl) throws SemanticException
SemanticException
public static boolean isPartitioned(ImportTableDesc tblDesc)
public static Table tableIfExists(ImportTableDesc tblDesc, Hive db) throws HiveException
HiveException
Copyright © 2022 The Apache Software Foundation. All rights reserved.