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 C45EE200D0A for ; Wed, 20 Sep 2017 01:49:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C2CD11609DD; Tue, 19 Sep 2017 23:49:59 +0000 (UTC) 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 10E811609E0 for ; Wed, 20 Sep 2017 01:49:58 +0200 (CEST) Received: (qmail 13388 invoked by uid 500); 19 Sep 2017 23:49:58 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 13377 invoked by uid 99); 19 Sep 2017 23:49:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2017 23:49:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 86EE6D0EA4 for ; Tue, 19 Sep 2017 23:49:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.363 X-Spam-Level: X-Spam-Status: No, score=0.363 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id As_VhKQ8083z for ; Tue, 19 Sep 2017 23:49:56 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 34F165F640 for ; Tue, 19 Sep 2017 23:49:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v8JNnrb2022465; Tue, 19 Sep 2017 23:49:53 GMT Message-Id: <201709192349.v8JNnrb2022465@ip-10-146-233-104.ec2.internal> Date: Tue, 19 Sep 2017 23:49:53 +0000 From: "Alex Behm (Code Review)" To: sandeep akinapelli , impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Matthew Jacobs , Vuk Ercegovac Reply-To: alex.behm@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-2636=3A_HS2_GetTables=28=29_returns_TABLE_TYPE_as_TABLE_for_VIEW=0A?= X-Gerrit-Change-Id: I90616388e6181cf342b3de389af940214ed46428 X-Gerrit-ChangeURL: X-Gerrit-Commit: 57b19695791becf2c489266021f5906bfe16e33c In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 archived-at: Tue, 19 Sep 2017 23:49:59 -0000 Alex Behm has posted comments on this change. Change subject: IMPALA-2636: HS2 GetTables() returns TABLE_TYPE as TABLE for VIEW ...................................................................... Patch Set 2: (12 comments) http://gerrit.cloudera.org:8080/#/c/7353/1/fe/src/main/java/org/apache/impala/service/MetadataOp.java File fe/src/main/java/org/apache/impala/service/MetadataOp.java: Line 62: private static final String TABLE_TYPE_VIEW = "VIEW"; > Hive does return VIRTUAL_VIEW if "hive.server2.table.type.mapping" is set t Agree. Only two types of tables for us: TABLE or VIEW. Let's avoid doing something like "hive.server2.table.type.mapping" which sounds like unnecessary complexity to me. Line 298: if (table.getMetaStoreTable() != null) { > I ran this locally and sometime I get null, not sure why! Looks like you have a solution, but let's spend the time to understand the problem. I can help. http://gerrit.cloudera.org:8080/#/c/7353/2/fe/src/main/java/org/apache/impala/service/MetadataOp.java File fe/src/main/java/org/apache/impala/service/MetadataOp.java: Line 468 Let's keep this hasValidTableType type flag. Calling getDbsMetadata() can be expensive and we don't want to do it unnecessarily. Line 63: private static final String TABLE_TYPE_INDEX_TABLE = "INDEX"; TABLE_TYPE_INDEX Line 77: // GetTableTypes returns values: "TABLE", "VIEW", "INDEX" Remove "INDEX", see comment below Line 494: List upperCaseTypes = null; upperCaseTableTypes Line 495: if (tableTypes != null && !tableTypes.isEmpty()) { Let's add tests to cover passing in TABLE, VIEW or both. Line 514: remove blank line (the following check still belongs to tableType) Line 515: if (upperCaseTypes != null && !upperCaseTypes.contains(tableType.toUpperCase())) continue; No need tor tableType.toUpperCase() - we know if must already be upper case (otherwise we must have a bug somewhere) Line 635: * Fills the GET_TYPEINFO_RESULTS with "TABLE", "VIEW", "INDEX". I'm thinking we should remove "INDEX" here so as not to confuse clients and users. Impala cannot load index tables so we should not advertise them as a valid table type (you will always get an empty result set if you ask for index tables). http://gerrit.cloudera.org:8080/#/c/7353/2/fe/src/test/java/org/apache/impala/service/FrontendTest.java File fe/src/test/java/org/apache/impala/service/FrontendTest.java: Line 308: assertEquals("INDEX", resp.rows.get(2).getColVals().get(0).string_val); Remove, I don't think we should advertise this as a valid table type - Impala cannot load or use Hive indexes. http://gerrit.cloudera.org:8080/#/c/7353/2/fe/src/test/java/org/apache/impala/service/JdbcTest.java File fe/src/test/java/org/apache/impala/service/JdbcTest.java: Line 200: assertEquals(rs.getString(1).toLowerCase(), "index"); remove -- To view, visit http://gerrit.cloudera.org:8080/7353 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90616388e6181cf342b3de389af940214ed46428 Gerrit-PatchSet: 2 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: sandeep akinapelli Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Matthew Jacobs Gerrit-Reviewer: Vuk Ercegovac Gerrit-Reviewer: sandeep akinapelli Gerrit-HasComments: Yes