Skip to content
Advertisement

How to check if a table exists in Hive?

I am connecting to Hive via an ODBC driver from a .NET application. Is there a query to determine if a table already exists?

For example, in MSSQL you can query the INFORMATION_SCHEMA table and in Netezza you can query the _v_table table.

Any assistance would be appreciated.

Advertisement

Answer

There are two approaches by which you can check that:

1.) As @dimamah suggested, just to add one point here, for this approach you need to

2.) Second approach is to use HiveMetastoreClient APIs, where you can directly use the APIs to check whether the table_name exist in a particular database or not.

For further help please go through this Hive 11

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement