xushiyan commented on issue #5488:
URL: https://github.com/apache/hudi/issues/5488#issuecomment-1132639401
@parisni I was able to reproduce the error, and saw that
`spark.sql.extensions` is indeed the missing config.
- without `spark.sql.extensions`
```shell
./bin/pyspark \
--packages org.apache.hudi:hudi-spark3.2-bundle_2.12:0.11.0 \
--conf 'spark.serializer=org.apache.spark.serializer.KryoSerializer' \
--conf
'spark.sql.catalog.spark_catalog=org.apache.spark.sql.hudi.catalog.HoodieCatalog'
\
--conf 'spark.sql.warehouse.dir=hdfs://localhost:8020/user/hive/warehouse' \
```
```python
>>> spark.table("default.test_hudi_pyspark").count()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/hadoop/spark-3.2.1-bin-hadoop3.2/python/pyspark/sql/dataframe.py", line
680, in count
return int(self._jdf.count())
File
"/home/hadoop/spark-3.2.1-bin-hadoop3.2/python/lib/py4j-0.10.9.3-src.zip/py4j/java_gateway.py",
line 1322, in __call__
File "/home/hadoop/spark-3.2.1-bin-hadoop3.2/python/pyspark/sql/utils.py",
line 117, in deco
raise converted from None
pyspark.sql.utils.AnalysisException: Table does not support reads:
default.test_hudi_pyspark
```
- with `spark.sql.extensions`
```shell
./bin/pyspark \
--packages org.apache.hudi:hudi-spark3.2-bundle_2.12:0.11.0 \
--conf 'spark.serializer=org.apache.spark.serializer.KryoSerializer' \
--conf
'spark.sql.catalog.spark_catalog=org.apache.spark.sql.hudi.catalog.HoodieCatalog'
\
--conf 'spark.sql.warehouse.dir=hdfs://localhost:8020/user/hive/warehouse' \
--conf
'spark.sql.extensions=org.apache.spark.sql.hudi.HoodieSparkSessionExtension' \
```
```python
>>> spark.table("default.test_hudi_pyspark").count()
10
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]