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


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestBuilders.java:
##########
@@ -696,6 +696,8 @@ public TestCluster build() {
             Supplier<TableStatsStalenessConfiguration> statStalenessProperties 
= () -> new TableStatsStalenessConfiguration(
                     DEFAULT_STALE_ROWS_FRACTION, DEFAULT_MIN_STALE_ROWS_COUNT);
 
+            AbstractEventProducer<StatisticChangedEvent, 
StatisticEventParameters> producer = new AbstractEventProducer<>() {};

Review Comment:
   why do we need this?



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -293,9 +294,11 @@ public synchronized CompletableFuture<Void> 
startAsync(ComponentContext componen
         var storageProfileValidator = new 
ClusterWideStorageProfileValidator(logicalTopologyService);
         var nodeFilterValidator = new 
ClusterWideNodeFilterValidator(logicalTopologyService);
 
+        CreateTableDefaultsView tablePropertiesView = 
clusterCfg.createTable().value();

Review Comment:
   now configuration is cached once during component start, update won't be 
visible. We move this _inside_ supplier's body



##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/prepare/ddl/DdlSqlToCommandConverterTest.java:
##########
@@ -870,6 +870,28 @@ public void 
testAlterColumnSetDefaultRejectUnsupportedDefault(String defaultExpr
                 () -> convert((SqlDdl) node, createContext()));
     }
 
+    @Test
+    void createTableWithNonDefaultStalenessConfig() throws SqlParseException {
+        long staleRowsCount = DEFAULT_MIN_STALE_ROWS_COUNT / 2;
+        double staleRowsFraction = DEFAULT_STALE_ROWS_FRACTION / 2;
+
+        assert staleRowsCount != 0 && staleRowsFraction != 0.0d;
+
+        Supplier<TableStatsStalenessConfiguration> statStalenessProperties =
+                () -> new TableStatsStalenessConfiguration(staleRowsFraction, 
staleRowsCount);
+        converter = new DdlSqlToCommandConverter(storageProfiles -> 
completedFuture(null), filter -> completedFuture(null),
+                statStalenessProperties);
+
+        CatalogCommand cmd = convert("CREATE TABLE t (id INT PRIMARY KEY, val 
INT)");
+
+        mockCatalogSchemaAndZone("TEST_ZONE");
+
+        NewTableEntry newTable = invokeAndGetFirstEntry(cmd, 
NewTableEntry.class);
+
+        assertThat(newTable.descriptor().properties().minStaleRowsCount(), 
is(staleRowsCount));
+        assertThat(newTable.descriptor().properties().staleRowsFraction(), 
is(staleRowsFraction));

Review Comment:
   let's also change values somehow and verify this chance is reflected in next 
table



-- 
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]

Reply via email to