You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by li...@apache.org on 2025/05/09 06:42:11 UTC
(doris) branch encoding-master created (now 4e2b3bb1ff6)
This is an automated email from the ASF dual-hosted git repository.
liulijia pushed a change to branch encoding-master
in repository https://gitbox.apache.org/repos/asf/doris.git
at 4e2b3bb1ff6 support encoding grammar in old planner
This branch includes the following new commits:
new 4e2b3bb1ff6 support encoding grammar in old planner
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
(doris) 01/01: support encoding grammar in old planner
Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
liulijia pushed a commit to branch encoding-master
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 4e2b3bb1ff61af3755e1c399ba3e50608cd33097
Author: liutang123 <li...@gmail.com>
AuthorDate: Fri May 9 14:41:47 2025 +0800
support encoding grammar in old planner
---
fe/fe-core/src/main/cup/sql_parser.cup | 41 ++++++++++++++++++++++--------
fe/fe-core/src/main/jflex/sql_scanner.flex | 1 +
2 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/fe/fe-core/src/main/cup/sql_parser.cup b/fe/fe-core/src/main/cup/sql_parser.cup
index 8abddccf7d3..5c276041a6e 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -375,6 +375,7 @@ terminal String
KW_DYNAMIC,
KW_ELSE,
KW_ENABLE,
+ KW_ENCODING,
KW_ENCRYPTKEY,
KW_ENCRYPTKEYS,
KW_END,
@@ -809,6 +810,8 @@ nonterminal TypeDef type_def, type_def_nullable, opt_intermediate_type;
nonterminal List<TypeDef> type_def_list, type_def_nullable_list;
nonterminal FunctionArgsDef func_args_def;
nonterminal Type type;
+nonterminal ScalarType scalar_type;
+nonterminal String opt_encoding;
nonterminal Expr cast_expr, case_else_clause, analytic_expr;
nonterminal LiteralExpr literal;
nonterminal CaseExpr case_expr;
@@ -6883,7 +6886,18 @@ limit_clause ::=
{: RESULT = new LimitElement(offset.longValue(), limit.longValue()); :}
;
-type ::=
+opt_encoding ::=
+ /* empty */
+ {:
+ RESULT = "";
+ :}
+ | KW_ENCODING STRING_LITERAL:encoding
+ {:
+ RESULT = encoding;
+ :}
+ ;
+
+scalar_type ::=
KW_TINYINT opt_field_length
{: RESULT = Type.TINYINT; :}
| KW_SMALLINT opt_field_length
@@ -6953,12 +6967,6 @@ type ::=
{: RESULT = ScalarType.createVarcharType(-1); :}
| KW_VARCHAR
{: RESULT = ScalarType.createVarcharType(-1); :}
- | KW_ARRAY LESSTHAN type:value_type GREATERTHAN
- {: RESULT = new ArrayType(value_type); :}
- | KW_MAP LESSTHAN type:key_type COMMA type:value_type GREATERTHAN
- {: RESULT = new MapType(key_type,value_type); :}
- | KW_STRUCT LESSTHAN struct_field_list:fields GREATERTHAN
- {: RESULT = new StructType(fields); :}
| KW_CHAR LPAREN INTEGER_LITERAL:len RPAREN
{: ScalarType type = ScalarType.createCharType(len.intValue());
RESULT = type;
@@ -7003,15 +7011,26 @@ type ::=
{: ScalarType type = ScalarType.createHllType();
RESULT = type;
:}
+ | KW_ALL
+ {: RESULT = Type.ALL; :}
+ ;
+
+type ::=
+ // ignore encoding in old planner
+ scalar_type:scalaType opt_encoding:encoding
+ {: RESULT = scalaType; :}
+ | KW_ARRAY LESSTHAN type:value_type GREATERTHAN
+ {: RESULT = new ArrayType(value_type); :}
+ | KW_MAP LESSTHAN type:key_type COMMA type:value_type GREATERTHAN
+ {: RESULT = new MapType(key_type,value_type); :}
+ | KW_STRUCT LESSTHAN struct_field_list:fields GREATERTHAN
+ {: RESULT = new StructType(fields); :}
| KW_AGG_STATE LESSTHAN IDENT:fnName LPAREN type_def_nullable_list:list RPAREN GREATERTHAN
{:
RESULT = Expr.createAggStateType(fnName,
list.stream().map(TypeDef::getType).collect(Collectors.toList()),
list.stream().map(TypeDef::getNullable).collect(Collectors.toList()));
:}
- | KW_ALL
- {: RESULT = Type.ALL; :}
- ;
opt_field_length ::=
LPAREN INTEGER_LITERAL:length RPAREN
@@ -8548,6 +8567,8 @@ keyword ::=
| time_unit:id
{: RESULT = id; :}
| KW_ENABLE:id
+ | KW_ENCODING:id
+ {: RESULT = id; :}
{: RESULT = id; :}
| KW_FEATURE:id
{: RESULT = id; :}
diff --git a/fe/fe-core/src/main/jflex/sql_scanner.flex b/fe/fe-core/src/main/jflex/sql_scanner.flex
index 9903675e18d..5a2f5944e34 100644
--- a/fe/fe-core/src/main/jflex/sql_scanner.flex
+++ b/fe/fe-core/src/main/jflex/sql_scanner.flex
@@ -215,6 +215,7 @@ import org.apache.doris.qe.SqlModeHelper;
keywordMap.put("dynamic", new Integer(SqlParserSymbols.KW_DYNAMIC));
keywordMap.put("else", new Integer(SqlParserSymbols.KW_ELSE));
keywordMap.put("enable", new Integer(SqlParserSymbols.KW_ENABLE));
+ keywordMap.put("encoding", new Integer(SqlParserSymbols.KW_ENCODING));
keywordMap.put("encryptkey", new Integer(SqlParserSymbols.KW_ENCRYPTKEY));
keywordMap.put("encryptkeys", new Integer(SqlParserSymbols.KW_ENCRYPTKEYS));
keywordMap.put("end", new Integer(SqlParserSymbols.KW_END));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org