You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "sandeep akinapelli (JIRA)" <ji...@apache.org> on 2017/10/10 00:33:00 UTC

[jira] [Resolved] (IMPALA-2636) HS2 GetTables() returns TABLE_TYPE as TABLE for VIEW

     [ https://issues.apache.org/jira/browse/IMPALA-2636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sandeep akinapelli resolved IMPALA-2636.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.10.0


IMPALA-2636: HS2 GetTables() returns TABLE_TYPE as TABLE for VIEW

Added code to read the table type from metastore table but defaults to
"TABLE" if the metastore table is not loaded.
After the change, GetTabletypes also returns "VIEW" apart from "TABLE"
Changed unit and jdbc testcases for GetTableTypes.
Added new Frontend test for reading views.

Change-Id: I90616388e6181cf342b3de389af940214ed46428
Reviewed-on: http://gerrit.cloudera.org:8080/7353
Reviewed-by: Alex Behm <al...@cloudera.com>
Tested-by: Impala Public Jenkins

> HS2 GetTables() returns TABLE_TYPE as TABLE for VIEW
> ----------------------------------------------------
>
>                 Key: IMPALA-2636
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2636
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Catalog
>    Affects Versions: Impala 2.2.4, Impala 2.3.0
>            Reporter: Jenny Kim
>            Assignee: sandeep akinapelli
>            Priority: Minor
>              Labels: catalog-server, hue, ramp-up, usability
>             Fix For: Impala 2.10.0
>
>
> When fetching tables using HS2's GetTables endpoint, the TABLE_TYPE value returned by Impala for views and index tables is still "Table".
> In contrast, Hive returns "VIEW" and "INDEX_TABLE".
> Here's the problem, in {{MetadataOp.java}}:
> {code}
> for (int i = 0; i < dbsMetadata.dbs.size(); ++i) {
>       String dbName = dbsMetadata.dbs.get(i);
>       for (int j = 0; j < dbsMetadata.tableNames.get(i).size(); ++j) {
>         String tabName = dbsMetadata.tableNames.get(i).get(j);
>         TResultRow row = new TResultRow();
>         row.colVals = Lists.newArrayList();
>         row.colVals.add(EMPTY_COL_VAL);
>         row.colVals.add(createTColumnValue(dbName));
>         row.colVals.add(createTColumnValue(tabName));
>         row.colVals.add(TABLE_TYPE_COL_VAL); // <<<<<<<<<< This is 'TABLE'.
>         // TODO: Return table comments when it is available in the Impala catalog.
>         row.colVals.add(EMPTY_COL_VAL); 
>         result.rows.add(row);
>       }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)