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

Apache ShardingSphere: Enhance SQLNodeConverterEngine to support more MySQL SQL statements

    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 

      Background

      The ShardingSphere SQL federation engine provides support for complex SQL statements, and it can well support cross-database join queries, subqueries, aggregation queries and other statements. An important part of SQL federation engine is to convert the SQL statement parsed by ShardingSphere into SqlNode, so that Calcite can be used to implement SQL optimization and federated query.

      Task

      This issue is to solve the MySQL exception that occurs during SQLNodeConverterEngine conversion. The specific case list is as follows.

      • select_char
      • select_extract
      • select_from_dual
      • select_from_with_table
      • select_group_by_with_having_and_window
      • select_not_between_with_single_table
      • select_not_in_with_single_table
      • select_substring
      • select_trim
      • select_weight_string
      • select_where_with_bit_expr_with_ampersand
      • select_where_with_bit_expr_with_caret
      • select_where_with_bit_expr_with_div
      • select_where_with_bit_expr_with_minus_interval
      • select_where_with_bit_expr_with_mod
      • select_where_with_bit_expr_with_mod_sign
      • select_where_with_bit_expr_with_plus_interval
      • select_where_with_bit_expr_with_signed_left_shift
      • select_where_with_bit_expr_with_signed_right_shift
      • select_where_with_bit_expr_with_vertical_bar
      • select_where_with_boolean_primary_with_comparison_subquery
      • select_where_with_boolean_primary_with_is
      • select_where_with_boolean_primary_with_is_not
      • select_where_with_boolean_primary_with_null_safe
      • select_where_with_expr_with_and_sign
      • select_where_with_expr_with_is
      • select_where_with_expr_with_is_not
      • select_where_with_expr_with_not
      • select_where_with_expr_with_not_sign
      • select_where_with_expr_with_or_sign
      • select_where_with_expr_with_xor
      • select_where_with_predicate_with_in_subquery
      • select_where_with_predicate_with_regexp
      • select_where_with_predicate_with_sounds_like
      • select_where_with_simple_expr_with_collate
      • select_where_with_simple_expr_with_match

      You need to compare the difference between actual and expected, and then correct the logic in SQLNodeConverterEngine so that actual can be consistent with expected.

      After you make changes, remember to add case to SUPPORTED_SQL_CASE_IDS to ensure it can be tested.

       
      Notice, these issues can be a good example.
      https://github.com/apache/shardingsphere/pull/14492

      Relevant Skills

       
      1. Master JAVA language

      2. Have a basic understanding of Antlr g4 file

      3. Be familiar with MySQL and Calcite SqlNode

      Targets files

       
      SQLNodeConverterEngineIT

      https://github.com/apache/shardingsphere/blob/master/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimize/SQLNodeConverterEngineIT.java 

      Mentor

      Zhengqiang Duan, PMC of Apache ShardingSphere, duanzhengqiang@apache.org

      Chuxin Chen, Committer of Apache ShardingSphere, tuichenchuxin@apache.org

      Trista Pan, PMC of Apache ShardingSphere, panjuan@apache.org

      Attachments

        1. Screen Shot 2023-03-08 at 9.06.15 PM.png
          374 kB
          Gael Yimen Yimga
        2. Screen Shot 2023-03-13 at 11.46.14 PM.png
          65 kB
          Gael Yimen Yimga
        3. Screen Shot 2023-03-13 at 11.55.44 PM.png
          61 kB
          Gael Yimen Yimga

        Activity

          People

            Unassigned Unassigned
            duanzhengqiang Zhengqiang Duan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: