You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "sharmamayank94 (via GitHub)" <gi...@apache.org> on 2024/06/23 10:05:25 UTC
[I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
sharmamayank94 opened a new issue, #11492:
URL: https://github.com/apache/hudi/issues/11492
**Describe the problem you faced**
Migrated to Hudi 0.14.0 from Hudi version 0.8. While attempting to read Hudi table in parquet format from AWS S3 using Spark receiving the following error:-
`org.apache.hudi.internal.schema.HoodieSchemaException: Failed to convert avro schema to struct type:`
The underlying cause looks like classNotFound which is following:-
`Caused by: java.lang.ClassNotFoundException: org.apache.spark.sql.adapter.Spark2Adapter`
Note: The version of Hudi which wrote the table is also 0.14.0.
Attached stacktrace at the bottom.
**Expected behavior**
A clear and concise description of what you expected to happen.
Expected the spark to read the Hudi table and convert it to required Schema/Dataframe.
**Environment Description**
* Hudi version : 0.14.0
* Spark version : Tried with both 3.5 and 3.3
* Hive version : 3.1.3
* Hadoop version : 3.0.0
* Storage (HDFS/S3/GCS..) : S3
* Running on Docker? (yes/no) : No
* EMR version: 7.0.0
**Additional context**
Add any other context about the problem here.
**Stacktrace**
```Add the stacktrace of the error.```
```
org.apache.hudi.internal.schema.HoodieSchemaException: Failed to convert avro schema to struct type:
**Schema**
at org.apache.hudi.AvroConversionUtils$.convertAvroSchemaToStructType(AvroConversionUtils.scala:161)
at org.apache.hudi.HoodieBaseRelation.tableStructSchema$lzycompute(HoodieBaseRelation.scala:187)
at org.apache.hudi.HoodieBaseRelation.tableStructSchema(HoodieBaseRelation.scala:186)
at org.apache.hudi.BaseFileOnlyRelation.$anonfun$toHadoopFsRelation$3(BaseFileOnlyRelation.scala:193)
at scala.Option.orElse(Option.scala:447)
at org.apache.hudi.BaseFileOnlyRelation.toHadoopFsRelation(BaseFileOnlyRelation.scala:193)
at org.apache.hudi.DefaultSource$.resolveBaseFileOnlyRelation(DefaultSource.scala:331)
at org.apache.hudi.DefaultSource$.createRelation(DefaultSource.scala:262)
at org.apache.hudi.DefaultSource.createRelation(DefaultSource.scala:118)
at org.apache.hudi.DefaultSource.createRelation(DefaultSource.scala:74)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:346)
at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:229)
at org.apache.spark.sql.DataFrameReader.$anonfun$load$2(DataFrameReader.scala:211)
at scala.Option.getOrElse(Option.scala:189)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:186)
at com.amazon.insights.reader.HudiReader.$anonfun$readFull$1(HudiReader.scala:114)
at scala.util.Try$.apply(Try.scala:213)
at com.amazon.insights.reader.HudiReader.readFull(HudiReader.scala:114)
at com.amazon.insights.reader.HudiReader.readHistorical(HudiReader.scala:103)
at com.amazon.insights.reader.HudiReader.readDataFrame(HudiReader.scala:38)
at com.amazon.insights.spark.MyAggregationSparkJob.$anonfun$run$1(MyAggregationSparkJob.scala:57)
at com.amazon.insights.spark.MyAggregationSparkJob.$anonfun$run$1$adapted(MyAggregationSparkJob.scala:44)
at scala.collection.immutable.List.foreach(List.scala:431)
at com.amazon.insights.spark.MyAggregationSparkJob.run(MyAggregationSparkJob.scala:44)
at com.amazon.insights.DataAggregationApplication$.main(DataAggregationApplication.scala:30)
at com.amazon.insights.DataAggregationApplication.main(DataAggregationApplication.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:741)
Caused by: java.lang.ClassNotFoundException: org.apache.spark.sql.adapter.Spark2Adapter
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at org.apache.hudi.SparkAdapterSupport$.sparkAdapter$lzycompute(SparkAdapterSupport.scala:49)
at org.apache.hudi.SparkAdapterSupport$.sparkAdapter(SparkAdapterSupport.scala:35)
at org.apache.hudi.SparkAdapterSupport.sparkAdapter(SparkAdapterSupport.scala:29)
at org.apache.hudi.SparkAdapterSupport.sparkAdapter$(SparkAdapterSupport.scala:29)
at org.apache.hudi.HoodieSparkUtils$.sparkAdapter$lzycompute(HoodieSparkUtils.scala:66)
at org.apache.hudi.HoodieSparkUtils$.sparkAdapter(HoodieSparkUtils.scala:66)
at org.apache.hudi.AvroConversionUtils$.convertAvroSchemaToStructType(AvroConversionUtils.scala:156)
... 31 more
```
--
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: commits-unsubscribe@hudi.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "sharmamayank94 (via GitHub)" <gi...@apache.org>.
sharmamayank94 commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2184949305
Thanks Aditya for reverting !
Used package `org.apache.hudi:hudi-spark3.5-bundle_2.12` with 0.14.1 and got the following error now :-
```
org.apache.spark.SparkClassNotFoundException: [DATA_SOURCE_NOT_FOUND] Failed to find the data source: hoodie-parquet. Please find packages at `https://spark.apache.org/third-party-projects.html`.
at org.apache.spark.sql.errors.QueryExecutionErrors$.dataSourceNotFoundError(QueryExecutionErrors.scala:725)
at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:647)
at org.apache.spark.sql.execution.datasources.DataSource.providingClass$lzycompute(DataSource.scala:100)
at org.apache.spark.sql.execution.datasources.DataSource.providingClass(DataSource.scala:99)
at org.apache.spark.sql.execution.datasources.DataSource.providingInstance(DataSource.scala:113)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:341)
at org.apache.hudi.BaseFileOnlyRelation.toHadoopFsRelation(BaseFileOnlyRelation.scala:206)
at org.apache.hudi.DefaultSource$.resolveBaseFileOnlyRelation(DefaultSource.scala:333)
at org.apache.hudi.DefaultSource$.createRelation(DefaultSource.scala:264)
at org.apache.hudi.DefaultSource.createRelation(DefaultSource.scala:117)
at org.apache.hudi.DefaultSource.createRelation(DefaultSource.scala:73)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:346)
at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:229)
at org.apache.spark.sql.DataFrameReader.$anonfun$load$2(DataFrameReader.scala:211)
at scala.Option.getOrElse(Option.scala:189)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:186)
at com.amazon.insights.reader.HudiReader.$anonfun$readFull$1(HudiReader.scala:114)
at scala.util.Try$.apply(Try.scala:213)
at com.amazon.insights.reader.HudiReader.readFull(HudiReader.scala:114)
at com.amazon.insights.reader.HudiReader.readHistorical(HudiReader.scala:103)
at com.amazon.insights.reader.HudiReader.readDataFrame(HudiReader.scala:38)
at com.amazon.insights.spark.MyAggregationSparkJob.$anonfun$run$1(MyAggregationSparkJob.scala:57)
at com.amazon.insights.spark.MyAggregationSparkJob.$anonfun$run$1$adapted(MyAggregationSparkJob.scala:44)
at scala.collection.immutable.List.foreach(List.scala:431)
at com.amazon.insights.spark.MyAggregationSparkJob.run(MyAggregationSparkJob.scala:44)
at com.amazon.insights.DataAggregationApplication$.main(DataAggregationApplication.scala:30)
at com.amazon.insights.DataAggregationApplication.main(DataAggregationApplication.scala)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:741)
Caused by: java.lang.ClassNotFoundException: hoodie-parquet.DefaultSource
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at org.apache.spark.sql.execution.datasources.DataSource$.$anonfun$lookupDataSource$5(DataSource.scala:633)
at scala.util.Try$.apply(Try.scala:213)
at org.apache.spark.sql.execution.datasources.DataSource$.$anonfun$lookupDataSource$4(DataSource.scala:633)
at scala.util.Failure.orElse(Try.scala:224)
at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSource(DataSource.scala:633)
... 31 more
```
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "ad1happy2go (via GitHub)" <gi...@apache.org>.
ad1happy2go commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2186511758
Can you share the command you are using to submit jobs and entire stack trace now? I hope you are no longer getting `java.lang.ClassNotFoundException: org.apache.spark.sql.adapter.Spark2Adapter`
If you getting that Then your Hudi Version used are not correct.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "ad1happy2go (via GitHub)" <gi...@apache.org>.
ad1happy2go commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2185640721
@sharmamayank94 Hudi 0.14.X doesn't support spark 3.5. So use newly released Hudi 0.15.0 or use with spark 3.3 or 3.4
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "sharmamayank94 (via GitHub)" <gi...@apache.org>.
sharmamayank94 commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2186182579
@ad1happy2go attempted Hudi 0.14.x with spark 3.4 as well, still received the same issue of `Failed to find the data source: hoodie-parquet.`
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "ad1happy2go (via GitHub)" <gi...@apache.org>.
ad1happy2go commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2184935040
@sharmamayank94 Your spark version doesn't match with hudi spark version. Check Quickstart - https://hudi.apache.org/docs/quick-start-guide/
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "Marwen94 (via GitHub)" <gi...@apache.org>.
Marwen94 commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2623041174
Hello @ad1happy2go , I'm having the same issue with AWS Glue 5.0.
runtime versions (https://docs.aws.amazon.com/fr_fr/glue/latest/dg/release-notes.html):
> Spark 3.5.2
> Python 3.11
> Scala 2.12.18
> Hudi 0.15.0
Full trace :
```
Py4JJavaError(
py4j.protocol.Py4JJavaError: An error occurred while calling o263.save.
: org.apache.hudi.internal.schema.HoodieSchemaException: Failed to convert struct type to avro schema: StructType(StructField(actor_created_at,TimestampType,true),StructField(actor_event_id,StringType,true),StructField(actor_time,TimestampType,true),StructField(actor_type,StringType,true),StructField(actor_user_access_groups,ArrayType(StructType(StructField(id,LongType,true),StructField(name,StringType,true),StructField(type,StringType,true),StructField(uuid,StringType,true)),true),true),StructField(actor_user_avatar_file_name,StringType,true),StructField(actor_user_avatar_url_150,StringType,true),StructField(actor_user_avatar_url_40,StringType,true),StructField(actor_user_avatar_url_original,StringType,true),StructField(actor_user_card_access_revoked_source,StringType,true),StructField(actor_user_cost_center,StringType,true),StructField(actor_user_department,StringType,true),StructField(actor_user_elevator_access_groups,Ar
ava:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:374)
at py4j.Gateway.invoke(Gateway.java:282)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182)
at py4j.ClientServerConnection.run(ClientServerConnection.java:106)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.apache.avro.SchemaParseException: Illegal character in: additional_info_Area Name
at org.apache.avro.Schema.validateName(Schema.java:1626)
at org.apache.avro.Schema.access$400(Schema.java:94)
at org.apache.avro.Schema$Field.<init>(Schema.java:558)
at org.apache.avro.SchemaBuilder$FieldBuilder.completeField(SchemaBuilder.java:2258)
at org.apache.avro.SchemaBuilder$FieldBuilder.completeField(SchemaBuilder.java:2254)
at org.apache.avro.SchemaBuilder$FieldBuilder.access$5100(SchemaBuilder.java:2150)
at org.apache.avro.SchemaBuilder$GenericDefau
lt.noDefault(SchemaBuilder.java:2557)
at org.apache.hudi.org.apache.spark.sql.avro.SchemaConverters$.$anonfun$toAvroType$2(SchemaConverters.scala:205)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at org.apache.spark.sql.types.StructType.foreach(StructType.scala:102)
at org.apache.hudi.org.apache.spark.sql.avro.SchemaConverters$.toAvroType(SchemaConverters.scala:202)
at org.apache.hudi.org.apache.spark.sql.avro.HoodieSparkAvroSchemaConverters$.toAvroType(HoodieSparkAvroSchemaConverters.scala:37)
at org.apache.hudi.AvroConversionUtils$.convertStructTypeToAvroSchema(AvroConversionUtils.scala:149)
... 52 more
```
Could you please help?
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [SUPPORT] Unable to read Hudi table after hudi upgrade [hudi]
Posted by "sharmamayank94 (via GitHub)" <gi...@apache.org>.
sharmamayank94 commented on issue #11492:
URL: https://github.com/apache/hudi/issues/11492#issuecomment-2522488412
The issue is fixed post upgrading the EMR version to 7.0.1. Removed the packaging of Hudi and Spark locally and took dependency on EMR only.
We were observing this issue while using Java8 and tried with Java 11 also.
Post this the issue that we were facing changed to https://github.com/apache/hudi/issues/10609, which is also fixed now.
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org