Skip to content

Commit

Permalink
HIVE-26119: Remove unnecessary Exceptions from DDLPlanUtils (Soumyaka…
Browse files Browse the repository at this point in the history
…nti Das, reviewed by Stamatis Zampetakis)

Closes apache#3184
  • Loading branch information
soumyakanti3578 authored and zabetak committed Apr 7, 2022
1 parent 2f3dd9a commit 71b62c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions ql/src/java/org/apache/hadoop/hive/ql/exec/DDLPlanUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.apache.hadoop.hive.ql.metadata.ForeignKeyInfo;
import org.apache.hadoop.hive.ql.metadata.Hive;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.metadata.HiveUtils;
import org.apache.hadoop.hive.ql.metadata.NotNullConstraint;
import org.apache.hadoop.hive.ql.metadata.Partition;
import org.apache.hadoop.hive.ql.metadata.PrimaryKeyInfo;
Expand Down Expand Up @@ -607,7 +606,6 @@ public List<String> getDDLPlanForPartitionWithStats(Table table,
*
* @param tbl
* @return Returns the alter table .... update statistics for table
* @throws HiveException
*/
public String getAlterTableStmtTableStatsBasic(Table tbl) {
Map<String, String> parameters = tbl.getParameters();
Expand Down Expand Up @@ -793,7 +791,7 @@ public String getCreateViewCommand(Table table, boolean isRelative) {
}


public String getCreateTableCommand(Table table, boolean isRelative) throws HiveException {
public String getCreateTableCommand(Table table, boolean isRelative) {
ST command = new ST(CREATE_TABLE_TEMPLATE);

if (!isRelative) {
Expand Down Expand Up @@ -823,7 +821,7 @@ private String getExternal(Table table) {
return table.getTableType() == TableType.EXTERNAL_TABLE ? "EXTERNAL " : "";
}

private String getColumns(Table table) throws HiveException {
private String getColumns(Table table) {
List<String> columnDescs = new ArrayList<String>();
for (FieldSchema column : table.getCols()) {
String columnType = formatType(TypeInfoUtils.getTypeInfoFromTypeString(column.getType()));
Expand All @@ -839,7 +837,7 @@ private String getColumns(Table table) throws HiveException {
/**
* Struct fields are identifiers, need to be put between ``.
*/
private String formatType(TypeInfo typeInfo) throws HiveException {
private String formatType(TypeInfo typeInfo) {
switch (typeInfo.getCategory()) {
case PRIMITIVE:
return typeInfo.getTypeName();
Expand Down
5 changes: 2 additions & 3 deletions ql/src/java/org/apache/hadoop/hive/ql/exec/ExplainTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ private JSONObject getLocks(PrintStream out, ExplainWork work) {
return jsonObject;
}

public void addCreateTableStatement(Table table, List<String> tableCreateStmt , DDLPlanUtils ddlPlanUtils)
throws HiveException {
public void addCreateTableStatement(Table table, List<String> tableCreateStmt , DDLPlanUtils ddlPlanUtils) {
tableCreateStmt.add(ddlPlanUtils.getCreateTableCommand(table, false) + ";");
}

Expand Down Expand Up @@ -489,7 +488,7 @@ public void addExplain(String sql , List<String> explainStmt, DDLPlanUtils ddlPl
return;
}

public void getDDLPlan(PrintStream out) throws HiveException, MetaException, Exception {
public void getDDLPlan(PrintStream out) throws Exception {
DDLPlanUtils ddlPlanUtils = new DDLPlanUtils();
Set<String> createDatabase = new TreeSet<String>();
List<String> tableCreateStmt = new LinkedList<String>();
Expand Down

0 comments on commit 71b62c6

Please sign in to comment.