hudi icon indicating copy to clipboard operation
hudi copied to clipboard

[SUPPORT] Spark3 with Hadoop3 using metadata could have compatible issue when reading hfile

Open boneanxs opened this issue 4 years ago • 9 comments

Tips before filing an issue

  • Have you gone through our FAQs?

  • Join the mailing list to engage in conversations and get faster support at [email protected].

  • If you have triaged this as a bug, then file an issue directly.

Describe the problem you faced As Hadoop3 changed the method org.apache.hadoop.hdfs.client.HdfsDataInputStream.getReadStatistics to return org/apache/hadoop/hdfs/ReadStatistics instead of org/apache/hadoop/hdfs/DFSInputStream$ReadStatistics, when using hbase-server package to read hfile, it could throw NoSuchMethodError

ERROR Executor: Exception in task 1.0 in stage 15.0 (TID 1990)
java.lang.NoSuchMethodError: org.apache.hadoop.hdfs.client.HdfsDataInputStream.getReadStatistics()Lorg/apache/hadoop/hdfs/DFSInputStream$ReadStatistics;
	at org.apache.hudi.org.apache.hadoop.hbase.io.FSDataInputStreamWrapper.updateInputStreamStatistics(FSDataInputStreamWrapper.java:249)
	at org.apache.hudi.org.apache.hadoop.hbase.io.FSDataInputStreamWrapper.close(FSDataInputStreamWrapper.java:296)
	at org.apache.hudi.org.apache.hadoop.hbase.io.hfile.HFileBlock$FSReaderImpl.closeStreams(HFileBlock.java:1825)
	at org.apache.hudi.org.apache.hadoop.hbase.io.hfile.HFilePreadReader.close(HFilePreadReader.java:107)
	at org.apache.hudi.org.apache.hadoop.hbase.io.hfile.HFileReaderImpl.close(HFileReaderImpl.java:1421)
	at org.apache.hudi.io.storage.HoodieHFileReader.close(HoodieHFileReader.java:218)
	at org.apache.hudi.metadata.HoodieBackedTableMetadata.closeReader(HoodieBackedTableMetadata.java:588)
	at org.apache.hudi.metadata.HoodieBackedTableMetadata.close(HoodieBackedTableMetadata.java:571)
	at org.apache.hudi.metadata.HoodieBackedTableMetadata.lambda$getRecordsByKeys$0(HoodieBackedTableMetadata.java:232)
	at java.util.HashMap.forEach(HashMap.java:1289)
	at org.apache.hudi.metadata.HoodieBackedTableMetadata.getRecordsByKeys(HoodieBackedTableMetadata.java:207)
	at org.apache.hudi.metadata.HoodieBackedTableMetadata.getRecordByKey(HoodieBackedTableMetadata.java:140)
	at org.apache.hudi.metadata.BaseTableMetadata.fetchAllFilesInPartition(BaseTableMetadata.java:312)
	at org.apache.hudi.metadata.BaseTableMetadata.getAllFilesInPartition(BaseTableMetadata.java:135)
	at org.apache.hudi.metadata.HoodieMetadataFileSystemView.listPartition(HoodieMetadataFileSystemView.java:65)
	at org.apache.hudi.common.table.view.AbstractTableFileSystemView.lambda$ensurePartitionLoadedCorrectly$9(AbstractTableFileSystemView.java:305)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.apache.hudi.common.table.view.AbstractTableFileSystemView.ensurePartitionLoadedCorrectly(AbstractTableFileSystemView.java:296)
	at org.apache.hudi.common.table.view.AbstractTableFileSystemView.getLatestBaseFilesBeforeOrOn(AbstractTableFileSystemView.java:517)
	at org.apache.hudi.index.HoodieIndexUtils.getLatestBaseFilesForPartition(HoodieIndexUtils.java:69)
	at org.apache.hudi.index.HoodieIndexUtils.lambda$getLatestBaseFilesForAllPartitions$ff6885d8$1(HoodieIndexUtils.java:89)
	at org.apache.hudi.client.common.HoodieSparkEngineContext.lambda$flatMap$7d470b86$1(HoodieSparkEngineContext.java:137)
	at org.apache.spark.api.java.JavaRDDLike.$anonfun$flatMap$1(JavaRDDLike.scala:125)
	at scala.collection.Iterator$$anon$11.nextCur(Iterator.scala:484)
	at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:490)
	at scala.collection.Iterator.foreach(Iterator.scala:941)
	at scala.collection.Iterator.foreach$(Iterator.scala:941)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
	at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:62)
	at scala.collection.generic.Growable.$plus$plus$eq$(Growable.scala:53)
	at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:105)
	at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:49)
	at scala.collection.TraversableOnce.to(TraversableOnce.scala:315)
	at scala.collection.TraversableOnce.to$(TraversableOnce.scala:313)
	at scala.collection.AbstractIterator.to(Iterator.scala:1429)
	at scala.collection.TraversableOnce.toBuffer(TraversableOnce.scala:307)
	at scala.collection.TraversableOnce.toBuffer$(TraversableOnce.scala:307)
	at scala.collection.AbstractIterator.toBuffer(Iterator.scala:1429)
	at scala.collection.TraversableOnce.toArray(TraversableOnce.scala:294)
	at scala.collection.TraversableOnce.toArray$(TraversableOnce.scala:288)
	at scala.collection.AbstractIterator.toArray(Iterator.scala:1429)
	at org.apache.spark.rdd.RDD.$anonfun$collect$2(RDD.scala:1030)
	at org.apache.spark.SparkContext.$anonfun$runJob$5(SparkContext.scala:2245)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
	at org.apache.spark.scheduler.Task.run(Task.scala:131)
	at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:497)
	at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1465)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:500)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

To Reproduce

Steps to reproduce the behavior:

1. 2. 3. 4.

Expected behavior

A clear and concise description of what you expected to happen.

Environment Description

  • Hudi version : master

  • Spark version : 3.1.0

  • Hive version :

  • Hadoop version : 3.1

  • Storage (HDFS/S3/GCS..) : HDFS

  • Running on Docker? (yes/no) : no

Additional context

Add any other context about the problem here.

Stacktrace

Add the stacktrace of the error.

boneanxs avatar Aug 17 '22 03:08 boneanxs

https://github.com/apache/hudi/issues/5765#issuecomment-1179915480 According this, I mvn install hbase with hadoop3, and then pacakge hudi, the problem has been resolved.

xicm avatar Aug 17 '22 06:08 xicm

@xicm Thanks for your kind help! It works. But I'm thinking is there any workaround in the HUDI side to make this compatible? otherwise it could confuse the clients as they can not use it out of box in hadoop3 environment...

boneanxs avatar Aug 17 '22 07:08 boneanxs

CC @bhasudha @yihua : can we please improve the documentation around this.

nsivabalan avatar Aug 27 '22 20:08 nsivabalan

Ack. Will send a Doc update PR soon.

bhasudha avatar Sep 01 '22 06:09 bhasudha

@yihua : do we have a tracking jira for doc improvements. lets not miss this. and once we have the doc PR up, feel free to close it out. CC @bhasudha

nsivabalan avatar Sep 12 '22 22:09 nsivabalan

https://hudi.apache.org/docs/faq#how-can-i-resolve-the-nosuchmethoderror-from-hbase-when-using-hudi-with-metadata-table-on-hdfs unfortunately we don't have a ready to use solution yet. @yihua : correct me if I am wrong.

nsivabalan avatar Oct 23 '22 04:10 nsivabalan

I followed the steps to compile hbase, but failed. Could you tell me what to do

cdjincan avatar Apr 10 '23 04:04 cdjincan

[INFO] Apache HBase 2.4.9 ................................. SUCCESS [ 33.477 s] [INFO] Apache HBase - Checkstyle .......................... SUCCESS [ 3.812 s] [INFO] Apache HBase - Annotations ......................... SUCCESS [ 2.121 s] [INFO] Apache HBase - Build Configuration ................. SUCCESS [ 0.286 s] [INFO] Apache HBase - Logging ............................. SUCCESS [ 2.021 s] [INFO] Apache HBase - Shaded Protocol ..................... SUCCESS [ 43.562 s] [INFO] Apache HBase - Common .............................. SUCCESS [01:43 min] [INFO] Apache HBase - Metrics API ......................... SUCCESS [ 2.313 s] [INFO] Apache HBase - Hadoop Compatibility ................ SUCCESS [ 3.338 s] [INFO] Apache HBase - Metrics Implementation .............. SUCCESS [ 2.776 s] [INFO] Apache HBase - Hadoop Two Compatibility ............ SUCCESS [ 7.288 s] [INFO] Apache HBase - Protocol ............................ SUCCESS [ 16.664 s] [INFO] Apache HBase - Client .............................. SUCCESS [ 21.772 s] [INFO] Apache HBase - Zookeeper ........................... SUCCESS [ 5.645 s] [INFO] Apache HBase - Replication ......................... SUCCESS [ 3.377 s] [INFO] Apache HBase - Resource Bundle ..................... SUCCESS [ 0.666 s] [INFO] Apache HBase - HTTP ................................ SUCCESS [ 10.001 s] [INFO] Apache HBase - Asynchronous FileSystem ............. SUCCESS [ 9.265 s] [INFO] Apache HBase - Procedure ........................... SUCCESS [ 5.952 s] [INFO] Apache HBase - Server .............................. SUCCESS [01:59 min] [INFO] Apache HBase - MapReduce ........................... SUCCESS [ 28.795 s] [INFO] Apache HBase - Testing Util ........................ SUCCESS [ 6.312 s] [INFO] Apache HBase - Thrift .............................. SUCCESS [ 49.281 s] [INFO] Apache HBase - RSGroup ............................. SUCCESS [ 19.663 s] [INFO] Apache HBase - Shell ............................... SUCCESS [ 25.202 s] [INFO] Apache HBase - Coprocessor Endpoint ................ SUCCESS [ 24.199 s] [INFO] Apache HBase - Integration Tests ................... SUCCESS [ 37.370 s] [INFO] Apache HBase - Rest ................................ SUCCESS [ 50.900 s] [INFO] Apache HBase - Examples ............................ SUCCESS [ 39.050 s] [INFO] Apache HBase - Shaded .............................. SUCCESS [ 3.772 s] [INFO] Apache HBase - Shaded - Client (with Hadoop bundled) SUCCESS [01:21 min] [INFO] Apache HBase - Shaded - Client ..................... SUCCESS [ 12.107 s] [INFO] Apache HBase - Shaded - MapReduce .................. SUCCESS [ 42.514 s] [INFO] Apache HBase - External Block Cache ................ SUCCESS [ 22.275 s] [INFO] Apache HBase - HBTop ............................... SUCCESS [ 48.601 s] [INFO] Apache HBase - Assembly ............................ SUCCESS [07:20 min] [INFO] Apache HBase - Shaded - Testing Util ............... SUCCESS [01:06 min] [INFO] Apache HBase - Shaded - Testing Util Tester ........ SUCCESS [ 5.690 s] [INFO] Apache HBase Shaded Packaging Invariants ........... FAILURE [ 4.307 s] [INFO] Apache HBase Shaded Packaging Invariants (with Hadoop bundled) SKIPPED [INFO] Apache HBase - Archetypes .......................... SKIPPED [INFO] Apache HBase - Exemplar for hbase-client archetype . SKIPPED [INFO] Apache HBase - Exemplar for hbase-shaded-client archetype SKIPPED [INFO] Apache HBase - Archetype builder 2.4.9 ............. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 23:40 min [INFO] Finished at: 2023-04-10T12:47:35+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (check-jar-contents) on project hbase-shaded-check-invariants: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (check-jar-contents) on project hbase-shaded-check-invariants: Command execution failed. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed. at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:326) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290) at org.apache.maven.cli.MavenCli.main (MavenCli.java:194) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356) Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

cdjincan avatar Apr 10 '23 04:04 cdjincan

@hnjincan if you want to skip test, use this "-DskipTests", don't use "-Dmaven.test.skip=true".

snakeqi avatar Jul 07 '23 06:07 snakeqi