You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gravitino.apache.org by "zhengsg (via GitHub)" <gi...@apache.org> on 2025/11/18 02:28:08 UTC
[D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
GitHub user zhengsg created a discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
I have already configured the Hive Thrift URI in the UI. Following the official documentation, starting SparkSQL and running show databasesand show tables returns results normally. However, select * from xxx and insert into xxx operations throw errors with the following information:
WARN ObjectStore:Failed to get database db, returning NoSuchObjectException
[SCHEMA_NOT_FOUND] The schema `db` can not found. Verify the spelling and correctness of the schema and catalog.
I have copied the HDFS configuration files to the SparkSQL conf directory.
The SparkSQL comand:
./bin/spark-sql \
--conf spark.plugins="org.apache.gravitino.spark.connector.plugin.GravitinoSparkPlugin" \
--conf spark.sql.gravitino.uri=http://127.0.0.1:8090 \
--conf spark.sql.gravitino.metalake=test \
--conf spark.sql.gravitino.client.socketTimeoutMs=60000 \
--conf spark.sql.gravitino.client.connectionTimeoutMs=60000 \
--conf spark.sql.warehouse.dir=hdfs://nameservice/hive
GitHub link: https://github.com/apache/gravitino/discussions/9161
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg deleted a comment on the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
I believe the version of my Hive JAR files is correct. I copied the necessary JARs one by one from the Hive metastore service's runtime directory to a separate directory for SparkSQL to operate on Hive tables. Then, I assigned this directory path to spark.sql.hive.metastore.jars. So where exactly does the problem lie? I suggest that the Gravitino Spark plugin should focus on ensuring proper compatibility and adaptation, rather than relying on configuring spark.sql.hive.metastore.jars, as this approach is prone to compatibility conflicts with Spark.
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15010333
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
GitHub user FANNG1 added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
There are known limitations for using `spark-sql` client to query hive tables in Gravitino, you could try to set `spark.bypass.spark.sql.hive.metastore.jars` in Hive catalog properties, see: https://gravitino.apache.org/docs/1.0.0/spark-connector/spark-catalog-hive/#catalog-properties , or use `spark-shell` instead.
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-14996389
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
Thank you for your reply. I am using open-source SparkSQL 3.5. If I start SparkSQL to connect to the Hive metastore using only --conf spark.sql.hive.metastore.uris, I can successfully read and write Hive tables in the SparkSQL client without modifying the default spark.sql.hive.metastore.jars. Why is it necessary to modify this when using Gravitino?
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-14997846
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg edited a comment on the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
By specifying spark.sql.hive.metastore.jars, the SELECT query can be executed to retrieve Hive data. However, when executing an INSERT INTO statement, the error NoSuchMethodException: org.apache.hadoop.hive.ql.metadata.Hive.loadTableerror occurs. This indicates an API mismatch caused by version incompatibility between Spark and Hive. Therefore, specifying spark.sql.hive.metastore.jarsis not a recommended approach? However, without using Gravitino, and by directly connecting to the Hive metastore using --conf spark.sql.hive.metastore.uris, both SELECT and INSERT statements can be executed normally
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15000435
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg edited a comment on the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
By specifying spark.sql.hive.metastore.jars, the SELECT query can be executed to retrieve Hive data. However, when executing an INSERT INTO statement, the error NoSuchMethodException: org.apache.hadoop.hive.ql.metadata.Hive.loadTable error occurs. This indicates an API mismatch caused by version incompatibility between Spark and Hive. Therefore, specifying spark.sql.hive.metastore.jarsis not a recommended approach? However, without using Gravitino, and by directly connecting to the Hive metastore using --conf spark.sql.hive.metastore.uris, both SELECT and INSERT statements can be executed normally
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15000435
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
GitHub user FANNG1 added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
> This indicates an API mismatch caused by version incompatibility between Spark and Hive
Please try to use the correct hive metastore version
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15006560
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
By specifying spark.sql.hive.metastore.jars, the SELECT query can be executed to retrieve Hive data. However, when executing an INSERT INTO statement, the error NoSuchMethodException: org.apache.hadoop.hive.ql.metadata.Hive.loadTableerror occurs. This indicates an API mismatch caused by version incompatibility between Spark and Hive. Therefore, specifying spark.sql.hive.metastore.jarsis not a recommended approach? However, without using Gravitino, and by directly connecting to the Hive metastore using --conf spark.sql.hive.metastore.uris, both SELECTand INSERTstatements can be executed normally
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15000435
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
> > This indicates an API mismatch caused by version incompatibility between Spark and Hive
>
> Please try to use the correct hive metastore version
I believe the version of my Hive JAR files is correct. I copied the necessary JARs one by one from the Hive metastore service's runtime directory to a separate directory for SparkSQL to operate on Hive tables. Then, I assigned this directory path to spark.sql.hive.metastore.jars. So where exactly does the problem lie? I suggest that the Gravitino Spark plugin should focus on ensuring proper compatibility and adaptation, rather than relying on configuring spark.sql.hive.metastore.jars, as this approach is prone to compatibility conflicts with Spark.
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15010353
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
GitHub user FANNG1 added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
Have you tried this parameters? does it works?
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15000169
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "zhengsg (via GitHub)" <gi...@apache.org>.
GitHub user zhengsg added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
I believe the version of my Hive JAR files is correct. I copied the necessary JARs one by one from the Hive metastore service's runtime directory to a separate directory for SparkSQL to operate on Hive tables. Then, I assigned this directory path to spark.sql.hive.metastore.jars. So where exactly does the problem lie? I suggest that the Gravitino Spark plugin should focus on ensuring proper compatibility and adaptation, rather than relying on configuring spark.sql.hive.metastore.jars, as this approach is prone to compatibility conflicts with Spark.
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15010333
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org
Re: [D] How to configure SparkSQL to access the Hive catalog in Gravitino? [gravitino]
Posted by "FANNG1 (via GitHub)" <gi...@apache.org>.
GitHub user FANNG1 added a comment to the discussion: How to configure SparkSQL to access the Hive catalog in Gravitino?
There is a limitation for Spark sql client which couldn't overwrite hive metastore uris for build-in `spark.sql.hive.metastore.jars` configurations. please refer to https://github.com/apache/kyuubi/issues/6362
GitHub link: https://github.com/apache/gravitino/discussions/9161#discussioncomment-15014557
----
This is an automatically sent email for dev@gravitino.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@gravitino.apache.org