You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "hudi-bot (via GitHub)" <gi...@apache.org> on 2025/11/30 05:04:01 UTC
[I] IndexOutOfBoundException when recordKey has List values for Bucket index table [hudi]
hudi-bot opened a new issue, #15252:
URL: https://github.com/apache/hudi/issues/15252
Currently, the Bucket index is supported only if the record key has columns with simple values.
[https://github.com/apache/hudi/blob/master/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/bucket/BucketIdentifier.java#L71]
Example record for which this breaks
column1:value1,column2:value2,column3:[value1,value2]
## JIRA info
- Link: https://issues.apache.org/jira/browse/HUDI-4318
- Type: Bug
- Affects version(s):
- 0.11.1
---
## Comments
10/Jul/22 07:36;yuweixiao;Failed to re-produce the exception. My test code:
{code:java}
val schema = StructType( Array(
StructField("uuid", StringType),
StructField("ts", LongType),
StructField("partitionpath", StringType),
StructField("array_field", DataTypes.createArrayType(StringType))
))
val data = Seq(Row("id1", 1L, "2020/01/01", List("a","b","c")))
val df = spark.createDataFrame(spark.sparkContext.parallelize(data), schema)
df.write.format("org.apache.hudi")
.options(getQuickstartWriteConfigs)
.option(PRECOMBINE_FIELD.key, "ts")
.option(RECORDKEY_FIELD.key, "uuid")
.option(PARTITIONPATH_FIELD.key, "partitionpath")
.option(INDEX_TYPE.key(), IndexType.BUCKET.name())
.option(BUCKET_INDEX_ENGINE_TYPE.key(), BucketIndexEngineType.SIMPLE.name())
.option(BUCKET_INDEX_NUM_BUCKETS.key(), "4")
.option(TBL_NAME.key, tableName)
.mode(Overwrite)
.save(tablePath) {code};;;
--
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] IndexOutOfBoundException when recordKey has List values for Bucket index table [hudi]
Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on issue #15252:
URL: https://github.com/apache/hudi/issues/15252#issuecomment-4795341253
Triage: this looks **fixed on `master`**.
The original report points at the old `BucketIdentifier#getHashKeysUsingIndexFields` which did a naive `recordKey.split(",")` followed by `split(":")[1]` — that would indeed throw `IndexOutOfBoundsException` for record keys whose value contained `,` (e.g. a List rendered as `[v1,v2]`).
That parser was replaced in [HUDI-5302](https://issues.apache.org/jira/browse/HUDI-5302) (commit `3dc76af95d8e`, Dec 2022) to delegate to `KeyGenUtils.extractRecordKeysByFields`, which walks `:`/`,` boundaries field-by-field instead of a blind split. It was further hardened in [HUDI-8403](https://issues.apache.org/jira/browse/HUDI-8403) (`e19c815bb125`, Oct 2024). `TestKeyGenUtils#testExtractRecordKeysWithFields` covers values with embedded commas.
The initial reproducer attempt in this thread also failed to reproduce, consistent with the issue being addressed. Suggest closing as resolved — please reopen with a stack trace on a recent release if anyone still sees this.
--
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] IndexOutOfBoundException when recordKey has List values for Bucket index table [hudi]
Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan closed issue #15252: IndexOutOfBoundException when recordKey has List values for Bucket index table
URL: https://github.com/apache/hudi/issues/15252
--
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