private void prepareReturnValues(List<String> values, String schema) throws SemanticException { LOG.debug("prepareReturnValues : " + schema); for (String s : values) { LOG.debug(" > " + s); } ctx.setResFile(ctx.getLocalTmpPath()); Utils.writeOutput(values, ctx.getResFile(), conf); } }
private void prepareReturnValues(List<String> values, String schema) throws SemanticException { LOG.debug("prepareReturnValues : " + schema); for (String s : values) { LOG.debug(" > " + s); } ctx.setResFile(ctx.getLocalTmpPath()); writeOutput(values, ctx.getResFile()); }
private void analyzeShowRoles(ASTNode ast) throws SemanticException { @SuppressWarnings("unchecked") Task<DDLWork> roleDDLTask = (Task<DDLWork>) hiveAuthorizationTaskFactory .createShowRolesTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if (roleDDLTask != null) { rootTasks.add(roleDDLTask); setFetchTask(createFetchTask(RoleDDLDesc.getRoleNameSchema())); } }
private void analyzeShowRoleGrant(ASTNode ast) throws SemanticException { Task<?> task = hiveAuthorizationTaskFactory. createShowRoleGrantTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if(task != null) { rootTasks.add(task); setFetchTask(createFetchTask(RoleDDLDesc.getRoleShowGrantSchema())); } }
private void analyzeShowRolePrincipals(ASTNode ast) throws SemanticException { Task<DDLWork> roleDDLTask = (Task<DDLWork>) hiveAuthorizationTaskFactory .createShowRolePrincipalsTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if (roleDDLTask != null) { rootTasks.add(roleDDLTask); setFetchTask(createFetchTask(RoleDDLDesc.getShowRolePrincipalsSchema())); } }
private void analyzeShowGrant(ASTNode ast) throws SemanticException { Task<?> task = hiveAuthorizationTaskFactory. createShowGrantTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if(task != null) { rootTasks.add(task); setFetchTask(createFetchTask(ShowGrantDesc.getSchema())); } }
private void analyzeShowRoles(ASTNode ast) throws SemanticException { Task<DDLWork> roleDDLTask = (Task<DDLWork>) hiveAuthorizationTaskFactory .createShowRolesTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if (roleDDLTask != null) { rootTasks.add(roleDDLTask); setFetchTask(createFetchTask(RoleDDLDesc.getRoleNameSchema())); } }
private void analyzeShowGrant(ASTNode ast) throws SemanticException { Task<? extends Serializable> task = hiveAuthorizationTaskFactory. createShowGrantTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if(task != null) { rootTasks.add(task); setFetchTask(createFetchTask(ShowGrantDesc.getSchema())); } }
private void analyzeShowRolePrincipals(ASTNode ast) throws SemanticException { Task<DDLWork> roleDDLTask = (Task<DDLWork>) hiveAuthorizationTaskFactory .createShowRolePrincipalsTask(ast, ctx.getResFile(), getInputs(), getOutputs()); if (roleDDLTask != null) { rootTasks.add(roleDDLTask); setFetchTask(createFetchTask(RoleDDLDesc.getShowRolePrincipalsSchema())); } }
private void analyzeShowCreateTable(ASTNode ast) throws SemanticException { ShowCreateTableDesc showCreateTblDesc; String tableName = getUnescapedName((ASTNode)ast.getChild(0)); showCreateTblDesc = new ShowCreateTableDesc(tableName, ctx.getResFile().toString()); Table tab = getTable(tableName); inputs.add(new ReadEntity(tab)); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showCreateTblDesc))); setFetchTask(createFetchTask(showCreateTblDesc.getSchema())); }
private void analyzeShowDatabases(ASTNode ast) throws SemanticException { ShowDatabasesDesc showDatabasesDesc; if (ast.getChildCount() == 1) { String databasePattern = unescapeSQLString(ast.getChild(0).getText()); showDatabasesDesc = new ShowDatabasesDesc(ctx.getResFile(), databasePattern); } else { showDatabasesDesc = new ShowDatabasesDesc(ctx.getResFile()); } rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showDatabasesDesc))); setFetchTask(createFetchTask(showDatabasesDesc.getSchema())); }
private void analyzeShowCreateDatabase(ASTNode ast) throws SemanticException { String dbName = getUnescapedName((ASTNode)ast.getChild(0)); ShowCreateDatabaseDesc showCreateDbDesc = new ShowCreateDatabaseDesc(dbName, ctx.getResFile().toString()); Database database = getDatabase(dbName); inputs.add(new ReadEntity(database)); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showCreateDbDesc))); setFetchTask(createFetchTask(showCreateDbDesc.getSchema())); }
/** * Add a task to execute "SHOW COMPACTIONS" * @param ast The parsed command tree. * @throws SemanticException Parsing failed. */ private void analyzeShowCompactions(ASTNode ast) throws SemanticException { ShowCompactionsDesc desc = new ShowCompactionsDesc(ctx.getResFile()); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc))); setFetchTask(createFetchTask(desc.getSchema())); }
/** * Add a task to execute "SHOW COMPACTIONS" * @param ast The parsed command tree. * @throws SemanticException Parsing failed. */ private void analyzeShowTxns(ASTNode ast) throws SemanticException { ShowTxnsDesc desc = new ShowTxnsDesc(ctx.getResFile()); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), desc))); setFetchTask(createFetchTask(desc.getSchema())); }
private void analyzeShowDatabases(ASTNode ast) throws SemanticException { ShowDatabasesDesc showDatabasesDesc; if (ast.getChildCount() == 1) { String databasePattern = unescapeSQLString(ast.getChild(0).getText()); showDatabasesDesc = new ShowDatabasesDesc(ctx.getResFile(), databasePattern); } else { showDatabasesDesc = new ShowDatabasesDesc(ctx.getResFile()); } rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showDatabasesDesc), conf)); setFetchTask(createFetchTask(showDatabasesDesc.getSchema())); }
private void analyzeShowCreateDatabase(ASTNode ast) throws SemanticException { String dbName = getUnescapedName((ASTNode)ast.getChild(0)); ShowCreateDatabaseDesc showCreateDbDesc = new ShowCreateDatabaseDesc(dbName, ctx.getResFile().toString()); Database database = getDatabase(dbName); inputs.add(new ReadEntity(database)); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showCreateDbDesc), conf)); setFetchTask(createFetchTask(showCreateDbDesc.getSchema())); }
private void analyzeShowConf(ASTNode ast) throws SemanticException { String confName = stripQuotes(ast.getChild(0).getText()); ShowConfDesc showConfDesc = new ShowConfDesc(ctx.getResFile(), confName); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showConfDesc))); setFetchTask(createFetchTask(showConfDesc.getSchema())); }
private void analyzeShowConf(ASTNode ast) throws SemanticException { String confName = stripQuotes(ast.getChild(0).getText()); ShowConfDesc showConfDesc = new ShowConfDesc(ctx.getResFile(), confName); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showConfDesc), conf)); setFetchTask(createFetchTask(showConfDesc.getSchema())); }
private void analyzeShowIndexes(ASTNode ast) throws SemanticException { ShowIndexesDesc showIndexesDesc; String tableName = getUnescapedName((ASTNode) ast.getChild(0)); showIndexesDesc = new ShowIndexesDesc(tableName, ctx.getResFile()); if (ast.getChildCount() == 2) { int descOptions = ast.getChild(1).getType(); showIndexesDesc.setFormatted(descOptions == HiveParser.KW_FORMATTED); } rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), showIndexesDesc), conf)); setFetchTask(createFetchTask(showIndexesDesc.getSchema())); }
private void analyzeShowResourcePlan(ASTNode ast) throws SemanticException { String rpName = null; if (ast.getChildCount() > 0) { rpName = unescapeIdentifier(ast.getChild(0).getText()); } if (ast.getChildCount() > 1) { throw new SemanticException("Invalid syntax for SHOW RESOURCE PLAN statement"); } ShowResourcePlanDesc showResourcePlanDesc = new ShowResourcePlanDesc(rpName, ctx.getResFile()); addServiceOutput(); rootTasks.add(TaskFactory.get( new DDLWork(getInputs(), getOutputs(), showResourcePlanDesc))); setFetchTask(createFetchTask(showResourcePlanDesc.getSchema(rpName))); }