Add deltalake source and sink for topsql - #63
Merged
Conversation
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
yibin87
force-pushed
the
add_topsql_deltalake
branch
from
January 7, 2026 00:25
6532cd4 to
9dc07fd
Compare
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
| use std::path::PathBuf; | ||
|
|
||
| use vector::{ | ||
| aws::{AwsAuthentication, RegionOrEndpoint}, |
Collaborator
There was a problem hiding this comment.
我们现在只支持aws和alicloud?
Collaborator
There was a problem hiding this comment.
meta信息和data信息只是存储格式不同,但是mod.rs大部分是重复的,有必要分开吗?
Collaborator
Author
There was a problem hiding this comment.
嗯 好观点。目前分开的话好处在于,两部分的数据完全分开,这样两部分的 batch 不会相互影响,同时两部分实际处理逻辑还是不一样的,后续可以考虑把 不同云的 适配这部分逻辑单独提取出来,像 deltalake_writer 这样,这样两部分 mod 其实就基本是个壳子了
Collaborator
There was a problem hiding this comment.
当前版本的格式应该不用改吧,为什么要加入新的字段呢?
Collaborator
Author
Collaborator
Author
There was a problem hiding this comment.
更新了下,目前只保留了一些为了通过编译的改动,还有一些测试中的变动,原来 topsql 到 vm 的数据不会有任何变化
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
Signed-off-by: yibin87 <huyibin@pingcap.com>
zhoucai-pingcap
approved these changes
Jan 20, 2026
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.

TopSQL v2 Source and Delta Lake Sinks Implementation
Overview
This PR implements a complete TopSQL data collection and storage solution, including:
Key Features
1. TopSQL v2 Source (
topsql_v2)Data Output
tidb_topsqltable containing SQL execution statisticstikv_topsqltable containing TiKV-level SQL statisticstikv_topregiontable containing Region-level statisticstopsql_sql_metatable containing SQL text and metadatatopsql_plan_metatable containing execution plan informationConfiguration Options
2. TopSQL Data Delta Lake Sink (
topsql_data_deltalake)Core Features
source_tablefield and routes data to corresponding Delta Lake tablesSupported Data Types
tidb_topsql: TiDB TopSQL datatikv_topsql: TiKV TopSQL datatikv_topregion: TiKV TopRegion dataSchema Definition
Contains complete TopSQL metric fields:
3. TopSQL Meta Delta Lake Sink (
topsql_meta_deltalake)Core Features
{digest}_{date}(e.g.,sql_digest_2024-01-01)max_delay_secs, default 180 seconds)EVENT_BUFFER_MAX_SIZE, default 1000)Supported Data Types
topsql_sql_meta: SQL metadata (normalized_sql, sql_digest, etc.)topsql_plan_meta: Plan metadata (normalized_plan, encoded_normalized_plan, etc.)Configuration Examples
Complete Configuration Example