zstan commented on code in PR #2441:
URL: https://github.com/apache/ignite-3/pull/2441#discussion_r1293080122
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutableTableRegistryImpl.java:
##########
@@ -77,6 +83,22 @@ public void onSchemaUpdated() {
tableCache.clear();
}
+ private CompletableFuture<ExecutableTable> loadTable(String tableName,
TableDescriptor tableDescriptor) {
+ return tableManager.tableAsyncInternal(tableName.toUpperCase())
+ .thenApply(table -> {
+ InternalTable internalTable = table.internalTable();
+ SchemaRegistry schemaRegistry =
schemaManager.schemaRegistry(table.tableId());
+ SchemaDescriptor schemaDescriptor =
schemaRegistry.schema();
+ TableRowConverter rowConverter = new
TableRowConverterImpl(schemaRegistry, schemaDescriptor, tableDescriptor);
+ ScannableTable scannableTable = new
ScannableTableImpl(internalTable, rowConverter, tableDescriptor);
+
+ UpdatableTableImpl updatableTable = new
UpdatableTableImpl(table.tableId(), tableDescriptor, internalTable.partitions(),
+ replicaService, clock, rowConverter,
schemaDescriptor);
+
+ return new ExecutableTableImpl(internalTable,
scannableTable, updatableTable);
Review Comment:
why we assembly ExecutableTableImpl from 3 components and further use in ro
and rw methods ?
```
public IgniteRel visit(IgniteTableScan rel) {
...
public IgniteRel visit(IgniteTableModify rel) {
...
resolveTable(igniteTable);
```
looks strange a bit, did it need to be reworked ? I just think that
UpdatableTableImpl is not need for IgniteTableScan, isn`t it ?
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -520,113 +494,6 @@ public MetricManager metricManager() {
return metricManager;
}
- private abstract static class AbstractTableEventListener implements
EventListener<TableEventParameters> {
- protected final SqlSchemaManagerImpl schemaHolder;
-
- private AbstractTableEventListener(SqlSchemaManagerImpl schemaHolder) {
- this.schemaHolder = schemaHolder;
- }
- }
-
- private abstract static class AbstractIndexEventListener implements
EventListener<IndexEventParameters> {
- protected final SqlSchemaManagerImpl schemaHolder;
-
- private AbstractIndexEventListener(SqlSchemaManagerImpl schemaHolder) {
- this.schemaHolder = schemaHolder;
- }
- }
-
- private static class TableCreatedListener extends
AbstractTableEventListener {
- private TableCreatedListener(SqlSchemaManagerImpl schemaHolder) {
- super(schemaHolder);
- }
-
- /** {@inheritDoc} */
- @Override
- public CompletableFuture<Boolean> notify(@NotNull TableEventParameters
parameters, @Nullable Throwable exception) {
- return schemaHolder.onTableCreated(
- // TODO:
https://issues.apache.org/jira/browse/IGNITE-17694 Hardcoded schemas
Review Comment:
I still observe of mentioned issue in test code, do we need to replace it
too ?
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/LogicalRelImplementor.java:
##########
@@ -343,11 +342,11 @@ public Node<RowT> visit(IgniteIndexScan rel) {
if (searchBounds != null) {
Comparator<RowT> searchRowComparator = null;
- if (idx.collations() != null) {
- searchRowComparator =
expressionFactory.comparator(TraitUtils.createCollation(idx.collations()));
+ if (idx.type() != IgniteIndex.Type.SORTED) {
Review Comment:
can`t understand this - we want hash index and build comparator according to
DESC\ASC ordering ? I suppose that ordering is about sorted index, did i miss
smth ?
--
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]