public String getCommandType() { if (commandType == null) { return null; } return commandType.getOperationName(); }
public String getOperationName() { return operation == null ? null : operation.getOperationName(); } public HiveOperation getOperation() {
public String getCommandType() { if (commandType == null) { return null; } return commandType.getOperationName(); }
public String getOperationName() { return operation == null ? null : operation.getOperationName(); } public HiveOperation getOperation() {
.equals(HiveOperation.ALTERTABLE_UPDATETABLESTATS.getOperationName()) || queryState.getCommandType() .equals(HiveOperation.ALTERTABLE_UPDATEPARTSTATS.getOperationName())) { throw new SemanticException("AlterTable UpdateStats " + entry.getKey() + " failed because the only valid keys are " + StatsSetupConst.ROW_COUNT + " and "
.equals(HiveOperation.ALTERTABLE_UPDATETABLESTATS.getOperationName()) || queryState.getCommandType() .equals(HiveOperation.ALTERTABLE_UPDATEPARTSTATS.getOperationName())) { throw new SemanticException("AlterTable UpdateStats " + entry.getKey() + " failed because the only valid keys are " + StatsSetupConst.ROW_COUNT + " and "
case ROLLBACK: if(!txnManager.isTxnOpen()) { throw new LockException(null, ErrorMsg.OP_NOT_ALLOWED_WITHOUT_TXN, queryState.getHiveOperation().getOperationName());
private void handleLineage(LoadTableDesc ltd, Operator output) throws SemanticException { if (ltd != null) { queryState.getLineageState() .mapDirToOp(ltd.getSourcePath(), output); } else if ( queryState.getCommandType().equals(HiveOperation.CREATETABLE_AS_SELECT.getOperationName())) { Path tlocation = null; String tName = Utilities.getDbTableName(tableDesc.getTableName())[1]; try { Warehouse wh = new Warehouse(conf); tlocation = wh.getDefaultTablePath(db.getDatabase(tableDesc.getDatabaseName()), tName, tableDesc.isExternal()); } catch (MetaException|HiveException e) { throw new SemanticException(e); } queryState.getLineageState() .mapDirToOp(tlocation, output); } }
boolean isReplicationOperation = opName.equals(HiveOperation.REPLDUMP.getOperationName()) || opName.equals(HiveOperation.REPLLOAD.getOperationName()); if (!isReplicationOperation) { hookContext.addCompleteTask(tskRun);
SessionState.get().getLineageState() .mapDirToOp(ltd.getSourcePath(), (FileSinkOperator) output); } else if ( queryState.getCommandType().equals(HiveOperation.CREATETABLE_AS_SELECT.getOperationName())) {
public String getCommandType() { if (commandType == null) { return null; } return commandType.getOperationName(); }
public String getCommandType() { if (commandType == null) { return null; } return commandType.getOperationName(); }
private static void setupOperationMap() { //Populate OPERATION_MAP - string to HiveOperation mapping for (HiveOperation hiveOperation : HiveOperation.values()) { OPERATION_MAP.put(hiveOperation.getOperationName(), hiveOperation); } }
@VisibleForTesting static String getProcessQualifiedName(HiveMetaStoreBridge dgiBridge, HiveEventContext eventContext, final SortedSet<ReadEntity> sortedHiveInputs, final SortedSet<WriteEntity> sortedHiveOutputs, SortedMap<ReadEntity, Referenceable> hiveInputsMap, SortedMap<WriteEntity, Referenceable> hiveOutputsMap) throws HiveException { HiveOperation op = eventContext.getOperation(); if (isCreateOp(eventContext)) { Entity entity = getEntityByType(sortedHiveOutputs, Type.TABLE); if (entity != null) { Table outTable = entity.getTable(); //refresh table outTable = dgiBridge.hiveClient.getTable(outTable.getDbName(), outTable.getTableName()); return HiveMetaStoreBridge.getTableProcessQualifiedName(dgiBridge.getClusterName(), outTable); } } StringBuilder buffer = new StringBuilder(op.getOperationName()); boolean ignoreHDFSPathsinQFName = ignoreHDFSPathsinQFName(op, sortedHiveInputs, sortedHiveOutputs); if ( ignoreHDFSPathsinQFName && LOG.isDebugEnabled()) { LOG.debug("Ignoring HDFS paths in qualifiedName for {} {} ", op, eventContext.getQueryStr()); } addInputs(dgiBridge, op, sortedHiveInputs, buffer, hiveInputsMap, ignoreHDFSPathsinQFName); buffer.append(IO_SEP); addOutputs(dgiBridge, op, sortedHiveOutputs, buffer, hiveOutputsMap, ignoreHDFSPathsinQFName); LOG.info("Setting process qualified name to {}", buffer); return buffer.toString(); }
processReferenceable.set("operationType", hiveEvent.getOperation().getOperationName()); processReferenceable.set("startTime", new Date(hiveEvent.getQueryStartTime())); processReferenceable.set("userName", hiveEvent.getUser());
semanticAnalyzer, null, commandType != null ? commandType.getOperationName() : null );
semanticAnalyzer, null, commandType != null ? commandType.getOperationName() : null );