voonhous commented on code in PR #19836:
URL: https://github.com/apache/hudi/pull/19836#discussion_r3948180313
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/procedure/TestHoodieProcedureFilterUtils.scala:
##########
@@ -111,13 +102,13 @@ class TestHoodieProcedureFilterUtils extends
HoodieSparkProcedureTestBase {
assertResult(rows)(keep(rows, "f > 1.0f", schema))
assertResult(rows)(keep(rows, "dec > 1.00", schema))
- // Mismatched literal types no-match even though the values would satisfy
the predicate.
- assertResult(Seq.empty)(keep(rows, "sh = 3", schema))
- assertResult(Seq.empty)(keep(rows, "by = 4", schema))
- assertResult(Seq.empty)(keep(rows, "f > 1.0d", schema))
- assertResult(Seq.empty)(keep(rows, "dec > 1", schema))
- // Same gap for a double column: a plain 15.0 parses as decimal, not
double.
- assertResult(Seq.empty)(keep(scalarRows, "price > 15.0", scalarSchema))
+ // Mismatched numeric types are widened to Spark's common type.
+ assertResult(rows)(keep(rows, "sh = 3", schema))
Review Comment:
Fixed: `rows` has a second, non-matching row, so a coercion that matches
everything now fails. Added `3 = sh` and `by < 300`.
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/procedure/TestHoodieProcedureFilterUtils.scala:
##########
@@ -111,13 +102,13 @@ class TestHoodieProcedureFilterUtils extends
HoodieSparkProcedureTestBase {
assertResult(rows)(keep(rows, "f > 1.0f", schema))
assertResult(rows)(keep(rows, "dec > 1.00", schema))
- // Mismatched literal types no-match even though the values would satisfy
the predicate.
- assertResult(Seq.empty)(keep(rows, "sh = 3", schema))
- assertResult(Seq.empty)(keep(rows, "by = 4", schema))
- assertResult(Seq.empty)(keep(rows, "f > 1.0d", schema))
- assertResult(Seq.empty)(keep(rows, "dec > 1", schema))
- // Same gap for a double column: a plain 15.0 parses as decimal, not
double.
- assertResult(Seq.empty)(keep(scalarRows, "price > 15.0", scalarSchema))
+ // Mismatched numeric types are widened to Spark's common type.
+ assertResult(rows)(keep(rows, "sh = 3", schema))
+ assertResult(rows)(keep(rows, "by = 4", schema))
+ assertResult(rows)(keep(rows, "f > 1.0d", schema))
+ assertResult(rows)(keep(rows, "dec > 1", schema))
+ // A plain 15.0 decimal literal is coerced with the double column.
Review Comment:
Done. Both comments reworded, duplicate `price > 15.0d` assertion dropped.
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/procedure/TestHoodieProcedureFilterUtils.scala:
##########
@@ -111,13 +102,13 @@ class TestHoodieProcedureFilterUtils extends
HoodieSparkProcedureTestBase {
assertResult(rows)(keep(rows, "f > 1.0f", schema))
assertResult(rows)(keep(rows, "dec > 1.00", schema))
- // Mismatched literal types no-match even though the values would satisfy
the predicate.
- assertResult(Seq.empty)(keep(rows, "sh = 3", schema))
- assertResult(Seq.empty)(keep(rows, "by = 4", schema))
- assertResult(Seq.empty)(keep(rows, "f > 1.0d", schema))
- assertResult(Seq.empty)(keep(rows, "dec > 1", schema))
- // Same gap for a double column: a plain 15.0 parses as decimal, not
double.
- assertResult(Seq.empty)(keep(scalarRows, "price > 15.0", scalarSchema))
+ // Mismatched numeric types are widened to Spark's common type.
+ assertResult(rows)(keep(rows, "sh = 3", schema))
+ assertResult(rows)(keep(rows, "by = 4", schema))
+ assertResult(rows)(keep(rows, "f > 1.0d", schema))
+ assertResult(rows)(keep(rows, "dec > 1", schema))
+ // A plain 15.0 decimal literal is coerced with the double column.
+ assertResult(Seq(scalarRows(1)))(keep(scalarRows, "price > 15.0",
scalarSchema))
Review Comment:
Fixed: `TestFsViewProcedure` calls `show_fsview_all(filter =>
'data_file_size > 0')` and the reversed `'0 < data_file_size'`. The reversed
form returns 0 rows on master, so the reported path is covered end to end.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]