IGNITE-7714: SQL COPY command: fixed "Table not found" issue on the client node.
authordevozerov <vozerov@gridgain.com>
Thu, 15 Feb 2018 11:00:42 +0000 (14:00 +0300)
committerdevozerov <vozerov@gridgain.com>
Thu, 15 Feb 2018 11:00:42 +0000 (14:00 +0300)
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/DmlStatementsProcessor.java

index c46c906..224bae0 100644 (file)
@@ -1016,9 +1016,16 @@ public class DmlStatementsProcessor {
 
         GridH2Table tbl = idx.dataTable(cmd.schemaName(), cmd.tableName());
 
-        if (tbl == null)
+        if (tbl == null) {
+            idx.kernalContext().cache().createMissingQueryCaches();
+
+            tbl = idx.dataTable(cmd.schemaName(), cmd.tableName());
+        }
+
+        if (tbl == null) {
             throw new IgniteSQLException("Table does not exist: " + cmd.tableName(),
                 IgniteQueryErrorCode.TABLE_NOT_FOUND);
+        }
 
         UpdatePlan plan = UpdatePlanBuilder.planForBulkLoad(cmd, tbl);