This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new fded8ba8247 [improvement](insert) Modify insert into table_id(xxx) to
doris_inter… (#25662)
fded8ba8247 is described below
commit fded8ba824715d6cfb96577157338f3d58866240
Author: meiyi <[email protected]>
AuthorDate: Fri Oct 20 19:31:37 2023 +0800
[improvement](insert) Modify insert into table_id(xxx) to doris_inter…
(#25662)
---
be/src/olap/wal_table.cpp | 5 ++---
be/src/runtime/group_commit_mgr.cpp | 2 +-
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4 | 1 +
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 | 1 +
fe/fe-core/src/main/cup/sql_parser.cup | 4 ++--
fe/fe-core/src/main/jflex/sql_scanner.flex | 2 +-
6 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/be/src/olap/wal_table.cpp b/be/src/olap/wal_table.cpp
index 40b48ad7736..fd21fafef0e 100644
--- a/be/src/olap/wal_table.cpp
+++ b/be/src/olap/wal_table.cpp
@@ -188,9 +188,8 @@ Status WalTable::send_request(int64_t wal_id, const
std::string& wal, const std:
evhttp_add_header(req->output_headers, HTTP_AUTH_CODE.c_str(),
std::to_string(wal_id).c_str());
evhttp_add_header(req->output_headers, HTTP_WAL_ID_KY.c_str(),
std::to_string(wal_id).c_str());
std::stringstream ss;
- ss << "insert into " << std::to_string(_table_id) << " WITH LABEL " <<
label
- << " select * from "
- "http_stream(\"format\" = \"wal\", \"table_id\" = \""
+ ss << "insert into doris_internal_table_id(" << _table_id << ") WITH LABEL
" << label
+ << " select * from http_stream(\"format\" = \"wal\", \"table_id\" = \""
<< std::to_string(_table_id) << "\")";
evhttp_add_header(req->output_headers, HTTP_SQL.c_str(), ss.str().c_str());
evbuffer* output = evhttp_request_get_output_buffer(req);
diff --git a/be/src/runtime/group_commit_mgr.cpp
b/be/src/runtime/group_commit_mgr.cpp
index 3c919158874..be49cca5258 100644
--- a/be/src/runtime/group_commit_mgr.cpp
+++ b/be/src/runtime/group_commit_mgr.cpp
@@ -200,7 +200,7 @@ Status GroupCommitTable::_create_group_commit_load(
std::regex reg("-");
std::string label = "group_commit_" +
std::regex_replace(load_id.to_string(), reg, "_");
std::stringstream ss;
- ss << "insert into table_id(" << _table_id << ") WITH LABEL " << label
+ ss << "insert into doris_internal_table_id(" << _table_id << ") WITH LABEL
" << label
<< " select * from group_commit(\"table_id\"=\"" << _table_id << "\")";
request.__set_load_sql(ss.str());
request.__set_loadId(tload_id);
diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
index 90e52ee7e0d..010ae43dc3c 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisLexer.g4
@@ -208,6 +208,7 @@ DISTRIBUTED: 'DISTRIBUTED';
DISTRIBUTION: 'DISTRIBUTION';
DIV: 'DIV';
DO: 'DO';
+DORIS_INTERNAL_TABLE_ID: 'DORIS_INTERNAL_TABLE_ID';
DOUBLE: 'DOUBLE';
DROP: 'DROP';
DROPP: 'DROPP';
diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
index b67e803be89..065117d3b0b 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
@@ -884,6 +884,7 @@ nonReserved
| DISTINCTPC
| DISTINCTPCSA
| DO
+ | DORIS_INTERNAL_TABLE_ID
| DYNAMIC
| ENABLE
| ENCRYPTKEY
diff --git a/fe/fe-core/src/main/cup/sql_parser.cup
b/fe/fe-core/src/main/cup/sql_parser.cup
index e0b4ab9bfe4..930bbbbd97f 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -347,6 +347,7 @@ terminal String
KW_DISTRIBUTION,
KW_DIV,
KW_DO,
+ KW_DORIS_INTERNAL_TABLE_ID,
KW_DOUBLE,
KW_DROP,
KW_DROPP,
@@ -595,7 +596,6 @@ terminal String
KW_SYNC,
KW_SYSTEM,
KW_TABLE,
- KW_TABLE_ID,
KW_TABLES,
KW_TABLESAMPLE,
KW_TABLET,
@@ -4842,7 +4842,7 @@ insert_stmt ::=
// TODO(zc) add default value for SQL-2003
// | KW_INSERT KW_INTO insert_target:target KW_DEFAULT KW_VALUES
| /* used for group commit */
- KW_INSERT KW_INTO KW_TABLE_ID LPAREN INTEGER_LITERAL:table_id RPAREN
opt_with_label:label opt_col_list:cols opt_plan_hints:hints insert_source:source
+ KW_INSERT KW_INTO KW_DORIS_INTERNAL_TABLE_ID LPAREN
INTEGER_LITERAL:table_id RPAREN opt_with_label:label opt_col_list:cols
opt_plan_hints:hints insert_source:source
{:
RESULT = new NativeInsertStmt(table_id, label, cols, source, hints);
:}
diff --git a/fe/fe-core/src/main/jflex/sql_scanner.flex
b/fe/fe-core/src/main/jflex/sql_scanner.flex
index d4423f7d4c8..c360d63701d 100644
--- a/fe/fe-core/src/main/jflex/sql_scanner.flex
+++ b/fe/fe-core/src/main/jflex/sql_scanner.flex
@@ -197,6 +197,7 @@ import org.apache.doris.qe.SqlModeHelper;
keywordMap.put("distribution", new
Integer(SqlParserSymbols.KW_DISTRIBUTION));
keywordMap.put("div", new Integer(SqlParserSymbols.KW_DIV));
keywordMap.put("do", new Integer(SqlParserSymbols.KW_DO));
+ keywordMap.put("doris_internal_table_id", new
Integer(SqlParserSymbols.KW_DORIS_INTERNAL_TABLE_ID));
keywordMap.put("double", new Integer(SqlParserSymbols.KW_DOUBLE));
keywordMap.put("drop", new Integer(SqlParserSymbols.KW_DROP));
keywordMap.put("dropp", new Integer(SqlParserSymbols.KW_DROPP));
@@ -448,7 +449,6 @@ import org.apache.doris.qe.SqlModeHelper;
keywordMap.put("sync", new Integer(SqlParserSymbols.KW_SYNC));
keywordMap.put("system", new Integer(SqlParserSymbols.KW_SYSTEM));
keywordMap.put("table", new Integer(SqlParserSymbols.KW_TABLE));
- keywordMap.put("table_id", new Integer(SqlParserSymbols.KW_TABLE_ID));
keywordMap.put("tables", new Integer(SqlParserSymbols.KW_TABLES));
keywordMap.put("tablesample", new
Integer(SqlParserSymbols.KW_TABLESAMPLE));
keywordMap.put("tablet", new Integer(SqlParserSymbols.KW_TABLET));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]