boolean analyzeCreateTable(ASTNode child) throws SemanticException { if (ast.getToken().getType() == HiveParser.TOK_CREATETABLE) { // if it is not CTAS, we don't need to go further and just return if ((child = analyzeCreateTable(ast, qb, null)) == null) { return true; } } else { queryState.setCommandType(HiveOperation.QUERY); } return false; }
} else { HiveOperation opType = commandType.get(tree.getType()); queryState.setCommandType(opType); switch (tree.getType()) { case HiveParser.TOK_EXPLAIN: case HiveParser.TOK_ALTERTABLE_ADDCONSTRAINT: case HiveParser.TOK_ALTERTABLE_UPDATECOLUMNS: queryState.setCommandType(commandType.get(child.getType())); return new DDLSemanticAnalyzer(queryState); queryState.setCommandType(opType); return new DDLSemanticAnalyzer(queryState); case HiveParser.TOK_ALTERVIEW_RENAME: opType = commandType.get(child.getType()); queryState.setCommandType(opType); return new DDLSemanticAnalyzer(queryState); queryState.setCommandType(HiveOperation.ALTERVIEW_AS); return new SemanticAnalyzer(queryState); case HiveParser.TOK_ALTER_MATERIALIZED_VIEW_REWRITE: opType = commandType.get(child.getType()); queryState.setCommandType(opType); return new DDLSemanticAnalyzer(queryState); case HiveParser.TOK_ALTER_MATERIALIZED_VIEW_REBUILD: opType = commandType.get(child.getType()); queryState.setCommandType(opType);
} else { HiveOperation opType = commandType.get(tree.getType()); queryState.setCommandType(opType); switch (tree.getType()) { case HiveParser.TOK_EXPLAIN: case HiveParser.TOK_ALTERTABLE_DROPCONSTRAINT: case HiveParser.TOK_ALTERTABLE_ADDCONSTRAINT: queryState.setCommandType(commandType.get(child.getType())); return new DDLSemanticAnalyzer(queryState); queryState.setCommandType(opType); return new DDLSemanticAnalyzer(queryState); case HiveParser.TOK_ALTERVIEW_RENAME: opType = commandType.get(child.getType()); queryState.setCommandType(opType); return new DDLSemanticAnalyzer(queryState); queryState.setCommandType(HiveOperation.ALTERVIEW_AS); return new SemanticAnalyzer(queryState);
/** * Set the query plan to use cache entry passed in to return the query results. * @param cacheEntry The results cache entry that will be used to resolve the query. */ private void useCachedResult(QueryResultsCache.CacheEntry cacheEntry, boolean needsReset) { if (needsReset) { reset(true); inputs.clear(); } // Change query FetchTask to use new location specified in results cache. FetchTask fetchTask = (FetchTask) TaskFactory.get(cacheEntry.getFetchWork()); setFetchTask(fetchTask); queryState.setCommandType(cacheEntry.getQueryInfo().getHiveOperation()); resultSchema = cacheEntry.getQueryInfo().getResultSchema(); setTableAccessInfo(cacheEntry.getQueryInfo().getTableAccessInfo()); setColumnAccessInfo(cacheEntry.getQueryInfo().getColumnAccessInfo()); inputs.addAll(cacheEntry.getQueryInfo().getInputs()); // Set recursive traversal in case the cached query was UNION generated by Tez. conf.setBoolean(FileInputFormat.INPUT_DIR_RECURSIVE, true); // Indicate that the query will use a cached result. setCacheUsage(new CacheUsage( CacheUsage.CacheStatus.QUERY_USING_CACHE, cacheEntry)); }
analyzer.analyzeInternal(createTable); } finally { queryState.setCommandType(operation);
queryState.setCommandType(HiveOperation.QUERY); " is not supported yet."); queryState.setCommandType(SemanticAnalyzerFactory.getOperation(ast.getToken().getType())); return false;
analyzer.analyzeInternal(createTable); } finally { queryState.setCommandType(operation);
analyzer.analyzeInternal(createTable); } finally { queryState.setCommandType(operation);
queryState.setCommandType(HiveOperation.QUERY); " is not supported yet."); queryState.setCommandType(SemanticAnalyzerFactory.getOperation(ast.getToken().getType())); return false;
analyzer.analyzeInternal(createTable); } finally { queryState.setCommandType(operation);
queryState.setCommandType(HiveOperation.CREATETABLE); } else if (command_type == CTAS) { queryState.setCommandType(HiveOperation.CREATETABLE_AS_SELECT); } else { throw new SemanticException("Unrecognized command.");
queryState.setCommandType(HiveOperation.CREATETABLE); } else if (command_type == CTAS) { queryState.setCommandType(HiveOperation.CREATETABLE_AS_SELECT); } else { throw new SemanticException("Unrecognized command.");
this.queryState.setCommandType(HiveOperation.ANALYZE_TABLE); } else { initCtx(origCtx);
storageFormat.getSerdeProps()); addDbAndTabToOutputs(qualTabName, TableType.MATERIALIZED_VIEW); queryState.setCommandType(HiveOperation.CREATE_MATERIALIZED_VIEW); } else { createVwDesc = new CreateViewDesc( createVwDesc), conf)); addDbAndTabToOutputs(qualTabName, TableType.VIRTUAL_VIEW); queryState.setCommandType(HiveOperation.CREATEVIEW);
storageFormat.getSerdeProps()); addDbAndTabToOutputs(qualTabName, TableType.MATERIALIZED_VIEW, false, tblProps); queryState.setCommandType(HiveOperation.CREATE_MATERIALIZED_VIEW); } else { createVwDesc = new CreateViewDesc( createVwDesc))); addDbAndTabToOutputs(qualTabName, TableType.VIRTUAL_VIEW, false, tblProps); queryState.setCommandType(HiveOperation.CREATEVIEW);