nsivabalan commented on a change in pull request #4996:
URL: https://github.com/apache/hudi/pull/4996#discussion_r831610018
##########
File path:
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestDataSkippingUtils.scala
##########
@@ -338,4 +382,206 @@ object TestDataSkippingUtils {
Seq("file_1", "file_2", "file_3", "file_4"))
)
}
+
+ def testCompositeFilterExpressionsSource():
java.util.stream.Stream[Arguments] = {
+ java.util.stream.Stream.of(
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') = '03/06/2022'",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_2")),
+ arguments(
+ "'03/06/2022' = date_format(C, 'MM/dd/yyyy')",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_2")),
+ arguments(
+ "'03/06/2022' != date_format(C, 'MM/dd/yyyy')",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_1")),
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') != '03/06/2022'",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_1")),
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') < '03/07/2022'",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_2")),
+ arguments(
+ "'03/07/2022' > date_format(C, 'MM/dd/yyyy')",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_2")),
+ arguments(
+ "'03/07/2022' < date_format(C, 'MM/dd/yyyy')",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_1")),
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') > '03/07/2022'",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_1")),
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') <= '03/06/2022'",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_2")),
+ arguments(
+ "'03/06/2022' >= date_format(C, 'MM/dd/yyyy')",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_2")),
+ arguments(
+ "'03/08/2022' <= date_format(C, 'MM/dd/yyyy')",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_1")),
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') >= '03/08/2022'",
+ Seq(
+ IndexRow("file_1",
+ C_minValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_maxValue = new Timestamp(1646797848000L), // 03/08/2022
+ C_num_nulls = 0),
+ IndexRow("file_2",
+ C_minValue = new Timestamp(1646625048000L), // 03/06/2022
+ C_maxValue = new Timestamp(1646711448000L), // 03/07/2022
+ C_num_nulls = 0)
+ ),
+ Seq("file_1")),
+ arguments(
+ "date_format(C, 'MM/dd/yyyy') IN ('03/08/2022')",
Review comment:
I reviewed the data skipping class. looks like IN w/ multiple values is
supported.
--
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]