coprocessor: add encoded_ops module for TiFlash dictionary encoding (Phases 1-4) - #3
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
Conversation
Adds TiKV-side support for passing dictionary encoding hints through the coprocessor pipeline to TiFlash: - EncodingHint struct: carries column eligibility, cardinality threshold, and enabled encoded operations (filter, group-by, bloom filter) - EncodedBloomFilterHint: supports bloom filter pushdown on dictionary- encoded columns for efficient semi-join filtering - Comprehensive unit tests for hint construction and bloom filter logic TiKV's role is passthrough — it forwards encoding hints from TiDB's DAGRequest to TiFlash without interpretation. The actual dictionary encoding and encoded operations happen in TiFlash's execution engine. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Adds TiKV-side relay structs for: - EncodedFilterRequest: filter predicate info relayed to TiFlash - EncodedGroupByRequest: array-indexed aggregation parameters - EncodedStarJoinRequest: fused star join configuration - EncodedOpsRequest: composite request combining all 4 phases - AggFuncType enum: Sum, Count, Min, Max, Any - DimensionJoinRequest: one dimension in a star schema 9 tests covering all new structs and the composite request. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is changed and how it works?
Issue Number: ref #xxx
What's Changed:
TiKV's coprocessor acts as a relay for encoded operation hints from TiDB to TiFlash. This PR adds the
encoded_opsmodule with all necessary struct definitions for Phases 1-4.Phase 1 — Base Encoding Hints:
EncodingHint: column IDs, max cardinality, per-operation enable flagsEncodedBloomFilterHint: bloom filter on dictionary entries for semi-joinPhase 2 — Encoded Filter Relay:
EncodedFilterRequest: column_id, filter_type (eq/ne/in/like), serialized valuesPhase 3 — Encoded Group-By Relay:
EncodedGroupByRequest: group-by column IDs,AggFuncTypeenum (Sum/Count/Min/Max/Any), estimated groupsPhase 4 — Encoded Star Join Relay:
EncodedStarJoinRequest: fact table, dimension joins, fused path flagDimensionJoinRequest: dimension table + column mappingComposite:
EncodedOpsRequest: combines all 4 phases into single DAGRequest attachmenthas_any_ops()/active_phases()helpersRelated changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note
Link to Devin session: https://6sense.devinenterprise.com/sessions/3710f99abca4415ba59b856f0a5588fc
Requested by: @premal