private int descDatabase(Hive db, DescDatabaseDesc descDatabase) throws HiveException { DataOutputStream outStream = getOutputStream(descDatabase.getResFile()); try { Database database = db.getDatabase(descDatabase.getDatabaseName()); throw new HiveException(ErrorMsg.DATABASE_NOT_EXISTS, descDatabase.getDatabaseName()); if (descDatabase.isExt()) { params = database.getParameters();
/** * Describe database. * * @param ast * @throws SemanticException */ private void analyzeDescDatabase(ASTNode ast) throws SemanticException { boolean isExtended; String dbName; if (ast.getChildCount() == 1) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = false; } else if (ast.getChildCount() == 2) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = true; } else { throw new SemanticException("Unexpected Tokens at DESCRIBE DATABASE"); } DescDatabaseDesc descDbDesc = new DescDatabaseDesc(ctx.getResFile(), dbName, isExtended); inputs.add(new ReadEntity(getDatabase(dbName))); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), descDbDesc))); setFetchTask(createFetchTask(descDbDesc.getSchema())); }
Database db = cntxt.getHive().getDatabase(descDb.getDatabaseName()); authorize(db, Privilege.SELECT);
Database db = cntxt.getHive().getDatabase(descDb.getDatabaseName()); authorize(db, Privilege.SELECT);
private int descDatabase(Hive db, DescDatabaseDesc descDatabase) throws HiveException { DataOutputStream outStream = getOutputStream(descDatabase.getResFile()); try { Database database = db.getDatabase(descDatabase.getDatabaseName()); throw new HiveException(ErrorMsg.DATABASE_NOT_EXISTS, descDatabase.getDatabaseName()); if (descDatabase.isExt()) { params = database.getParameters();
/** * Describe database. * * @param ast * @throws SemanticException */ private void analyzeDescDatabase(ASTNode ast) throws SemanticException { boolean isExtended; String dbName; if (ast.getChildCount() == 1) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = false; } else if (ast.getChildCount() == 2) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = true; } else { throw new SemanticException("Unexpected Tokens at DESCRIBE DATABASE"); } DescDatabaseDesc descDbDesc = new DescDatabaseDesc(ctx.getResFile(), dbName, isExtended); inputs.add(new ReadEntity(getDatabase(dbName))); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), descDbDesc), conf)); setFetchTask(createFetchTask(descDbDesc.getSchema())); }
Database db = cntxt.getHive().getDatabase(descDb.getDatabaseName()); authorize(db, Privilege.SELECT);
private int descDatabase(DescDatabaseDesc descDatabase) throws HiveException { try { Path resFile = new Path(descDatabase.getResFile()); FileSystem fs = resFile.getFileSystem(conf); DataOutput outStream = fs.create(resFile); Database database = db.getDatabase(descDatabase.getDatabaseName()); if (descDatabase.isExt() && database.getParametersSize() > 0) { Map<String, String> params = database.getParameters(); outStream.writeBytes(params.toString()); outStream.writeBytes("No such database: " + descDatabase.getDatabaseName());
/** * Describe database. * * @param ast * @throws SemanticException */ private void analyzeDescDatabase(ASTNode ast) throws SemanticException { boolean isExtended; String dbName; if (ast.getChildCount() == 1) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = false; } else if (ast.getChildCount() == 2) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = true; } else { throw new SemanticException("Unexpected Tokens at DESCRIBE DATABASE"); } DescDatabaseDesc descDbDesc = new DescDatabaseDesc(ctx.getResFile(), dbName, isExtended); inputs.add(new ReadEntity(getDatabase(dbName))); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), descDbDesc), conf)); setFetchTask(createFetchTask(descDbDesc.getSchema())); }
Database db = cntxt.getHive().getDatabase(descDb.getDatabaseName()); authorize(db, Privilege.SELECT);
private int descDatabase(DescDatabaseDesc descDatabase) throws HiveException { DataOutputStream outStream = null; try { Path resFile = new Path(descDatabase.getResFile()); FileSystem fs = resFile.getFileSystem(conf); outStream = fs.create(resFile); Database database = db.getDatabase(descDatabase.getDatabaseName()); throw new HiveException(ErrorMsg.DATABASE_NOT_EXISTS, descDatabase.getDatabaseName()); if (descDatabase.isExt()) { params = database.getParameters();
/** * Describe database. * @param ast * @throws SemanticException */ private void analyzeDescDatabase(ASTNode ast) throws SemanticException { boolean isExtended; String dbName; if (ast.getChildCount() == 1) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = false; } else if (ast.getChildCount() == 2) { dbName = stripQuotes(ast.getChild(0).getText()); isExtended = true; } else { throw new SemanticException("Unexpected Tokens at DESCRIBE DATABASE"); } DescDatabaseDesc descDbDesc = new DescDatabaseDesc(ctx.getResFile(), dbName, isExtended); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), descDbDesc), conf)); setFetchTask(createFetchTask(descDbDesc.getSchema())); }
Database db = cntxt.getHive().getDatabase(descDb.getDatabaseName()); authorize(db, Privilege.SELECT);