hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odiache...@apache.org
Subject incubator-hawq git commit: HAWQ-992. Deleted CHAR type because it's not being used.
Date Tue, 06 Sep 2016 21:32:48 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/HAWQ-992 6f1668f62 -> 507cd44ba


HAWQ-992. Deleted CHAR type because it's not being used.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/507cd44b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/507cd44b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/507cd44b

Branch: refs/heads/HAWQ-992
Commit: 507cd44ba6f6cf4fc859933ca3ea609ff9b2441e
Parents: 6f1668f
Author: Oleksandr Diachenko <odiachenko@pivotal.io>
Authored: Tue Sep 6 14:32:13 2016 -0700
Committer: Oleksandr Diachenko <odiachenko@pivotal.io>
Committed: Tue Sep 6 14:32:13 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hawq/pxf/api/io/DataType.java    |  4 ----
 .../hawq/pxf/api/utilities/EnumHawqType.java    | 22 +++-----------------
 .../plugins/hive/utilities/HiveUtilities.java   |  4 ----
 .../hawq/pxf/plugins/json/JsonResolver.java     |  3 ---
 .../pxf/plugins/json/JsonExtensionTest.java     |  3 +--
 .../hawq/pxf/service/BridgeOutputBuilder.java   |  1 -
 .../pxf/service/BridgeOutputBuilderTest.java    | 19 +++++++----------
 .../hawq/pxf/service/io/GPDBWritableTest.java   |  3 ---
 8 files changed, 12 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/io/DataType.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/io/DataType.java b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/io/DataType.java
index af17301..cac700c 100644
--- a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/io/DataType.java
+++ b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/io/DataType.java
@@ -31,10 +31,6 @@ import java.util.Map;
 public enum DataType {
     BOOLEAN(16),
     BYTEA(17),
-    /**
-     * single character
-     */
-    CHAR(18),
     BIGINT(20),
     SMALLINT(21),
     INTEGER(23),

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/EnumHawqType.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/EnumHawqType.java
b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/EnumHawqType.java
index f464028..83499f3 100644
--- a/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/EnumHawqType.java
+++ b/pxf/pxf-api/src/main/java/org/apache/hawq/pxf/api/utilities/EnumHawqType.java
@@ -51,20 +51,17 @@ public enum EnumHawqType {
     Float4Type("float4", DataType.REAL),
     Float8Type("float8", DataType.FLOAT8),
     TextType("text", DataType.TEXT),
-    VarcharType("varchar", DataType.VARCHAR, (byte) 1, false),
+    VarcharType("varchar", DataType.VARCHAR, (byte) 1),
     ByteaType("bytea", DataType.BYTEA),
     DateType("date", DataType.DATE),
     TimestampType("timestamp", DataType.TIMESTAMP),
     BoolType("bool", DataType.BOOLEAN),
-    NumericType("numeric", DataType.NUMERIC, (byte) 2, false),
-    BpcharType("bpchar", DataType.BPCHAR, (byte) 1, false),
-    //modifier is mandatory for this type because by default it's 1
-    CharType("char", DataType.CHAR, (byte) 1, true);
+    NumericType("numeric", DataType.NUMERIC, (byte) 2),
+    BpcharType("bpchar", DataType.BPCHAR, (byte) 1);
 
     private DataType dataType;
     private String typeName;
     private byte modifiersNum;
-    private boolean mandatoryModifiers;
 
     EnumHawqType(String typeName, DataType dataType) {
         this.typeName = typeName;
@@ -76,11 +73,6 @@ public enum EnumHawqType {
         this.modifiersNum = modifiersNum;
     }
 
-    EnumHawqType(String typeName, DataType dataType, byte modifiersNum, boolean mandatoryModifiers)
{
-        this(typeName, dataType, modifiersNum);
-        this.mandatoryModifiers = mandatoryModifiers;
-    }
-
     /**
      * 
      * @return name of type
@@ -106,12 +98,4 @@ public enum EnumHawqType {
         return this.dataType;
     }
 
-    /**
-     * 
-     * @return whether modifiers are mandatory for this type
-     */
-    public boolean isMandatoryModifiers() {
-        return mandatoryModifiers;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
index 66cfb3b..c0da58b 100644
--- a/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
+++ b/pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/utilities/HiveUtilities.java
@@ -298,14 +298,10 @@ public class HiveUtilities {
                     ", actual HAWQ type " + hawqDataType);
         }
 
-        if ((hawqTypeMods == null || hawqTypeMods.length == 0) && expectedHawqType.isMandatoryModifiers())
-            throw new UnsupportedTypeException("Invalid definition for column " + hawqColumnName
+  ": modifiers are mandatory for type " + expectedHawqType.getTypeName());
-
         switch (hawqDataType) {
             case NUMERIC:
             case VARCHAR:
             case BPCHAR:
-            case CHAR:
                 if (hawqTypeMods != null && hawqTypeMods.length > 0) {
                     Integer[] hiveTypeModifiers = EnumHiveToHawqType
                             .extractModifiers(hiveType);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-json/src/main/java/org/apache/hawq/pxf/plugins/json/JsonResolver.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-json/src/main/java/org/apache/hawq/pxf/plugins/json/JsonResolver.java
b/pxf/pxf-json/src/main/java/org/apache/hawq/pxf/plugins/json/JsonResolver.java
index 21db6b7..92e01ed 100644
--- a/pxf/pxf-json/src/main/java/org/apache/hawq/pxf/plugins/json/JsonResolver.java
+++ b/pxf/pxf-json/src/main/java/org/apache/hawq/pxf/plugins/json/JsonResolver.java
@@ -196,9 +196,6 @@ public class JsonResolver extends Plugin implements ReadResolver {
 			case BOOLEAN:
 				oneField.val = val.asBoolean();
 				break;
-			case CHAR:
-				oneField.val = val.asText().charAt(0);
-				break;
 			case BYTEA:
 				oneField.val = val.asText().getBytes();
 				break;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/JsonExtensionTest.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/JsonExtensionTest.java
b/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/JsonExtensionTest.java
index a8161c1..33051b0 100644
--- a/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/JsonExtensionTest.java
+++ b/pxf/pxf-json/src/test/java/org/apache/hawq/pxf/plugins/json/JsonExtensionTest.java
@@ -119,11 +119,10 @@ public class JsonExtensionTest extends PxfUnit {
 		columnDefs.add(new Pair<String, DataType>("realType", DataType.REAL));
 		columnDefs.add(new Pair<String, DataType>("float8Type", DataType.FLOAT8));
 		// The DataType.BYTEA type is left out for further validation.
-		columnDefs.add(new Pair<String, DataType>("charType", DataType.CHAR));
 		columnDefs.add(new Pair<String, DataType>("booleanType", DataType.BOOLEAN));
 		columnDefs.add(new Pair<String, DataType>("bintType", DataType.BIGINT));
 
-		output.add(",varcharType,bpcharType,777,999,3.15,3.14,x,true,666");
+		output.add(",varcharType,bpcharType,777,999,3.15,3.14,true,666");
 
 		super.assertOutput(new Path(System.getProperty("user.dir") + File.separator
 				+ "src/test/resources/datatypes-test.json"), output);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/BridgeOutputBuilder.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/BridgeOutputBuilder.java
b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/BridgeOutputBuilder.java
index c59fbea..d04a2f4 100644
--- a/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/BridgeOutputBuilder.java
+++ b/pxf/pxf-service/src/main/java/org/apache/hawq/pxf/service/BridgeOutputBuilder.java
@@ -373,7 +373,6 @@ public class BridgeOutputBuilder {
                     break;
                 case VARCHAR:
                 case BPCHAR:
-                case CHAR:
                 case TEXT:
                 case NUMERIC:
                 case TIMESTAMP:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/BridgeOutputBuilderTest.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/BridgeOutputBuilderTest.java
b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/BridgeOutputBuilderTest.java
index 7b1d136..a00910d 100644
--- a/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/BridgeOutputBuilderTest.java
+++ b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/BridgeOutputBuilderTest.java
@@ -138,7 +138,7 @@ public class BridgeOutputBuilderTest {
     @Test
     public void testFillGPDBWritable() throws Exception {
         Map<String, String> parameters = new HashMap<String, String>();
-        parameters.put("X-GP-ATTRS", "14");
+        parameters.put("X-GP-ATTRS", "13");
 
         addColumn(parameters, 0, DataType.INTEGER, "col0");
         addColumn(parameters, 1, DataType.FLOAT8, "col1");
@@ -149,11 +149,10 @@ public class BridgeOutputBuilderTest {
         addColumn(parameters, 6, DataType.BYTEA, "col6");
         addColumn(parameters, 7, DataType.VARCHAR, "col7");
         addColumn(parameters, 8, DataType.BPCHAR, "col8");
-        addColumn(parameters, 9, DataType.CHAR, "col9");
-        addColumn(parameters, 10, DataType.TEXT, "col10");
-        addColumn(parameters, 11, DataType.NUMERIC, "col11");
-        addColumn(parameters, 12, DataType.TIMESTAMP, "col12");
-        addColumn(parameters, 13, DataType.DATE, "col13");
+        addColumn(parameters, 9, DataType.TEXT, "col9");
+        addColumn(parameters, 10, DataType.NUMERIC, "col10");
+        addColumn(parameters, 11, DataType.TIMESTAMP, "col11");
+        addColumn(parameters, 12, DataType.DATE, "col12");
 
         BridgeOutputBuilder builder = makeBuilder(parameters);
         output = builder.makeGPDBWritableOutput();
@@ -168,7 +167,6 @@ public class BridgeOutputBuilderTest {
                         DataType.BYTEA.getOID(), new byte[] { 0 }),
                 new OneField(DataType.VARCHAR.getOID(), "value"), new OneField(
                         DataType.BPCHAR.getOID(), "value"), new OneField(
-                        DataType.CHAR.getOID(), "value"), new OneField(
                         DataType.TEXT.getOID(), "value"), new OneField(
                         DataType.NUMERIC.getOID(), "0"), new OneField(
                         DataType.TIMESTAMP.getOID(), new Timestamp(0)),
@@ -185,10 +183,9 @@ public class BridgeOutputBuilderTest {
         assertEquals(output.getString(7), "value\0");
         assertEquals(output.getString(8), "value\0");
         assertEquals(output.getString(9), "value\0");
-        assertEquals(output.getString(10), "value\0");
-        assertEquals(output.getString(11), "0\0");
-        assertEquals(Timestamp.valueOf(output.getString(12)), new Timestamp(0));
-        assertEquals(Date.valueOf(output.getString(13).trim()).toString(),
+        assertEquals(output.getString(10), "0\0");
+        assertEquals(Timestamp.valueOf(output.getString(11)), new Timestamp(0));
+        assertEquals(Date.valueOf(output.getString(12).trim()).toString(),
                 new Date(1).toString());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/507cd44b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/io/GPDBWritableTest.java
----------------------------------------------------------------------
diff --git a/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/io/GPDBWritableTest.java
b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/io/GPDBWritableTest.java
index 7a6f0af..f205b9c 100644
--- a/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/io/GPDBWritableTest.java
+++ b/pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/io/GPDBWritableTest.java
@@ -140,9 +140,6 @@ public class GPDBWritableTest {
         typeName = GPDBWritable.getTypeName(DataType.BYTEA.getOID());
         assertEquals(typeName, DataType.BYTEA.name());
 
-        typeName = GPDBWritable.getTypeName(DataType.CHAR.getOID());
-        assertEquals(typeName, DataType.CHAR.name());
-
         typeName = GPDBWritable.getTypeName(DataType.BIGINT.getOID());
         assertEquals(typeName, DataType.BIGINT.name());
 


Mime
View raw message