question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hive/impala can't show table schema

See original GitHub issue

I use url impala://host:port/ like this to connect to hive database , the connect is ok , and I can execute sql in the sql lab . But ‘See table schema’ don’t seem right , it shows the databaseName not the tabels.See the screenshot for detail.

Screenshots

See table schema should show tables but actually the databaseName.And the image And when clicked at the item ,it comes out the error image

the console:

impala.hiveserver2:GetOperationStatus: resp=TGetOperationStatusResp(status=TStatus(statusCode=0, infoMessages=None, sqlState=None, errorCode=None, errorMessage=None), operationState=5, sqlState=None, errorCode=0, errorMessage=“org.apache.spark.sql.AnalysisException: Table or view not found: scannetwork.scannetwork; line 1 pos 14;\n’GlobalLimit 0\n± 'LocalLimit 0\n ± 'Project [*]\n ± 'UnresolvedRelation scannetwork.scannetwork\n”)

when I excute ’ show tables’, it shows the right result as follows

image

##Environment:

Superset 0.28.1 node.js v10.15.0 npm 6.4.1 impyla 0.15.0+2.ge4f2146 SQLAlchemy 1.2.7

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shadoweracommented, Aug 28, 2019

well, it’s a matter about sparksql . it’s finally solved by edit site-packages/impala/sqlalchemy.py from

def get_table_names(self, connection, schema=None, **kw):
    query = 'SHOW TABLES'
    if schema is not None:
        query += ' IN %s' % schema
    rreturn [tup[0] for tup in connection.execute(query).fetchall()]

to

    def get_table_names(self, connection, schema=None, **kw):
        query = 'SHOW TABLES'
        if schema is not None:
            query += ' IN %s' % schema
        return [t[1] if len(t) >1  else t[0] for t in connection.execute(query).fetchall()]
1reaction
issue-label-bot[bot]commented, Aug 12, 2019

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.77. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

hive/impala can't show table schema · Issue #8027 - GitHub
But 'See table schema' don't seem right , it shows the databaseName not the tabels. See the screenshot for detail.
Read more >
Why impala not showing all tables created by Hive
So from the Impala-Shell run the following command : impala-shell -d DB_NAME -q "INVALIDATE METADATA table_name"; . But if you append new data ......
Read more >
Impala does not show data accurately after cluster restart
We noticed for few of the hive tables, during the maintenance window, just after the cluster restart, impala does not show the data ......
Read more >
SHOW Statement - Apache Impala
The SHOW FILES statement displays the files that constitute a specified table, or a partition within a partitioned table. This syntax is available...
Read more >
Infer Hive table schema automatically using Impala and Parquet
Tip: Infer table schema automatically using Impala (using CREATE ..LIKE PARQUET)Comparing Hive vs Impala optionsOption 1: Using Hive - ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found