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

Add sql bind logic for TableAvailable to simplify TablesContext logic #34029

Open
22 of 34 tasks
strongduanmu opened this issue Dec 12, 2024 · 7 comments · Fixed by #34165
Open
22 of 34 tasks

Add sql bind logic for TableAvailable to simplify TablesContext logic #34029

strongduanmu opened this issue Dec 12, 2024 · 7 comments · Fixed by #34165

Comments

@strongduanmu
Copy link
Member

strongduanmu commented Dec 12, 2024

Feature Request

Is your feature request related to a problem?

No

Describe the feature you would like.

Currently, TablesContext is used to process tables in SQL statements, as well as the database and schema information to which the tables belong. It also provides the findTableNames method, which is responsible for finding the table information based on columns and metadata.

This method can handle simple SQL scenarios, but for complex multi-table associations and nested subqueries, findTableNames has difficulty analyzing the correct table, which can cause some functional abnormalities.

In order to completely solve this problem, we need to use SQLBindEngine to process these statements. Currently, statements that implement the TableAvailable interface need to be bound in SQL BindEngine. The binding goal is to find the library and schema to which the TableNameSegment in SimpleTableSegement belongs, and then set the TableSegmentBoundInfo object.

The following are the statements that need to implement SQLBind.

  • AlterIndexStatementContext @YaoFly
  • AlterTableStatementContext @strongduanmu
  • AlterViewStatementContext
  • AnalyzeTableStatementContext
  • CloseStatementContext
  • CommentStatementContext @strongduanmu
  • CopyStatementContext @lubochen
  • CreateIndexStatementContext
  • CreateTableStatementContext @strongduanmu
  • CreateViewStatementContext
  • CursorStatementContext
  • DeleteStatementContext @strongduanmu
  • DenyUserStatementContext
  • DropIndexStatementContext @YaoFly
  • DropTableStatementContext
  • DropViewStatementContext @chakkk309
  • ExplainStatementContext
  • FetchStatementContext
  • FlushStatementContext
  • GrantStatementContext
  • InsertStatementContext @strongduanmu
  • LoadDataStatementContext @YaoFly
  • LoadXMLStatementContext @YaoFly
  • MoveStatementContext
  • OptimizeTableStatementContext
  • PrepareStatementContext
  • RenameTableStatementContext
  • RevokeStatementContext
  • SelectStatementContext @strongduanmu
  • ShowColumnsStatementContext
  • ShowCreateTableStatementContext
  • ShowIndexStatementContext
  • TruncateStatementContext
  • UpdateStatementContext @strongduanmu
@YaoFly
Copy link
Contributor

YaoFly commented Dec 13, 2024

I can take the AlterIndexStatementContext task and after that is done I will take more.

@strongduanmu
Copy link
Member Author

@YaoFly Welcome.

@lubochen
Copy link
Contributor

@strongduanmu , could you please assign the CopyStatementContext task to me? Thank you. I will take on more after the completion of that.

@strongduanmu
Copy link
Member Author

@strongduanmu , could you please assign the CopyStatementContext task to me? Thank you. I will take on more after the completion of that.

@lubochen Welcome.

@chakkk309
Copy link
Contributor

Hi @strongduanmu, I would like to try working on the DropViewStatementContext. Could you please assign this task to me? Thanks~

@strongduanmu
Copy link
Member Author

@chakkk309 Welcome back.

@strongduanmu
Copy link
Member Author

I will first add SQLBinderIT to this task to test the results after Bind.

YaoFly pushed a commit to YaoFly/shardingsphere that referenced this issue Dec 26, 2024
strongduanmu added a commit that referenced this issue Dec 26, 2024
* Support GroupConcat sql for aggregating multiple shards(#33797)

* Check Style fix(#33797)

* Check Style fix(#33797)

* spotless fix (#33797)

* unit test fix  (#33797)

* spotless fix (#33797)

* group_concat distinct compatible  (#33797)

* group_concat distinct compatible  (#33797)

* unit test fix for distinct group_concat  (#33797)

* e2e test for group_concat  (#33797)

* e2e test for group_concat  (#33797)

* code format  (#33797)

* e2e test  (#33797)

* e2e test  (#33797)

* e2e test  (#33797)

* remove useless code(#33797)

* code optimization (#33797)

* sql parse unit test (#33797)

* RELEASE-NOTES.md updated(#33797)

* Code Optimization (#33797)

* Support GroupConcat sql for aggregating multiple shards in opengauss and doris database(#33797)

* doris parse unit test fix (#33797)

* spotless fix (#33797)

* Update RELEASE-NOTES.md

* Add DBCOMPATIBILITY 'B' parameter to opengauss database (#33992)

* Add DBCOMPATIBILITY 'B' parameter to opengauss database for dbtbl_with_readwrite_splitting and  readwrite_splitting scenarios(#33992)

* add openGauss test case for group_concat. (#33992)

* Support alter index sql bind and add test case. (#34029)

* code fix

* spotless

* code fix

---------

Co-authored-by: yaofly <[email protected]>
Co-authored-by: Zhengqiang Duan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment