Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-2636

HS2 GetTables() returns TABLE_TYPE as TABLE for VIEW

    XMLWordPrintableJSON

    Details

      Description

      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:

      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);
            }
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sakinapelli sandeep akinapelli
                Reporter:
                jennykim Jenny Kim
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: