mirror of https://github.com/apache/druid.git
Fix error messages relating to OVERWRITE keyword (#14870)
OVERWRITE should not be a fully reserved keyword
This commit is contained in:
parent
bd505062de
commit
14c1aff150
|
@ -329,7 +329,8 @@ public class MSQReplaceTest extends MSQTestBase
|
|||
.setExpectedDataSource("foo1")
|
||||
.setQueryContext(context)
|
||||
.setExpectedValidationErrorMatcher(invalidSqlContains(
|
||||
"Incorrect syntax near the keyword 'OVERWRITE'"
|
||||
"Missing time chunk information in OVERWRITE clause for REPLACE. "
|
||||
+ "Use OVERWRITE WHERE <__time based condition> or OVERWRITE ALL to overwrite the entire table."
|
||||
))
|
||||
.verifyPlanningErrors();
|
||||
}
|
||||
|
|
|
@ -67,6 +67,10 @@ data: {
|
|||
"PARTITIONED"
|
||||
]
|
||||
|
||||
nonReservedKeywordsToAdd: [
|
||||
"OVERWRITE"
|
||||
]
|
||||
|
||||
# List of methods for parsing custom SQL statements.
|
||||
# Return type of method implementation should be 'SqlNode'.
|
||||
# Example: SqlShowDatabases(), SqlShowTables().
|
||||
|
|
|
@ -43,7 +43,10 @@ SqlNode DruidSqlReplaceEof() :
|
|||
}
|
||||
]
|
||||
[
|
||||
<OVERWRITE> replaceTimeQuery = ReplaceTimeQuery()
|
||||
<OVERWRITE>
|
||||
[
|
||||
replaceTimeQuery = ReplaceTimeQuery()
|
||||
]
|
||||
]
|
||||
source = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY)
|
||||
// PARTITIONED BY is necessary, but is kept optional in the grammar. It is asserted that it is not missing in the
|
||||
|
|
|
@ -440,8 +440,9 @@ public class CalciteReplaceDmlTest extends CalciteIngestionDmlTest
|
|||
{
|
||||
testIngestionQuery()
|
||||
.sql("REPLACE INTO dst OVERWRITE SELECT * FROM foo PARTITIONED BY ALL TIME")
|
||||
.expectValidationError(invalidSqlContains(
|
||||
"Incorrect syntax near the keyword 'OVERWRITE' at line 1, column 18."
|
||||
.expectValidationError(invalidSqlIs(
|
||||
"Missing time chunk information in OVERWRITE clause for REPLACE. "
|
||||
+ "Use OVERWRITE WHERE <__time based condition> or OVERWRITE ALL to overwrite the entire table."
|
||||
))
|
||||
.verify();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue