Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HdfsLocatedFileStatus and FileStatusWithmetadata class type conve… #6285

Closed
wants to merge 1 commit into from

Conversation

zwq199400
Copy link

@zwq199400 zwq199400 commented Apr 10, 2024

…rsion errors

🔍 Description

Issue References 🔗

This pull request fixes #

Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklist 📝

Be nice. Be informative.

@pan3793
Copy link
Member

pan3793 commented Apr 10, 2024

Mind filling in the PR description about which issue you have faced?

@zwq199400
Copy link
Author

zwq199400 commented Apr 10, 2024

When I connect to HIVE to read data, an error message will appear as follows:

Caused by: java.lang.ClassCastException: org.apache.hadoop.hdfs.protocol.HdfsLocatedFileStatus cannot be cast to org.apache.spark.sql.execution.datasources.FileStatusWithMetadata
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:38)
	at scala.collection.TraversableLike.map(TraversableLike.scala:286)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
	at org.apache.spark.sql.execution.datasources.FilePartition$.$anonfun$maxSplitBytes$2(FilePartition.scala:116)
	at scala.collection.immutable.Stream.flatMap(Stream.scala:489)
	at org.apache.spark.sql.execution.datasources.FilePartition$.maxSplitBytes(FilePartition.scala:116)
	at org.apache.kyuubi.spark.connector.hive.read.HiveScan.partitions(HiveScan.scala:89)
	at org.apache.spark.sql.execution.datasources.v2.FileScan.planInputPartitions(FileScan.scala:177)
	at org.apache.spark.sql.execution.datasources.v2.FileScan.planInputPartitions$(FileScan.scala:176)
	at org.apache.kyuubi.spark.connector.hive.read.HiveScan.planInputPartitions(HiveScan.scala:41)

compared org.apache.spark.sql.execution.datasources.PartitioningAwareFileIndex#listFiles method, found that the calling method for the PartitionDirectory class has changed in [SPARK-43039] apache/spark#40677

So is this modification correct?

@zwq199400
Copy link
Author

Mind filling in the PR description about which issue you have faced?

pls refer to the comments above

@pan3793
Copy link
Member

pan3793 commented Apr 10, 2024

Please provide the component versions(for self complied version, compiling command should be provided too) and reproducible use cases, this helps the reviewer to evaluate the patch

@zwq199400
Copy link
Author

Please provide the component versions and reproducible use cases, this helps the reviewer to evaluate the patch

I found that this bug has been fixed in the v1.9.0, just last month

@zwq199400 zwq199400 closed this Apr 10, 2024
@zwq199400
Copy link
Author

Please provide the component versions(for self complied version, compiling command should be provided too) and reproducible use cases, this helps the reviewer to evaluate the patch

ty for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants