Affects Version/s: None
Fix Version/s: None
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.