You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "ad1happy2go (via GitHub)" <gi...@apache.org> on 2025/10/07 11:00:21 UTC
[PR] feat: Databricks partition predicate fix [hudi]
ad1happy2go opened a new pull request, #14059:
URL: https://github.com/apache/hudi/pull/14059
### Describe the issue this Pull Request addresses
Fixes https://github.com/apache/hudi/issues/14058
While running hudi on databricks, the code failed as InterpretedPredicate was expecting two parameters in the constructor
### Summary and Changelog
<!-- Short, plain-English summary of what users gain or what changed in behavior.
Followed by a detailed log of all the changes. Highlight if any code was copied. -->
### Impact
<!-- Describe any public API or user-facing feature change or any performance impact. -->
### Risk Level
<!-- Accepted values: none, low, medium or high. Other than `none`, explain the risk.
If medium or high, explain what verification was done to mitigate the risks. -->
### Documentation Update
<!-- Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
- The config description must be updated if new configs are added or the default value of the configs are changed.
- Any new feature or user-facing change requires updating the Hudi website. Please follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to make changes to the website. -->
### Contributor's checklist
- [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Enough context is provided in the sections above
- [ ] Adequate tests were added if applicable
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3376726892
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
}, {
"hash" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097",
"triggerID" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 43b532452b1e1d496d3c486da8af3cdd3ea09933 Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua merged PR #14059:
URL: https://github.com/apache/hudi/pull/14059
--
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: [PR] feat: Databricks partition predicate fix [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3376557796
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
}, {
"hash" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2dcbc47dc419de8ee0ad93f54cbed81029906e78 Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096)
* 43b532452b1e1d496d3c486da8af3cdd3ea09933 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Databricks partition predicate fix [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3376381280
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2dcbc47dc419de8ee0ad93f54cbed81029906e78 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3376578879
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
}, {
"hash" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097",
"triggerID" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2dcbc47dc419de8ee0ad93f54cbed81029906e78 Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096)
* 43b532452b1e1d496d3c486da8af3cdd3ea09933 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #14059:
URL: https://github.com/apache/hudi/pull/14059#discussion_r2446401976
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/SparkHoodieTableFileIndex.scala:
##########
@@ -248,12 +248,24 @@ class SparkHoodieTableFileIndex(spark: SparkSession,
// the whole table
if (haveProperPartitionValues(partitionPaths.toSeq) && partitionSchema.nonEmpty) {
val predicate = partitionPruningPredicates.reduce(expressions.And)
- val boundPredicate = InterpretedPredicate(predicate.transform {
+ val transformedPredicate = predicate.transform {
case a: AttributeReference =>
val index = partitionSchema.indexWhere(a.name == _.name)
BoundReference(index, partitionSchema(index).dataType, nullable = true)
- })
-
+ }
+ val boundPredicate: BasePredicate = try {
+ // Try using 1-arg constructor via reflection
+ val clazz = Class.forName("org.apache.spark.sql.catalyst.expressions.InterpretedPredicate")
+ val ctor = clazz.getConstructor(classOf[Expression])
+ ctor.newInstance(transformedPredicate).asInstanceOf[BasePredicate]
+ } catch {
+ case _: NoSuchMethodException | _: IllegalArgumentException =>
+ // Fallback: Try using 2-arg constructor
+ val clazz = Class.forName("org.apache.spark.sql.catalyst.expressions.InterpretedPredicate")
+ val ctor = clazz.getConstructor(classOf[Expression], classOf[Boolean])
+ ctor.newInstance(transformedPredicate, java.lang.Boolean.FALSE)
+ .asInstanceOf[BasePredicate]
Review Comment:
nit: add docs on what the second argument represents?
--
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: [PR] feat: Databricks partition predicate fix [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3376386083
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2dcbc47dc419de8ee0ad93f54cbed81029906e78 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "ad1happy2go (via GitHub)" <gi...@apache.org>.
ad1happy2go commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3393353101
> have we tested this? and I assume it may not be easy to write any functional tests on this to go w/ CI?
Yes @nsivabalan I have tested this and reads are working fine in databricks also 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
Re: [PR] feat: Databricks partition predicate fix [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3376397450
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2dcbc47dc419de8ee0ad93f54cbed81029906e78 Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3449391434
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
}, {
"hash" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097",
"triggerID" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"triggerType" : "PUSH"
}, {
"hash" : "9214a0869c1053df9a75c9fa56a2bde725a724ba",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9347",
"triggerID" : "9214a0869c1053df9a75c9fa56a2bde725a724ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 43b532452b1e1d496d3c486da8af3cdd3ea09933 Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097)
* 9214a0869c1053df9a75c9fa56a2bde725a724ba Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9347)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3449389057
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
}, {
"hash" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097",
"triggerID" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"triggerType" : "PUSH"
}, {
"hash" : "9214a0869c1053df9a75c9fa56a2bde725a724ba",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9214a0869c1053df9a75c9fa56a2bde725a724ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 43b532452b1e1d496d3c486da8af3cdd3ea09933 Azure: [FAILURE](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097)
* 9214a0869c1053df9a75c9fa56a2bde725a724ba UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: [PR] feat: Partition predicate fix for Databricks runtime support [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #14059:
URL: https://github.com/apache/hudi/pull/14059#issuecomment-3449542106
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9096",
"triggerID" : "2dcbc47dc419de8ee0ad93f54cbed81029906e78",
"triggerType" : "PUSH"
}, {
"hash" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9097",
"triggerID" : "43b532452b1e1d496d3c486da8af3cdd3ea09933",
"triggerType" : "PUSH"
}, {
"hash" : "9214a0869c1053df9a75c9fa56a2bde725a724ba",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9347",
"triggerID" : "9214a0869c1053df9a75c9fa56a2bde725a724ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9214a0869c1053df9a75c9fa56a2bde725a724ba Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=9347)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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