[ https://issues.apache.org/jira/browse/COMDEV-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zhengqiang Duan updated COMDEV-489: ----------------------------------- Description: h2. 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. {*}Page{*}: [https://shardingsphere.apache.org|https://shardingsphere.apache.org/] {*}Github{*}: [https://github.com/apache/shardingsphere] h2. 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. h2. 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 * select_where_with_simple_expr_with_not * select_where_with_simple_expr_with_odbc_escape_syntax * select_where_with_simple_expr_with_row * select_where_with_simple_expr_with_tilde * select_where_with_simple_expr_with_variable * select_window_function * select_with_assignment_operator * select_with_assignment_operator_and_keyword * select_with_case_expression * select_with_collate_with_marker * select_with_date_format_function * select_with_exists_sub_query_with_project * select_with_function_name * select_with_json_value_return_type * select_with_match_against * select_with_regexp * select_with_schema_name_in_column_projection * select_with_schema_name_in_shorthand_projection * select_with_spatial_function * select_with_trim_expr * select_with_trim_expr_from_expr 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|https://github.com/apache/shardingsphere/pull/15331] h2. Relevant Skills 1. Master JAVA language 2. Have a basic understanding of Antlr g4 file 3. Be familiar with MySQL and Calcite SqlNode h2. Targets files SQLNodeConverterEngineIT [https://github.com/apache/shardingsphere/blob/master/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimize/SQLNodeConverterEngineIT.java] h3. Mentor Zhengqiang Duan, PMC of Apache ShardingSphere, duanzhengqi...@apache.org Chuxin Chen, Committer of Apache ShardingSphere, tuichenchu...@apache.org was: h2. 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. {*}Page{*}: [https://shardingsphere.apache.org|https://shardingsphere.apache.org/] {*}Github{*}: [https://github.com/apache/shardingsphere] h2. Background ShardingSphere parser engine helps users parse a SQL to get the AST (Abstract Syntax Tree) and visit this tree to get SQLStatement (Java Object). At present, this parser engine can handle SQLs for `MySQL`, `PostgreSQL`, `SQLServer`, `openGauss` and `Oracle`, which means we have to understand different database dialect SQLs. {*}More details{*}: [https://shardingsphere.apache.org/document/current/en/reference/sharding/parse/] h2. Task This issue is to solve the unsupported postgres sql about alter in [this file|https://github.com/apache/shardingsphere/blob/master/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml] . * CALL * DO * DROP FUNCTION * DROP INDEX * DROP INSTANCE RULE * DROP REWRITE RULE * EXECUTE * EXPLAIN * FETCH * FETCH ABSOLUTE * FETCH ALL * FETCH BACKWARD * FETCH FIRST * FETCH LAST * FETCH NEXT * FETCH PRIOR * FETCH RELATIVE * IMPORT FOREIGN SCHEMA You can *learn more* [here|https://www.postgresql.org/docs/current/sql-commands.html]. * You may need to try to get why it's not supported.(antlr4 grammar? or not implement visit method) You can use [antlr4 plugins|https://plugins.jetbrains.com/plugin/7358-antlr-v4] to help you to analyze. You may need to visit [an official doc|https://www.postgresql.org/docs/current/sql-commands.html] to check the grammar. * After you fix it, remember to add a new corresponding SQL case in [SQL Cases|https://github.com/apache/shardingsphere/tree/master/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported] and expected parsed result in [Expected Statment XML|https://github.com/apache/shardingsphere/tree/master/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case]. * Run [SQLParserParameterizedTest|https://github.com/apache/shardingsphere/blob/master/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/SQLParserParameterizedTest.java] and [UnsupportedSQLParserParameterizedTest|https://github.com/apache/shardingsphere/blob/master/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/UnsupportedSQLParserParameterizedTest.java] to make sure no exceptions. {*}Notice{*}, these issues can be a good example. [support alter foreign table for pg/og|https://github.com/apache/shardingsphere/pull/14944] [support alter materialized view for pg/og.|https://github.com/apache/shardingsphere/pull/15331] h2. Relevant Skills 1. Master JAVA language 2. Have a basic understanding of Antlr g4 file 3. Be familiar with Postgres SQLs h2. Targets files 1. Postgres SQLs g4 file: [https://github.com/apache/shardingsphere/blob/master/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-postgresql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/PostgreSQLStatement.g4] h3. Mentor Chuxin Chen, Committer of Apache ShardingSphere, tuichenchu...@apache.org Zhengqiang Duan, Committer of Apache ShardingSphere, duanzhengqi...@apache.org Summary: Apache ShardingSphere: Enhance SQLNodeConverterEngine to support more MySQL SQL statements (was: Apache ShardingSphere: Support more MySQL SQLStatement conversion to SqlNode) > Apache ShardingSphere: Enhance SQLNodeConverterEngine to support more MySQL > SQL statements > ------------------------------------------------------------------------------------------ > > Key: COMDEV-489 > URL: https://issues.apache.org/jira/browse/COMDEV-489 > Project: Community Development > Issue Type: Improvement > Components: GSoC/Mentoring ideas > Reporter: Zhengqiang Duan > Priority: Major > Labels: Mentor, ShardingSphere, gsoc2023 > > h2. 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. > {*}Page{*}: > [https://shardingsphere.apache.org|https://shardingsphere.apache.org/] > {*}Github{*}: [https://github.com/apache/shardingsphere] > h2. 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. > h2. 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 > * select_where_with_simple_expr_with_not > * select_where_with_simple_expr_with_odbc_escape_syntax > * select_where_with_simple_expr_with_row > * select_where_with_simple_expr_with_tilde > * select_where_with_simple_expr_with_variable > * select_window_function > * select_with_assignment_operator > * select_with_assignment_operator_and_keyword > * select_with_case_expression > * select_with_collate_with_marker > * select_with_date_format_function > * select_with_exists_sub_query_with_project > * select_with_function_name > * select_with_json_value_return_type > * select_with_match_against > * select_with_regexp > * select_with_schema_name_in_column_projection > * select_with_schema_name_in_shorthand_projection > * select_with_spatial_function > * select_with_trim_expr > * select_with_trim_expr_from_expr > 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|https://github.com/apache/shardingsphere/pull/15331] > h2. Relevant Skills > > 1. Master JAVA language > 2. Have a basic understanding of Antlr g4 file > 3. Be familiar with MySQL and Calcite SqlNode > h2. Targets files > > SQLNodeConverterEngineIT > [https://github.com/apache/shardingsphere/blob/master/test/it/optimizer/src/test/java/org/apache/shardingsphere/test/it/optimize/SQLNodeConverterEngineIT.java] > > h3. Mentor > Zhengqiang Duan, PMC of Apache ShardingSphere, duanzhengqi...@apache.org > Chuxin Chen, Committer of Apache ShardingSphere, tuichenchu...@apache.org -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@community.apache.org For additional commands, e-mail: dev-h...@community.apache.org