Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 976422009D9 for ; Tue, 3 May 2016 00:59:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 961BF1609B0; Tue, 3 May 2016 00:59:23 +0200 (CEST) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D9AD31602C5 for ; Tue, 3 May 2016 00:59:22 +0200 (CEST) Received: (qmail 1796 invoked by uid 500); 2 May 2016 22:59:22 -0000 Mailing-List: contact dev-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list dev@hawq.incubator.apache.org Received: (qmail 1785 invoked by uid 99); 2 May 2016 22:59:21 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 22:59:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 63C25C0183 for ; Mon, 2 May 2016 22:59:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.021 X-Spam-Level: X-Spam-Status: No, score=-4.021 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ytdNMdFb8q6m for ; Mon, 2 May 2016 22:59:19 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 29B5A5FACB for ; Mon, 2 May 2016 22:59:18 +0000 (UTC) Received: (qmail 1760 invoked by uid 99); 2 May 2016 22:59:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 22:59:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4D60ADFB73; Mon, 2 May 2016 22:59:18 +0000 (UTC) From: hornn To: dev@hawq.incubator.apache.org Reply-To: dev@hawq.incubator.apache.org References: In-Reply-To: Subject: [GitHub] incubator-hawq pull request: HAWQ-703. Serialize HCatalog Complex ... Content-Type: text/plain Message-Id: <20160502225918.4D60ADFB73@git1-us-west.apache.org> Date: Mon, 2 May 2016 22:59:18 +0000 (UTC) archived-at: Mon, 02 May 2016 22:59:23 -0000 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 fields = new ArrayList(); 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 metadataList = new ArrayList(); + List fields = new ArrayList(); + 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. ---