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

Tables and Databases sharing same name can cause query failures if table is not readable by Impala

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Catalog
    • None
    • ghx-label-9

    Description

      Please see below scenario:

      1) CREATE DATABASE a;
      2) Create tables "a.b" and "default.a". However, create "default.a" in a format which Impala cannot read. For example: Open CSV Serde from Hive.
      3) Connect to Impala and execute below statements -
      a) INVALIDATE METADATA;
      b) use default;
      c) select * from a.b;

      Above query will lead to following exception:

      CAUSED BY: TableLoadingException: Unrecognized table type for table: default.a

      If the database of query "select * from a.b;" is changed to any other database then, the query executes successfully. For example:
      use test1 or use test;
      select * from a.b;

      Also, if the table "default.a" is created with a format that Impala can read/load, query "select * from a.b" executes successfully.

      Above scenario occurs as Impala can refer to the collection column b in table a in database default, or it can refer to table b in database a. As Impala cannot disambiguate between the two cases unless it knows that there is a collection column b be in default.a, it loads metadata of table "default.a" while executing query on table "a.b". If the table "default.a" exists and is not readable by Impala, any query executed on tables available in database "a" from default database will fail. For a better UX, we should improve/change this behavior.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            karandatta Karan Datta

            Dates

              Created:
              Updated:

              Slack

                Issue deployment