[SUPPORT] : Global Bloom Index config issue
Tips before filing an issue
-
Have you gone through our FAQs? yes
-
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
We are trying to use GLOBAL_BLOOM index for our use case in production , prior to that we trying it using test data using spark-shell ,facing below exception with below configuration.
In the first run with test3.csv file gets successfully ingested by creating 3 partitions with ts column.
in the second run we did dummy update only the partition column , by keeping other attributes same . please check test4.csv file below. Second run would not able to create a new partition with new ts value , getting the exception .
Run1 :
Input csv file:
cat test3.csv
fanme,lname,ts,uuid
pd,desai1,2019-10-15,10
pp,sai,2019-10-14,11
pp,sai,2019-10-14,11
prabil,bal,2020-01-30,20
scala> val table ="hudi_cow1" scala> val basepath="/datalake/globalndextest" scala> val df3=spark.read.option("header","true").csv("/datalake/888/test3.csv" scala> val dfh4=df3.write.format("org.apache.hudi").option(RECORDKEY_FIELD_OPT_KEY, "uuid").option(PARTITIONPATH_FIELD_OPT_KEY,"ts").option("hoodie.index.type","GLOBAL_BLOOM").option("hoodie.bloom.index.update.partition.path","true").option(TABLE_NAME,table) scala> dfh4.mode(Append).save(basepath)
Ouput: spark.read.parquet("/datalake/globalndextest/*").show(false) +-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+------+----------+----+ |_hoodie_commit_time|_hoodie_commit_seqno|_hoodie_record_key|_hoodie_partition_path|_hoodie_file_name|fanme |lname |ts |uuid| |20200529115326 |20200529115326_0_1 |20 |2020-01-30|86941ae8-a5b6-4d31-b12c-63ec2883a2d3-0_0-52-25756_20200529115326.parquet|prabil|bal |2020-01-30|20 | |20200529115326 |20200529115326_2_2 |10 |2019-10-15|972ee074-942c-417c-93ca-08d18b4e5897-0_2-52-25758_20200529115326.parquet|pd |desai1|2019-10-15|10 | |20200529115326 |20200529115326_1_1 |11 |2019-10-14|7df81054-b67b-402e-bc7e-c935a18ab3eb-0_1-52-25757_20200529115326.parquet|pp |sai |2019-10-14|11 |
Run2: Input file: cat test4.csv fanme,lname,ts,uuid pd,desai,2019-10-17,10 pp,sai,2019-10-18,11 rg,fg,2019-10-18,25 scala> val table ="hudi_cow1" scala> val basepath="/datalake/globalndextest" scala> val df3=spark.read.option("header","true").csv("/datalake/888/test4.csv" scala> val dfh4=df3.write.format("org.apache.hudi").option(RECORDKEY_FIELD_OPT_KEY, "uuid").option(PARTITIONPATH_FIELD_OPT_KEY,"ts").option("hoodie.index.type","GLOBAL_BLOOM").option("hoodie.bloom.index.update.partition.path","true").option(TABLE_NAME,table) scala> dfh4.mode(Append).save(basepath)
Exception:
Caused by: org.apache.hudi.exception.HoodieUpsertException: Error upserting bucketType UPDATE for partition :1 org.apache.hudi.table.HoodieCopyOnWriteTable.handleUpsertPartition(HoodieCopyOnWriteTable.java:264)
org.apache.hudi.HoodieWriteClient.lambda$upsertRecordsInternal$507693af$1(HoodieWriteClient.java:428)
org.apache.spark.api.java.JavaRDDLike$$anonfun$mapPartitionsWithIndex$1.apply(JavaRDDLike.scala:102)
org.apache.spark.api.java.JavaRDDLike$$anonfun$mapPartitionsWithIndex$1.apply(JavaRDDLike.scala:102)
org.apache.spark.rdd.RDD$$anonfun$mapPartitionsWithIndex$1$$anonfun$apply$25.apply(RDD.scala:853)
at org.apache.spark.rdd.RDD$$anonfun$mapPartitionsWithIndex$1$$anonfun$apply$25.apply(RDD.scala:853)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:324)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:288)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:324)
at org.apache.spark.rdd.RDD$$anonfun$7.apply(RDD.scala:337)
at org.apache.spark.rdd.RDD$$anonfun$7.apply(RDD.scala:335)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1182)
at org.apache.spark.storage.BlockManager$$anonfun$doPutIterator$1.apply(BlockManager.scala:1156)
at org.apache.spark.storage.BlockManager.doPut(BlockManager.scala:1091)
at org.apache.spark.storage.BlockManager.doPutIterator(BlockManager.scala:1156)
at org.apache.spark.storage.BlockManager.getOrElseUpdate(BlockManager.scala:882)
at org.apache.spark.rdd.RDD.getOrCompute(RDD.scala:335)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:286)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:324)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:288)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90)
at org.apache.spark.scheduler.Task.run(Task.scala:123)
at org.apache.spark.executor.Executor$TaskRunner$$anonfun$10.org$apache$spark$executor$Executor$TaskRunner$$anonfun$$res$1(Executor.scala:412)
at org.apache.spark.executor.Executor$TaskRunner$$anonfun$10.apply(Executor.scala:419)
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1359)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:430)
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)
Caused by: java.util.NoSuchElementException: No value present in Option
at org.apache.hudi.common.util.Option.get(Option.java:88)
at org.apache.hudi.io.HoodieMergeHandle.
To Reproduce
Steps to reproduce the behavior:
1. 2. 3. 4.
Expected behavior
Our expectation is the since the record key column is same with new partition value it has to delete the previous record key value ( hoodie.bloom.index.update.partition.path","true") and create a record in new partition. In our case we have same record key coming in different partition in different runs , need to delete the record in previous partition and ingest the incoming record key into new partition
Environment Description
-
Hudi version : 0.5.1
-
Spark version : 2.2.1
-
Hive version :
-
Hadoop version : 2.7
-
Storage (HDFS/S3/GCS..) : HDFS
-
Running on Docker? (yes/no) : no
Additional context
In our case we have same record key coming in different partition in different runs , need to delete the record in previous partition and ingest the incoming record key into new partition.
Stacktrace
Add the stacktrace of the error.
@nsivabalan our @lamber-ken index related. One of you interested in taking this one?
I can take a look at this
@prashanthpdesai : I tried and it works for me. I am using 0.5.2-incubating bundle (org.apache.hudi:hudi-spark-bundle_2.11:0.5.2-incubating). Not sure if that makes any diff.
Can you try the following and let me know what output you see.
val table ="hudi_cow1"
val basepath="/datalake/globalndextest"
val df3=spark.read.option("header","true").csv("/datalake/888/test3.csv"
val dfh4=df3.write.format("org.apache.hudi").option(RECORDKEY_FIELD_OPT_KEY, "uuid").option(PARTITIONPATH_FIELD_OPT_KEY,"ts").option("hoodie.index.type","GLOBAL_BLOOM").option("hoodie.bloom.index.update.partition.path","true").option(TABLE_NAME,table)
dfh4.mode(Append).save(basepath)
spark.read.parquet(basepath+"/*").show(false)
val df5 = spark.read.option("header","true").csv("/datalake/888/test4.csv"
val dfh6 = df5.write.format("org.apache.hudi").option(RECORDKEY_FIELD_OPT_KEY, "uuid").option(PARTITIONPATH_FIELD_OPT_KEY,"ts").option("hoodie.index.type","GLOBAL_BLOOM").option("hoodie.bloom.index.update.partition.path","true").option(TABLE_NAME,table)
dfh6.mode(Append).save(basepath)
spark.read.parquet(basepath+"/*").show(false)
spark.read.parquet(basepath+"/*").show(false)
+-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+------+----------+----+
|_hoodie_commit_time|_hoodie_commit_seqno|_hoodie_record_key|_hoodie_partition_path|_hoodie_file_name |fanme |lname |ts |uuid|
+-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+------+----------+----+
|20200603155652 |20200603155652_0_2 |20 |2020-01-30 |a9e4f829-1a0d-49e0-9ed5-254808a4a4bf-0_0-22-12006_20200603155652.parquet|prabil|bal |2020-01-30|20 |
|20200603155652 |20200603155652_2_1 |10 |2019-10-15 |0e790488-ebf3-479a-9044-d819b620d085-0_2-22-12008_20200603155652.parquet|pd |desai1|2019-10-15|10 |
|20200603155652 |20200603155652_1_3 |11 |2019-10-14 |2ec0b40d-7a44-496b-9c92-68fe920c6111-0_1-22-12007_20200603155652.parquet|pp |sai |2019-10-14|11 |
+-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+------+----------+----+
After update:
spark.read.parquet(basepath+"/*").show(false)
+-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+-----+----------+----+
|_hoodie_commit_time|_hoodie_commit_seqno|_hoodie_record_key|_hoodie_partition_path|_hoodie_file_name |fanme |lname|ts |uuid|
+-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+-----+----------+----+
|20200603160032 |20200603160032_1_4 |11 |2019-10-18 |1fed9735-8932-4ac3-bdb0-d5e94e23267c-0_1-56-25537_20200603160032.parquet|pp |sai |2019-10-18|11 |
|20200603160032 |20200603160032_1_5 |25 |2019-10-18 |1fed9735-8932-4ac3-bdb0-d5e94e23267c-0_1-56-25537_20200603160032.parquet|rg |fg |2019-10-18|25 |
|20200603155652 |20200603155652_0_2 |20 |2020-01-30 |a9e4f829-1a0d-49e0-9ed5-254808a4a4bf-0_0-22-12006_20200603155652.parquet|prabil|bal |2020-01-30|20 |
|20200603160032 |20200603160032_0_6 |10 |2019-10-17 |17f34208-cb9e-4a39-b796-a7168d3d089a-0_0-56-25536_20200603160032.parquet|pd |desai|2019-10-17|10 |
+-------------------+--------------------+------------------+----------------------+------------------------------------------------------------------------+------+-----+----------+----+
@nsivabalan : thank you i was able to write it successfully with global index after pointing to newer version of jar and but i see below exception while reading the parquet file . could you please check is that something you can help on this.
Not sure why its trying to read .commit file which is causing magic byte exception.
spark.read.parquet(basepath+"/*").show(false)
Caused by: org.apache.spark.SparkException: Exception thrown in awaitResult: at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:52) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:324) at org.apache.spark.rdd.RDD.iterator(RDD.scala:288) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:90) at org.apache.spark.scheduler.Task.run(Task.scala:123) at org.apache.spark.executor.Executor$TaskRunner$$anonfun$10.org$apache$spark$executor$Executor$TaskRunner$$anonfun$$res$1(Executor.scala:412) at org.apache.spark.executor.Executor$TaskRunner$$anonfun$10.apply(Executor.scala:419) at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1359) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:430) 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) Caused by: java.io.IOException: Could not read footer for file: FileStatus{path=maprfs:///datalake/globalndextest0604/.hoodie/20200603115556.commit; isDirectory=false; length=4366; replication=0; blocksize=0; modification_time=0; access_time=0; owner=; group=; permission=rw-rw-rw-; isSymlink=false} at org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat$$anonfun$readParquetFootersInParallel$1.apply(ParquetFileFormat.scala:551) at org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat$$anonfun$readParquetFootersInParallel$1.apply(ParquetFileFormat.scala:538) at org.apache.spark.util.ThreadUtils$$anonfun$3$$anonfun$apply$1.apply(ThreadUtils.scala:287) at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121) at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) Caused by: java.lang.RuntimeException: maprfs:///datalake/globalndextest0604/.hoodie/20200603115556.commit is not a Parquet file. expected magic number at tail [80, 65, 82, 49] but found [32, 48, 10, 125]
info: /basepath/.hoodie/ drwxr-sr-x. 2 xxx xgc 0 Jun 3 11:55 archived -rwxr-xr-x. 1 xxx xgc 207 Jun 3 11:55 hoodie.properties -rwxr-xr-x. 1 xxx xgc 0 Jun 3 11:55 20200603115556.commit.requested -rwxr-xr-x. 1 xxx xgc 380 Jun 3 11:56 20200603115556.inflight -rwxr-xr-x. 1 xxx xgc 4366 Jun 3 11:56 20200603115556.commit -rwxr-xr-x. 1 xxx xgc 0 Jun 3 11:57 20200603115719.commit.requested -rwxr-xr-x. 1 xxx xgc 380 Jun 3 11:57 20200603115719.inflight -rwxr-xr-x. 1 xxx xgc 5906 Jun 3 11:57 20200603115719.commit
@prashanthpdesai : You should be using spark.read.format("hudi") instead of parquet to read Hudi datasets.
@bvaradar: Thank you for the clarification. i am able to read the hudi parquet files.