Repository: tajo Updated Branches: refs/heads/master 0a1a41d25 -> 044fd49a1
TAJO-1548: Refactoring condition code for CHAR into CatalogUtil. Closes #531 Signed-off-by: JaeHwa Jung <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/tajo/repo Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/044fd49a Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/044fd49a Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/044fd49a Branch: refs/heads/master Commit: 044fd49a157424aef658d20025a9be094ff25334 Parents: 0a1a41d Author: DaeMyung Kang <[email protected]> Authored: Mon Apr 20 11:51:14 2015 +0900 Committer: JaeHwa Jung <[email protected]> Committed: Mon Apr 20 11:51:14 2015 +0900 ---------------------------------------------------------------------- CHANGES | 3 +++ .../src/main/java/org/apache/tajo/catalog/CatalogUtil.java | 6 +++++- .../src/main/java/org/apache/tajo/catalog/Schema.java | 3 --- 3 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tajo/blob/044fd49a/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 694e2ae..19315cf 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,9 @@ Release 0.11.0 - unreleased IMPROVEMENT + TAJO-1548: Refactoring condition code for CHAR into CatalogUtil. + (Contributed by DaeMyung Kang, Committed by jaehwa) + TAJO-1570: CatalogUtil newSimpleDataTypeArray should use newSimpleDataType. (Contributed by DaeMyung Kang, Committed by jihoon) http://git-wip-us.apache.org/repos/asf/tajo/blob/044fd49a/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 dd41292..12f36b1 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 @@ -343,7 +343,11 @@ public class CatalogUtil { } public static DataType newSimpleDataType(Type type) { - return DataType.newBuilder().setType(type).build(); + if (type != Type.CHAR) { + return DataType.newBuilder().setType(type).build(); + } else { + return newDataTypeWithLen(Type.CHAR, 1); + } } /** http://git-wip-us.apache.org/repos/asf/tajo/blob/044fd49a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java ---------------------------------------------------------------------- diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java index ed2cd2c..fcbd177 100644 --- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java +++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Schema.java @@ -327,9 +327,6 @@ public class Schema implements ProtoObject<SchemaProto>, Cloneable, GsonObject { } public synchronized Schema addColumn(String name, Type type) { - if (type == Type.CHAR) { - return addColumn(name, CatalogUtil.newDataTypeWithLen(type, 1)); - } return addColumn(name, CatalogUtil.newSimpleDataType(type)); }
