tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject tajo git commit: TAJO-2175: Fix some glitches in source code.
Date Sat, 16 Jul 2016 06:11:00 GMT
Repository: tajo
Updated Branches:
  refs/heads/master fab36f97e -> ea777aabe


TAJO-2175: Fix some glitches in source code.

Closes #1039

Signed-off-by: Jihoon Son <jihoonson@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/ea777aab
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/ea777aab
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/ea777aab

Branch: refs/heads/master
Commit: ea777aabee64552b08178204709b033c54a4e4a5
Parents: fab36f9
Author: Lee Dongjin <dongjin@apache.org>
Authored: Sat Jul 16 15:10:20 2016 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Sat Jul 16 15:10:20 2016 +0900

----------------------------------------------------------------------
 CHANGES                                           |  2 ++
 .../java/org/apache/tajo/catalog/CatalogUtil.java | 18 ++++++++----------
 .../org/apache/tajo/master/exec/DDLExecutor.java  | 10 ++++------
 .../apache/tajo/plan/logical/AlterTableNode.java  | 11 -----------
 4 files changed, 14 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/ea777aab/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f2bd964..d8dfb8a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,8 @@ Release 0.12.0 - unreleased
 
   IMPROVEMENT
 
+    TAJO-2175: Fix some glitches in source code. (Lee Dongjin via jihoon)
+
     TAJO-2146: Fragment interface cleanup. (jihoon)
 
     TAJO-2129: Apply new type implementation to Schema and Catalog. (hyunsik)

http://git-wip-us.apache.org/repos/asf/tajo/blob/ea777aab/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
index 892e5c0..7d844fa 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
@@ -488,41 +488,39 @@ public class CatalogUtil {
     Collections.addAll(IdentifierUtil.RESERVED_KEYWORDS_SET, IdentifierUtil.RESERVED_KEYWORDS);
   }
 
-  public static AlterTableDesc renameColumn(String tableName, String oldColumName, String
newColumName,
-                                            AlterTableType alterTableType) {
+  public static AlterTableDesc renameColumn(String tableName, String oldColumName, String
newColumName) {
     final AlterTableDesc alterTableDesc = new AlterTableDesc();
     alterTableDesc.setTableName(tableName);
     alterTableDesc.setColumnName(oldColumName);
     alterTableDesc.setNewColumnName(newColumName);
-    alterTableDesc.setAlterTableType(alterTableType);
+    alterTableDesc.setAlterTableType(AlterTableType.RENAME_COLUMN);
     return alterTableDesc;
   }
 
-  public static AlterTableDesc renameTable(String tableName, String newTableName, AlterTableType
alterTableType,
-                                           @Nullable Path newTablePath) {
+  public static AlterTableDesc renameTable(String tableName, String newTableName, @Nullable
Path newTablePath) {
     final AlterTableDesc alterTableDesc = new AlterTableDesc();
     alterTableDesc.setTableName(tableName);
     alterTableDesc.setNewTableName(newTableName);
-    alterTableDesc.setAlterTableType(alterTableType);
+    alterTableDesc.setAlterTableType(AlterTableType.RENAME_TABLE);
     if (newTablePath != null) {
       alterTableDesc.setNewTablePath(newTablePath);
     }
     return alterTableDesc;
   }
 
-  public static AlterTableDesc addNewColumn(String tableName, Column column, AlterTableType
alterTableType) {
+  public static AlterTableDesc addNewColumn(String tableName, Column column) {
     final AlterTableDesc alterTableDesc = new AlterTableDesc();
     alterTableDesc.setTableName(tableName);
     alterTableDesc.setAddColumn(column);
-    alterTableDesc.setAlterTableType(alterTableType);
+    alterTableDesc.setAlterTableType(AlterTableType.ADD_COLUMN);
     return alterTableDesc;
   }
 
-  public static AlterTableDesc setProperty(String tableName, KeyValueSet params, AlterTableType
alterTableType) {
+  public static AlterTableDesc setProperty(String tableName, KeyValueSet params) {
     final AlterTableDesc alterTableDesc = new AlterTableDesc();
     alterTableDesc.setTableName(tableName);
     alterTableDesc.setProperties(params);
-    alterTableDesc.setAlterTableType(alterTableType);
+    alterTableDesc.setAlterTableType(AlterTableType.SET_PROPERTY);
     return alterTableDesc;
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/ea777aab/tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java b/tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java
index 458a0c8..c5a7131 100644
--- a/tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/exec/DDLExecutor.java
@@ -457,25 +457,23 @@ public class DDLExecutor {
         fs.rename(oldPath, newPath);
       }
       catalog.alterTable(CatalogUtil.renameTable(qualifiedName, alterTable.getNewTableName(),
-          AlterTableType.RENAME_TABLE, newPath));
+          newPath));
       break;
     case RENAME_COLUMN:
       if (ensureColumnExistance(qualifiedName, alterTable.getNewColumnName())) {
         throw new DuplicateColumnException(alterTable.getNewColumnName());
       }
       catalog.alterTable(CatalogUtil.renameColumn(qualifiedName, alterTable.getColumnName(),
-          alterTable.getNewColumnName(), AlterTableType.RENAME_COLUMN));
+          alterTable.getNewColumnName()));
       break;
     case ADD_COLUMN:
       if (ensureColumnExistance(qualifiedName, alterTable.getAddNewColumn().getSimpleName()))
{
         throw new DuplicateColumnException(alterTable.getAddNewColumn().getSimpleName());
       }
-      catalog.alterTable(CatalogUtil.addNewColumn(qualifiedName, alterTable.getAddNewColumn(),
AlterTableType
-          .ADD_COLUMN));
+      catalog.alterTable(CatalogUtil.addNewColumn(qualifiedName, alterTable.getAddNewColumn()));
       break;
     case SET_PROPERTY:
-      catalog.alterTable(CatalogUtil.setProperty(qualifiedName, alterTable.getProperties(),
AlterTableType
-          .SET_PROPERTY));
+      catalog.alterTable(CatalogUtil.setProperty(qualifiedName, alterTable.getProperties()));
       break;
     case UNSET_PROPERTY:
       catalog.alterTable(CatalogUtil.unsetProperty(qualifiedName, alterTable.getUnsetPropertyKeys()));

http://git-wip-us.apache.org/repos/asf/tajo/blob/ea777aab/tajo-plan/src/main/java/org/apache/tajo/plan/logical/AlterTableNode.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/logical/AlterTableNode.java b/tajo-plan/src/main/java/org/apache/tajo/plan/logical/AlterTableNode.java
index c144dc4..b9cb355 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/logical/AlterTableNode.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/logical/AlterTableNode.java
@@ -209,17 +209,6 @@ public class AlterTableNode extends LogicalNode {
     }
   }
 
-    /*@Override
-    public Object clone() throws CloneNotSupportedException {
-        AlterTableNode alterTableNode = (AlterTableNode) super.clone();
-        alterTableNode.tableName = tableName;
-        alterTableNode.newTableName = newTableName;
-        alterTableNode.columnName = columnName;
-        alterTableNode.newColumnName=newColumnName;
-        alterTableNode.addNewColumn =(Column) addNewColumn.clone();
-        return alterTableNode;
-    }*/
-
   @Override
   public String toString() {
     return "AlterTable (table=" + tableName + ")";


Mime
View raw message