/** * Handle alter table <name> not stored as directories * * @param tableName * @param tab * @throws SemanticException */ private void handleAlterTableDisableStoredAsDirs(String tableName, Table tab) throws SemanticException { List<String> skewedColNames = tab.getSkewedColNames(); List<List<String>> skewedColValues = tab.getSkewedColValues(); if ((skewedColNames == null) || (skewedColNames.size() == 0) || (skewedColValues == null) || (skewedColValues.size() == 0)) { throw new SemanticException(ErrorMsg.ALTER_TBL_STOREDASDIR_NOT_SKEWED.getMsg(tableName)); } AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, false, skewedColNames, skewedColValues); alterTblDesc.setStoredAsSubDirectories(false); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc))); }
/** * Handle alter table <name> not stored as directories * * @param tableName * @param tab * @throws SemanticException */ private void handleAlterTableDisableStoredAsDirs(String tableName, Table tab) throws SemanticException { List<String> skewedColNames = tab.getSkewedColNames(); List<List<String>> skewedColValues = tab.getSkewedColValues(); if ((skewedColNames == null) || (skewedColNames.size() == 0) || (skewedColValues == null) || (skewedColValues.size() == 0)) { throw new SemanticException(ErrorMsg.ALTER_TBL_STOREDASDIR_NOT_SKEWED.getMsg(tableName)); } AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, false, skewedColNames, skewedColValues); alterTblDesc.setStoredAsSubDirectories(false); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf)); }
/** * Process "alter table <name> skewed by .. on .. stored as directories * @param ast * @param tableName * @param tab * @throws SemanticException */ private void handleAlterTableSkewedBy(ASTNode ast, String tableName, Table tab) throws SemanticException { List<String> skewedColNames = new ArrayList<String>(); List<List<String>> skewedValues = new ArrayList<List<String>>(); /* skewed column names. */ ASTNode skewedNode = (ASTNode) ast.getChild(0); skewedColNames = analyzeSkewedTablDDLColNames(skewedColNames, skewedNode); /* skewed value. */ analyzeDDLSkewedValues(skewedValues, skewedNode); // stored as directories boolean storedAsDirs = analyzeStoredAdDirs(skewedNode); AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, false, skewedColNames, skewedValues); alterTblDesc.setStoredAsSubDirectories(storedAsDirs); /** * Validate information about skewed table */ alterTblDesc.setTable(tab); alterTblDesc.validate(); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc))); }
alterTblDesc.setStoredAsSubDirectories(false); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc)));
/** * Process "alter table <name> skewed by .. on .. stored as directories * @param ast * @param tableName * @param tab * @throws SemanticException */ private void handleAlterTableSkewedBy(ASTNode ast, String tableName, Table tab) throws SemanticException { List<String> skewedColNames = new ArrayList<String>(); List<List<String>> skewedValues = new ArrayList<List<String>>(); /* skewed column names. */ ASTNode skewedNode = (ASTNode) ast.getChild(0); skewedColNames = analyzeSkewedTablDDLColNames(skewedColNames, skewedNode); /* skewed value. */ analyzeDDLSkewedValues(skewedValues, skewedNode); // stored as directories boolean storedAsDirs = analyzeStoredAdDirs(skewedNode); AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, false, skewedColNames, skewedValues); alterTblDesc.setStoredAsSubDirectories(storedAsDirs); /** * Validate information about skewed table */ alterTblDesc.setTable(tab); alterTblDesc.validate(); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf)); }
alterTblDesc.setStoredAsSubDirectories(false); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf));
/** * Handle alter table <name> not stored as directories * * @param tableName * @param tab * @throws SemanticException */ private void handleAlterTableDisableStoredAsDirs(String tableName, Table tab) throws SemanticException { List<String> skewedColNames = tab.getSkewedColNames(); List<List<String>> skewedColValues = tab.getSkewedColValues(); if ((skewedColNames == null) || (skewedColNames.size() == 0) || (skewedColValues == null) || (skewedColValues.size() == 0)) { throw new SemanticException(ErrorMsg.ALTER_TBL_STOREDASDIR_NOT_SKEWED.getMsg(tableName)); } AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, false, skewedColNames, skewedColValues); alterTblDesc.setStoredAsSubDirectories(false); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf)); }
/** * Process "alter table <name> skewed by .. on .. stored as directories * @param ast * @param tableName * @param tab * @throws SemanticException */ private void handleAlterTableSkewedBy(ASTNode ast, String tableName, Table tab) throws SemanticException { List<String> skewedColNames = new ArrayList<String>(); List<List<String>> skewedValues = new ArrayList<List<String>>(); /* skewed column names. */ ASTNode skewedNode = (ASTNode) ast.getChild(0); skewedColNames = analyzeSkewedTablDDLColNames(skewedColNames, skewedNode); /* skewed value. */ analyzeDDLSkewedValues(skewedValues, skewedNode); // stored as directories boolean storedAsDirs = analyzeStoredAdDirs(skewedNode); AlterTableDesc alterTblDesc = new AlterTableDesc(tableName, false, skewedColNames, skewedValues); alterTblDesc.setStoredAsSubDirectories(storedAsDirs); /** * Validate information about skewed table */ alterTblDesc.setTable(tab); alterTblDesc.validate(); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf)); }
alterTblDesc.setStoredAsSubDirectories(false); rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), alterTblDesc), conf));