You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "linliu-code (via GitHub)" <gi...@apache.org> on 2024/09/18 23:51:25 UTC
[PR] [HUDI-7848][WIP] Fail the comparison between different typed ordering values [hudi]
linliu-code opened a new pull request, #11961:
URL: https://github.com/apache/hudi/pull/11961
### Change Logs
1. Remove the function that allows the comparison between different types.
2. Add a test to consolidate the behavior.
### Impact
Remove ad hoc support for comparison between different types.
### Risk level (write none, low medium or high below)
No.
### 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 create a Jira ticket, attach the
ticket number here and 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)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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] [HUDI-7848] Fail comparisons between different typed ordering values [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11961:
URL: https://github.com/apache/hudi/pull/11961#issuecomment-2362347573
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2101d242846c7a7b12e68bcea3331c7f12861dd1",
"status" : "CANCELED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=602",
"triggerID" : "2101d242846c7a7b12e68bcea3331c7f12861dd1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2101d242846c7a7b12e68bcea3331c7f12861dd1 Azure: [CANCELED](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=602)
<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] [HUDI-7848] Fail comparisons between different typed ordering values [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11961:
URL: https://github.com/apache/hudi/pull/11961#issuecomment-2362324694
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2101d242846c7a7b12e68bcea3331c7f12861dd1",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=602",
"triggerID" : "2101d242846c7a7b12e68bcea3331c7f12861dd1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2101d242846c7a7b12e68bcea3331c7f12861dd1 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=602)
<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] [HUDI-7848] Fail comparisons between different typed ordering values [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #11961:
URL: https://github.com/apache/hudi/pull/11961#issuecomment-2362032542
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2101d242846c7a7b12e68bcea3331c7f12861dd1",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2101d242846c7a7b12e68bcea3331c7f12861dd1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2101d242846c7a7b12e68bcea3331c7f12861dd1 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] [HUDI-7848] Fail comparisons between different typed ordering values [hudi]
Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #11961:
URL: https://github.com/apache/hudi/pull/11961#discussion_r1767516818
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieBaseFileGroupRecordBuffer.java:
##########
@@ -247,8 +208,18 @@ protected Option<Pair<T, Map<String, Object>>> doProcessNextDataRecord(T record,
}
Comparable incomingOrderingValue = readerContext.getOrderingValue(
Option.of(record), metadata, readerSchema, props);
- if (compareTo(readerContext, incomingOrderingValue, existingOrderingValue) > 0) {
- return Option.of(Pair.of(record, metadata));
+
+ try {
+ if (incomingOrderingValue.compareTo(existingOrderingValue) > 0) {
+ return Option.of(Pair.of(record, metadata));
+ }
+ } catch (ClassCastException e) {
+ throw new HoodieException(String.format(
+ "Cannot compare values: %s(%s), %s(%s)",
+ incomingOrderingValue,
+ incomingOrderingValue.getClass(),
+ existingOrderingValue,
+ existingOrderingValue.getClass()));
Review Comment:
In `MergeIntoHoodieTableCommand` you need to validate the input schema first. If the schema is incompatible, the error should be thrown there. Deferring error here does not help user as this is not the root cause.
--
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] [HUDI-7848] Fail comparisons between different typed ordering values [hudi]
Posted by "linliu-code (via GitHub)" <gi...@apache.org>.
linliu-code commented on code in PR #11961:
URL: https://github.com/apache/hudi/pull/11961#discussion_r1772089590
##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieBaseFileGroupRecordBuffer.java:
##########
@@ -247,8 +208,18 @@ protected Option<Pair<T, Map<String, Object>>> doProcessNextDataRecord(T record,
}
Comparable incomingOrderingValue = readerContext.getOrderingValue(
Option.of(record), metadata, readerSchema, props);
- if (compareTo(readerContext, incomingOrderingValue, existingOrderingValue) > 0) {
- return Option.of(Pair.of(record, metadata));
+
+ try {
+ if (incomingOrderingValue.compareTo(existingOrderingValue) > 0) {
+ return Option.of(Pair.of(record, metadata));
+ }
+ } catch (ClassCastException e) {
+ throw new HoodieException(String.format(
+ "Cannot compare values: %s(%s), %s(%s)",
+ incomingOrderingValue,
+ incomingOrderingValue.getClass(),
+ existingOrderingValue,
+ existingOrderingValue.getClass()));
Review Comment:
sg
--
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