You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "korlov42 (via GitHub)" <gi...@apache.org> on 2023/04/10 07:50:30 UTC

[GitHub] [ignite-3] korlov42 commented on a diff in pull request #1917: IGNITE-19116 Sql. Fixed UPDATE statement fails with NPE when table doesn't exist.

korlov42 commented on code in PR #1917:
URL: https://github.com/apache/ignite-3/pull/1917#discussion_r1161517225


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlValidator.java:
##########
@@ -210,10 +212,12 @@ protected SqlSelect createSourceSelectForDelete(SqlDelete call) {
         final SqlNodeList selectList = new SqlNodeList(SqlParserPos.ZERO);
         final SqlValidatorTable table = getCatalogReader().getTable(((SqlIdentifier) call.getTargetTable()).names);
 
-        table.unwrap(IgniteTable.class).descriptor().deleteRowType((IgniteTypeFactory) typeFactory)
-                .getFieldNames().stream()
-                .map(name -> new SqlIdentifier(name, SqlParserPos.ZERO))
-                .forEach(selectList::add);
+        if (table != null) {

Review Comment:
   it's unclear why the table may be null at this point. Besides, you're returning incorrect result here



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org