Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] fix wrong result for delta deletion vector #4614

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

zhli1142015
Copy link
Contributor

What changes were proposed in this pull request?

DV is not supported, before scan with DV would fallback. After #4538, scan with _delta_internal_is_row_deleted:tinyint is offloaded but generats wrong results. This change fallback this case.

- deletion vector *** FAILED ***
  Results do not match for query:
  Timezone: sun.util.calendar.ZoneInfo[id="America/Los_Angeles",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
  Timezone Env:

  == Parsed Logical Plan ==
  Relation [id#16425] parquet

  == Analyzed Logical Plan ==
  id: int
  Relation [id#16425] parquet

  == Optimized Logical Plan ==
  Project [id#16425]
  +- Filter UDF(__delta_internal_is_row_deleted#16585)
     +- Relation [id#16425,__delta_internal_is_row_deleted#16585] parquet

  == Physical Plan ==
  VeloxColumnarToRowExec
  +- ^(198) ProjectExecTransformer [id#16425]
     +- ^(198) InputIteratorTransformer[id#16425, __delta_internal_is_row_deleted#16585]
        +- RowToVeloxColumnar
           +- *(1) Filter UDF(__delta_internal_is_row_deleted#16585)
              +- VeloxColumnarToRowExec
                 +- ^(197) NativeFileScan parquet [id#16425,__delta_internal_is_row_deleted#16585] Batched: true, DataFilters: [], Format: Parquet, Location: PreparedDeltaFileIndex(1 paths)[file:/tmp/spark-410fb7f8-a994-407e-acee-03c0fc50b571], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<id:int,__delta_internal_is_row_deleted:tinyint>

  == Results ==

  == Results ==
  !== Correct Answer - 5 ==   == Gluten Answer - 10 ==
   struct<>                   struct<>
  ![1]                        [10]
  ![2]                        [1]
  ![3]                        [2]
  ![4]                        [3]
  ![5]                        [4]
  !                           [5]
  !                           [6]
  !                           [7]
  !                           [8]
  !                           [9] (GlutenQueryTest.scala:273)

How was this patch tested?

UT

Copy link

github-actions bot commented Feb 2, 2024

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/oap-project/gluten/issues

Then could you also rename commit message and pull request title in the following format?

[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}

See also:

@zhli1142015
Copy link
Contributor Author

cc @zhouyuan , @yma11 , @liujiayi771, @YannByron , could you help to review this PR? Thanks.

@liujiayi771
Copy link
Contributor

LGTM. Thanks.

@@ -183,4 +183,21 @@ class VeloxDeltaSuite extends WholeStageTransformerSuite {
)
}
}

testWithSpecifiedSparkVersion("deletion vector", Some("3.4.2")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why limits to 3.4.2?

Copy link
Contributor Author

@zhli1142015 zhli1142015 Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is only available after delta 2.3. for spark 3.2 and 3.3 we use delta 2.0 and 2.2.
https://docs.delta.io/latest/delta-deletion-vectors.html

@yma11 yma11 merged commit e9bc041 into apache:main Feb 2, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants