xtern commented on code in PR #1917:
URL: https://github.com/apache/ignite-3/pull/1917#discussion_r1162538282
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##########
@@ -169,6 +169,10 @@ protected SqlSelect createSourceSelectForUpdate(SqlUpdate
call) {
final SqlIdentifier targetTable = (SqlIdentifier)
call.getTargetTable();
final SqlValidatorTable table =
getCatalogReader().getTable(targetTable.names);
+ if (table == null) {
+ throw newValidationError(call.getTargetTable(),
RESOURCE.objectNotFound(targetTable.toString()));
Review Comment:
> more clear to use : RESOURCE.tableNotFound
Thanks, but I'm not sure about it.
First, as you mentioned it's not a validator exception.
We can use `RESOURCE.tableNameNotFound` instead, but still not sure about
such a change in this task.
Because we will have inconsistent behavior for MERGE queries for example:
```
MERGE INTO non_existing_table USING existing_table
```
will produce `Table 'NON_EXISTING_TABLE' not found`, but
```
MERGE INTO existing_table USING non_existing_table
```
will produce `Object 'NON_EXISTING_TABLE' not found`
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##########
@@ -169,6 +169,10 @@ protected SqlSelect createSourceSelectForUpdate(SqlUpdate
call) {
final SqlIdentifier targetTable = (SqlIdentifier)
call.getTargetTable();
final SqlValidatorTable table =
getCatalogReader().getTable(targetTable.names);
+ if (table == null) {
+ throw newValidationError(call.getTargetTable(),
RESOURCE.objectNotFound(targetTable.toString()));
Review Comment:
> probably we need to mention some already defined issue here
Thanks, added TODO https://issues.apache.org/jira/browse/IGNITE-14865
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]