Uploaded image for project: 'Comdev GSOC'
  1. Comdev GSOC
  2. GSOC-267

[GSOC] [ShardingSphere] Support for PostgreSQL Search Path Feature

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Apache ShardingSphere

      Apache ShardingSphere is positioned as a Database Plus, and aims at building a standard layer and ecosystem above heterogeneous databases. It focuses on how to reuse existing databases and their respective upper layer, rather than creating a new database. The goal is to minimize or eliminate the challenges caused by underlying databases fragmentation.

      Pagehttps://shardingsphere.apache.org

      Githubhttps://github.com/apache/shardingsphere 

      Discussionhttps://github.com/apache/shardingsphere/discussions/30252
       

      Background

      Apache ShardingSphere is positioned as Database Plus and aims to build a standard layer and ecosystem on top of heterogeneous databases. Therefore, ShardingSphere can be used with storage nodes like PostgreSQL. When users use PostgreSQL, they may have set the priority of query schema in system variables in advance. For example, when executing the SQL statement: SELECT * FROM order, if no schema is specified, the logical execution on PostgreSQL is as follows: scan through schemas in search_path one by one until the order table is found. On ShardingSphere, the current logic is to always query the public schema. Therefore, it is planned to support the search_path functionality for PostgreSQL in ShardingSphere to enhance the user experience.

      Task

      1.Support configuring search_path in ShardingSphere.

      • Support setting the search_path using PostgreSQL's "SET search_path" syntax;
      • Store the user-configured search_path information in the metadata of ShardingSphereSchema;
      • Support querying the search_path using PostgreSQL's "SHOW search_path" syntax.

      2.Support matching the corresponding schema through search_path configuration.

      • During the SQL Binder phase, for a given SQL statement such as "select * from t_order", identify the schema corresponding to the table "t_order" based on the search_path and record it.

      3.Support propagating the matched schema to the storage node.

      • During the rewriting phase, add the schema information matched from the search_path to the actual SQL statement.

      Relevant Skills

      1. Proficiency in Java.
      2. Familiarity with PostgreSQL databases.
      3. Familiarity with ShardingSphere.

      Deliverables

      Related code + unit tests + E2E tests.

      Mentor

      Zhengqiang Duan, PMC Member of Apache ShardingSphere, duanzhengqiang@apache.org
      Cheng Zhang, Committer of Apache ShardingSphere, chengzhang@apache.org

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            chengzhang Cheng Zhang

            Dates

              Created:
              Updated:

              Slack

                Issue deployment