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

fix(query): fix variant failed to successfully apply virtual column in bind join #17673

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

KKould
Copy link
Member

@KKould KKould commented Mar 31, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Fixed the issue that the existing virtual column was not success fully applied when bind join and eq condition was of variant type

explain select t1.a, t1.v['b'] from t1 left outer join t2 on t1.v['b'] = t2.a where t1.v['a'][0] = 1;

HashJoin
├── output columns: [t1.a (#0), t1.v['b'] (#4)]
├── join type: RIGHT OUTER
├── build keys: []
├── probe keys: []
├── keys is null equal: []
├── filters: [TRY_CAST(v['b'] (#4) AS Int32 NULL) = t2.a (#2)]
├── estimated rows: 0.00
├── TableScan(Build)
│   ├── table: default.test_virtual_db.t1
│   ├── output columns: [a (#0), v['b'] (#4)]
│   ├── read rows: 1
│   ├── read size: < 1 KiB
│   ├── partitions total: 1
│   ├── partitions scanned: 1
│   ├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
│   ├── push downs: [filters: [is_true(TRY_CAST(v['a'][0] (#5) AS UInt8 NULL) = 1)], limit: NONE]
│   ├── virtual columns: [v['a'][0], v['b']]
│   └── estimated rows: 0.00
└── TableScan(Probe)
    ├── table: default.test_virtual_db.t2
    ├── output columns: [a (#2)]
    ├── read rows: 1
    ├── read size: < 1 KiB
    ├── partitions total: 1
    ├── partitions scanned: 1
    ├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1>]
    ├── push downs: [filters: [], limit: NONE]
    └── estimated rows: 1.00

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@KKould KKould changed the title Fixed the problem that variant failed to successfully apply virtual column in bind join fix: Fixed the problem that variant failed to successfully apply virtual column in bind join Mar 31, 2025
@KKould KKould changed the title fix: Fixed the problem that variant failed to successfully apply virtual column in bind join fix(query): Fixed the problem that variant failed to successfully apply virtual column in bind join Mar 31, 2025
@KKould KKould changed the title fix(query): Fixed the problem that variant failed to successfully apply virtual column in bind join fix(query): the problem that variant failed to successfully apply virtual column in bind join Mar 31, 2025
@b41sh b41sh self-requested a review March 31, 2025 06:58
@KKould KKould changed the title fix(query): the problem that variant failed to successfully apply virtual column in bind join fix(query): fix variant failed to successfully apply virtual column in bind join Mar 31, 2025
@KKould KKould force-pushed the fix/bind_join_virtual_column branch 4 times, most recently from 27194ff to 89c2ac1 Compare March 31, 2025 10:24
@KKould KKould changed the title fix(query): fix variant failed to successfully apply virtual column in bind join fix(query): fix variant failed to successfully apply virtual column in bind join Mar 31, 2025
@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Mar 31, 2025
@KKould KKould force-pushed the fix/bind_join_virtual_column branch from 89c2ac1 to 748787a Compare April 1, 2025 02:13
@KKould KKould force-pushed the fix/bind_join_virtual_column branch from 646d93f to e265d1c Compare April 1, 2025 03:16
@b41sh b41sh merged commit 26b436b into databendlabs:main Apr 2, 2025
216 of 220 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants