Код: Выделить всё
public static void main(String[] args) throws TException {
SpringApplication.run(HiveConnectionThriftApplication.class, args);
// Create a Hive configuration object
HiveConf conf = new HiveConf();
// Set the metastore URIs using the recommended approach
MetastoreConf.setVar(conf, MetastoreConf.ConfVars.THRIFT_URIS, "thrift://192.168.21.133:9083");
// Create a HiveMetaStoreClient instance
HiveMetaStoreClient client = new HiveMetaStoreClient(conf);
// Perform operations (example: get all databases)
List databases = client.getAllDatabases();
for (String database : databases) {
System.out.println(database);
}
// Close the client
client.close();
}
в com.hiveconnectionThriftapplication.main (hiveConnectionThriftApplication.java:19)
, вызванное: java.lang.classnotfoundexception: org.apache.hadooop.shaded.com.ctc.wstx.io.inputbootstrapper
at at ath java.base /jdk.internal.loader.builtinclassloader.loadclass (buildinclassloader.java:641)
at hava.base /jdk.internal.loader.classloaders $ > на java.base /java.lang.classloader.loadclass (classloader.java:526)
... еще < /p>
Попытка подключиться к Hive с Java, используя Hive metastoreore API клиента, но превышение исключения.
Подробнее здесь: https://stackoverflow.com/questions/793 ... com-ctc-ws