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")
|
.setExpectedDataSource("foo1")
|
||||||
.setQueryContext(context)
|
.setQueryContext(context)
|
||||||
.setExpectedValidationErrorMatcher(invalidSqlContains(
|
.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();
|
.verifyPlanningErrors();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,10 @@ data: {
|
||||||
"PARTITIONED"
|
"PARTITIONED"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
nonReservedKeywordsToAdd: [
|
||||||
|
"OVERWRITE"
|
||||||
|
]
|
||||||
|
|
||||||
# List of methods for parsing custom SQL statements.
|
# List of methods for parsing custom SQL statements.
|
||||||
# Return type of method implementation should be 'SqlNode'.
|
# Return type of method implementation should be 'SqlNode'.
|
||||||
# Example: SqlShowDatabases(), SqlShowTables().
|
# Example: SqlShowDatabases(), SqlShowTables().
|
||||||
|
|
|
@ -43,7 +43,10 @@ SqlNode DruidSqlReplaceEof() :
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
<OVERWRITE> replaceTimeQuery = ReplaceTimeQuery()
|
<OVERWRITE>
|
||||||
|
[
|
||||||
|
replaceTimeQuery = ReplaceTimeQuery()
|
||||||
|
]
|
||||||
]
|
]
|
||||||
source = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY)
|
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
|
// 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()
|
testIngestionQuery()
|
||||||
.sql("REPLACE INTO dst OVERWRITE SELECT * FROM foo PARTITIONED BY ALL TIME")
|
.sql("REPLACE INTO dst OVERWRITE SELECT * FROM foo PARTITIONED BY ALL TIME")
|
||||||
.expectValidationError(invalidSqlContains(
|
.expectValidationError(invalidSqlIs(
|
||||||
"Incorrect syntax near the keyword 'OVERWRITE' at line 1, column 18."
|
"Missing time chunk information in OVERWRITE clause for REPLACE. "
|
||||||
|
+ "Use OVERWRITE WHERE <__time based condition> or OVERWRITE ALL to overwrite the entire table."
|
||||||
))
|
))
|
||||||
.verify();
|
.verify();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue