databaseolapcatalogwarehouseapache-doris

Hive Catalog 'show tables' works fine but querying errors: "java.net.UnknownHostException: xxxxx"


After I created a Hive catalog, show tables works fine, but querying errors:

java.net.UnknownHostException: xxxxx

The steps to reproduce are:

  1. Create a Hive catalog (Hive is on HDFS):
CREATE CATALOG hive_catalog PROPERTIES (
    'type'='hms',
    'hive.metastore.uris' = 'thrift://172.0.0.1:9083',
    'hadoop.username' = 'hive'
);
  1. Run show tables:
switch hive_catalog; 
show databases;
use my_hive_db_name;
show tables;

This works fine; I can get the full table names of my Hive database.

  1. Execute a query:
select * from hive_catalog.my_hive_db_name.my_table_name;

This errors:

java.net.UnknownHostException: xxxxx

I know this error is about host name, but I don't understand why I can get the full table names without error?

I just want to query my Hive table via Apache Doris catalog.


Solution

  • You can try add the fs.defaultFS property in the Catalog properties and write the HDFS namenode address, for example:

    'fs.defaultFS' = 'hdfs://namenode:port'