IMPALA-14464: Calcite planner should allow semi-colon in statement

The Calcite planner now handles a sql statement that has a semi-colon
at the end. Note that impala-shell doesn't pass the semi-colon into
the server. This is only seen with a direct call to the server.

Change-Id: Ie690159cd03f28f6b793628aa946292af71b6970
Reviewed-on: http://gerrit.cloudera.org:8080/23517
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Steve Carlin
2025-09-25 12:10:55 -07:00
parent f0a781806f
commit 69813a8c40
2 changed files with 8 additions and 2 deletions

View File

@@ -1138,9 +1138,9 @@ SqlNode SqlStmt() :
} }
{ {
( (
stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY) stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY) (<SEMICOLON>)*
| |
stmt = SqlExplain() stmt = SqlExplain() (<SEMICOLON>)*
) )
{ {
return stmt; return stmt;

View File

@@ -41,3 +41,9 @@ class TestCalcitePlanner(CustomClusterTestSuite):
def test_calcite_frontend(self, vector, unique_database): def test_calcite_frontend(self, vector, unique_database):
"""Calcite planner does not work in local catalog mode yet.""" """Calcite planner does not work in local catalog mode yet."""
self.run_test_case('QueryTest/calcite', vector, use_db=unique_database) self.run_test_case('QueryTest/calcite', vector, use_db=unique_database)
@pytest.mark.execute_serially
@CustomClusterTestSuite.with_args(start_args="--env_vars=USE_CALCITE_PLANNER=true")
def test_semicolon(self, cursor):
cursor.execute("set use_calcite_planner=true;")
cursor.execute("select 4;")