hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hornn <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-703. Serialize HCatalog Complex ...
Date Mon, 02 May 2016 22:59:18 GMT
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/633#discussion_r61819180
  
    --- Diff: pxf/pxf-service/src/test/java/org/apache/hawq/pxf/service/MetadataResponseFormatterTest.java
---
    @@ -85,26 +86,45 @@ public void formatResponseStringWithModifiers() throws Exception {
             List<Metadata.Field> fields = new ArrayList<Metadata.Field>();
             Metadata.Item itemName = new Metadata.Item("default", "table1");
             Metadata metadata = new Metadata(itemName, fields);
    -        fields.add(new Metadata.Field("field1", "int"));
    -        fields.add(new Metadata.Field("field2", "numeric",
    +        fields.add(new Metadata.Field("field1", EnumHawqType.Int8Type, "bigint"));
    +        fields.add(new Metadata.Field("field2", EnumHawqType.NumericType, "decimal",
                     new String[] {"1349", "1789"}));
    -        fields.add(new Metadata.Field("field3", "char",
    +        fields.add(new Metadata.Field("field3", EnumHawqType.BpcharType, "char",
                     new String[] {"50"}));
             metadataList.add(metadata);
     
             response = MetadataResponseFormatter.formatResponse(metadataList, "path.file");
             StringBuilder expected = new StringBuilder("{\"PXFMetadata\":[{");
             expected.append("\"item\":{\"path\":\"default\",\"name\":\"table1\"},")
                     .append("\"fields\":[")
    -                .append("{\"name\":\"field1\",\"type\":\"int\"},")
    -                .append("{\"name\":\"field2\",\"type\":\"numeric\",\"modifiers\":[\"1349\",\"1789\"]},")
    -                .append("{\"name\":\"field3\",\"type\":\"char\",\"modifiers\":[\"50\"]}")
    +                .append("{\"name\":\"field1\",\"type\":\"int8\",\"sourceType\":\"bigint\"},")
    +                .append("{\"name\":\"field2\",\"type\":\"numeric\",\"sourceType\":\"decimal\",\"modifiers\":[\"1349\",\"1789\"]},")
    +                .append("{\"name\":\"field3\",\"type\":\"bpchar\",\"sourceType\":\"char\",\"modifiers\":[\"50\"]}")
                     .append("]}]}");
     
             assertEquals(expected.toString(), convertResponseToString(response));
         }
     
         @Test
    +    public void formatResponseStringWithSourceType() throws Exception {
    +        List<Metadata> metadataList = new ArrayList<Metadata>();
    +        List<Metadata.Field> fields = new ArrayList<Metadata.Field>();
    +        Metadata.Item itemName = new Metadata.Item("default", "table1");
    +        Metadata metadata = new Metadata(itemName, fields);
    +        fields.add(new Metadata.Field("field1", EnumHawqType.Float8Type, "double"));
    +        metadataList.add(metadata);
    +
    +        response = MetadataResponseFormatter.formatResponse(metadataList, "path.file");
    +        StringBuilder expected = new StringBuilder("{\"PXFMetadata\":[{");
    +        expected.append("\"item\":{\"path\":\"default\",\"name\":\"table1\"},")
    +                .append("\"fields\":[")
    +                .append("{\"name\":\"field1\",\"type\":\"float8\",\"sourceType\":\"double\"}")
    +                .append("]}]}");
    +
    +//        assertEquals(expected.toString(), convertResponseToString(response));
    --- End diff --
    
    uncomment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message