shardingsphere: Support unsupported sql in parser.
Hi community, There are some unsupported sql in this file You can help to support if you
Be familiar with g4 file of Antlr (The grammars are RegularExpression-like) Be familiar with java
Background
How is a SQL parsed?
SQL definition file
->(Parse to)
AST
->(Visit it)
SQLStatment
Process
- Pick an unsupported sql and try to get why it’s not supported.(antlr4 grammer? or not implement visit method. You can use antlr4 plugins to help analysis.You may need to visit offical doc to check the grammer.)
- After you fixing it, remember to add new corresponding SQL case in SQL Cases and expected parsed result in Expected Statment XML
- Run SQLParserParameterizedTest to make sure no exceptions.
Notice
1.Left recursion can not work well in Antlr4,
a
: b
| a b
;
b
: a c
;
c
: ...
;
you can consider the following one,
a
: b*
;
b
: a c
;
c
: ...
;
Here is a Chinese version for reference.
Sub Task
- assert_select_into_SQL
- assert_select_with_collate_with_marker
- assert_select_with_json_extract_sign_with_parameter_marker
- assert_select_with_json_unquote_extract_sign_with_parameter_marker
- assert_insert_with_first
- assert_dist_SQL_show_rule_parse_conflict
- create_bit_xor_table
- select_with_comment1
- select_with_comment2
- select_with_comment5
- select_with_comment6
- select_with_comment7
- select_with_comment8
- select_with_comment9
- select_with_comment10
- alter_table_convert
- alter_table_convert_collate
- delimiter
- with_select
- with_select_comment
- select_cast
- copy_table_from_stdin
- create_type
- create_aggregate
- create_table_as_select
- create_schema
- alter_aggregate
- create_conversion
- alter_conversion
- create_foreign_data_wrapper
- create_server
- alter_foreign_data_wrapper
- create_language
- alter_language
- create_operator
- alter_operator
- create_statistics
- alter_statistics
- create_text_search_dictionary
- alter_text_search_dictionary
- create_text_search_template
- alter_text_search_template
- create_tex_search_parser
- alter_text_search_parser
- drop_foreign_data_wrapper
- drop_language
- drop_schema
- drop_operator
- comment_on_table
- alter_view_rename
- create_table_no_valid
- create_rule
- drop_rule
- create_as_select
- create_domain
- drop_domain
- create_temp_table
- select_case_when
- select_like
- select_keyword
- drop_type
- alter_table_set
- alter_view_set
- create_publication
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (22 by maintainers)
Commits related to this issue
- Support parsing create_bit_xor_table in MySQL (#14015) — committed to FlyingZC/shardingsphere by FlyingZC 2 years ago
- Support parsing create_bit_xor_table in MySQL (#14015) — committed to FlyingZC/shardingsphere by FlyingZC 2 years ago
- Support parsing create_bit_xor_table in MySQL (#14015) (#18659) * Support parsing create_bit_xor_table in MySQL (#14015) * Support parsing create_bit_xor_table in MySQL (#14015) — committed to apache/shardingsphere by FlyingZC 2 years ago
- Support parsing create procedure with create view in MySQL (#14015) — committed to FlyingZC/shardingsphere by FlyingZC 2 years ago
- Support parsing create procedure with create view in MySQL (#14015) (#18768) — committed to apache/shardingsphere by FlyingZC 2 years ago
I want to do
create_schema
drop_schema
Sorry. I forgot it. Withdrew.
I will do:
create_languagealter_languagedrop_languageSure. I will read the issue and claim the subtasks.
I want to do
drop_domain