You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@impala.apache.org by Vibhath Ileperuma <vi...@gmail.com> on 2021/04/07 10:33:07 UTC

An impala view is identified as a table when dropping.

Hi all,

When I try to drop a view using 'drop view' statement, I get an error
mentioning 'drop view cannot be use for a table'. I checked the table
metadata using catalogd web ui. TCatalogObject type is shown as 4 in there.
But for all other tables and views, type is 3.

Could you please let me know the reason behind this issue.

Thank you,
Vibhath.

Re: An impala view is identified as a table when dropping.

Posted by Quanlong Huang <hu...@gmail.com>.
It's strange since type 4 means VIEW actually:

enum TCatalogObjectType {
  // UNKNOWN is used to indicate an error condition when converting
  // strings to their matching TCatalogObjectType.
  UNKNOWN = 0
  CATALOG = 1
  DATABASE = 2
  TABLE = 3
  VIEW = 4
  FUNCTION = 5
  DATA_SOURCE = 6
  PRINCIPAL = 7
  PRIVILEGE = 8
  HDFS_CACHE_POOL = 9
  // A catalog object type as a marker for authorization cache invalidation.
  AUTHZ_CACHE_INVALIDATION = 10
  HDFS_PARTITION = 11
}

I can't reproduce the issue locally. The only case that a view is treated
as a table is when its metadata is unloaded. So catalogd just get its name
and consider its type as TABLE by default. However, when analyzing the drop
view statement, the coordinator will trigger metadata loading on the view.
So catalogd should get its actual type. Maybe there is a concurrent
INVALIDATE METADATA running on the table or globally, and it clears the
view's metadata cache after catalogd loads it and before catalogd executes
the drop view request.

Is the issue reproducible when you just execute the drop view statement
without any other concurrent statements? BTW, could you provide the Impala
version?

Thanks,
Quanlong

On Wed, Apr 7, 2021 at 6:33 PM Vibhath Ileperuma <
vibhatharunapriya@gmail.com> wrote:

> Hi all,
>
> When I try to drop a view using 'drop view' statement, I get an error
> mentioning 'drop view cannot be use for a table'. I checked the table
> metadata using catalogd web ui. TCatalogObject type is shown as 4 in there.
> But for all other tables and views, type is 3.
>
> Could you please let me know the reason behind this issue.
>
> Thank you,
> Vibhath.
>