[Feature](paimon) Refactor Paimon system tables to use native table execution path#60556
Open
suxiaogang223 wants to merge 15 commits intoapache:masterfrom
Open
[Feature](paimon) Refactor Paimon system tables to use native table execution path#60556suxiaogang223 wants to merge 15 commits intoapache:masterfrom
suxiaogang223 wants to merge 15 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-H: Total hot run time: 31965 ms |
ClickBench: Total hot run time: 28.33 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
Author
|
run buildall |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 30551 ms |
ClickBench: Total hot run time: 28.72 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
FE Regression Coverage ReportIncrement line coverage |
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 problem does this PR solve?
Summary
$snapshots,$files,$schemas,$partitions, etc.) to use the native table execution path (PaimonScanNode) instead of the TVF path (MetadataScanNode/paimon_meta())SysTabletype hierarchy (NativeSysTable/TvfSysTable) and a centralizedSysTableResolverto cleanly separate native vs TVF execution pathspaimon_metaTVF,PaimonSysTableJniScanner, andPaimonSysTableJniReader— all Paimon system table queries now go through the unifiedPaimonScanNode+PaimonJniScannerpathMotivation
Previously, Paimon system tables were queried via a Table-Valued Function (
paimon_meta()), which:PaimonSysTableJniScanner) and C++ reader (PaimonSysTableJniReader) dedicated to system tablesMetadataScanNodeinstead ofPaimonScanNode, missing optimizations available in the native path (predicate pushdown, projection pushdown, etc.)SysTabletightly coupled with the TVF execution model, making it hard to add new system table typesArchitecture After Refactoring
SysTable Type Hierarchy
Each table type declares its supported system tables via
Map<String, SysTable>:PaimonExternalTable.getSupportedSysTables()→PaimonSysTable.SUPPORTED_SYS_TABLESIcebergExternalTable.getSupportedSysTables()→IcebergSysTable.SUPPORTED_SYS_TABLESHMSExternalTable.getSupportedSysTables()→ varies byDLAType(HIVE/ICEBERG)Query Execution Flow
DESCRIBE Flow
Key New Classes
SysTableNativeSysTableuseNativeTablePath()=true, factory methodcreateSysExternalTable()TvfSysTableuseNativeTablePath()=false, factory methodscreateFunction()/createFunctionRef()PaimonSysTableSystemTableLoader.SYSTEM_TABLESSysTableResolverresolveForPlan()/resolveForDescribe()/validateForQuery()PaimonSysExternalTableKey Modified Classes
TableIfgetSupportedSysTables()returnsMap<String, SysTable>(wasList); addedfindSysTable()for O(1) lookupBindRelationhandleMetaTable()usesSysTableResolver; native path →LogicalFileScan, TVF path →LogicalTVFRelationDescribeCommandSysTableResolver.resolveForDescribe(); native path returns column schema directlyPaimonScanNodegetSplits()separatesDataSplitvs non-DataSplit; non-DataSplitalways uses JNI readerPaimonSplitSplit(not justDataSplit); addedgetDataSplit()PaimonSourceresolvePaimonTable()handles bothPaimonExternalTableandPaimonSysExternalTablePhysicalPlanTranslatorTableType.PAIMON_EXTERNAL_TABLEcheck instead ofinstanceof PaimonExternalTableRelationUtilgetDbAndTable()usesSysTableResolver.validateForQuery()IcebergScanNodeBaseTablemetadata tables to avoidClassCastExceptionRemoved Classes
PaimonTableValuedFunctionPaimonSysExternalTable+PaimonScanNodePaimonMeta(Nereids TVF)LogicalFileScanwithPaimonSysExternalTablePaimonSysTableJniScanner(Java)PaimonJniScannerPaimonSysTableJniReader(C++)PaimonJniReaderSupportedSysTablesPaimonSysTable.SUPPORTED_SYS_TABLES, etc.)Test Plan
paimon_system_table.groovy,test_paimon_system_table_auth.groovypaimon_meta()TVF calls replaced with directtable$systemTablesyntaxDESCRIBE table$snapshotsreturns correct schema via native path$snapshots,$files,$schemas,$partitions) return correct resultspaimon_metaTVFtest_table_name_with_dollar.groovyverifies tables with$in their name still work correctlyCheck List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)