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

Refactor SQL router engine to extract tableless statement routing logic #33811

Closed
4 tasks done
strongduanmu opened this issue Nov 26, 2024 · 0 comments · Fixed by #33941
Closed
4 tasks done

Refactor SQL router engine to extract tableless statement routing logic #33811

strongduanmu opened this issue Nov 26, 2024 · 0 comments · Fixed by #33941
Assignees
Milestone

Comments

@strongduanmu
Copy link
Member

strongduanmu commented Nov 26, 2024

Feature Request

Is your feature request related to a problem?

No

Describe the feature you would like.

At present, there are some problems in SQL router. For example, in the Sharding and Broadcast routing logic, some SQL statements do not contain tables. These logics were originally written in the Sharding routing. Later, Broadcast and Single routing were created. These modules copied these routing logics accordingly, or some of them were missing.

Therefore, we can consider adding a routing engine that does not contain table statements to handle SQL routing outside of Sharding, Broadcast, and Single tables.
After adding a new routing engine, the AllSQLRouteExecutor logic in the original routing logic can be deleted. This logic does not consider usage scenarios such as read-write separation, which may cause the SHOW TABLES statement to query duplicate results (all routes to all data sources under the logical library).

  • add sub-interface TableSQLRouter and DataSourceSQLRouter for SQLRouter
  • adjust the PartialSQLRouteExecutor logic to route according to TableSQLRouter and DataSourceSQLRouter in turn
  • add TablelessStatementSQLRouter to handle SQL routing for tableless statements
  • delete AllSQLRouteExecutor and PartialSQLRouteExecutor and migrate SHOW TABLES and SHOW TABLES STATUS routing logic to TablelessStatementSQLRouter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment