[ 
https://issues.apache.org/jira/browse/IGNITE-25408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Evgeny Stanilovsky updated IGNITE-25408:
----------------------------------------
    Ignite Flags:   (was: Docs Required,Release Notes Required)

> Catalog API: createTableAsync does not fetch the created table in non-default 
> schema
> ------------------------------------------------------------------------------------
>
>                 Key: IGNITE-25408
>                 URL: https://issues.apache.org/jira/browse/IGNITE-25408
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0
>            Reporter: Tiago Marques Godinho
>            Assignee: Maksim Zhuravkov
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Apparently, the IgniteCatalogSqlImpl#createTableAsync(TableDefinition) method 
> is not handling custom schemas well.
> It seems that it is fetching the newly created table from the table API using 
> only the table name.
> {code:java}
> @Override
> public CompletableFuture<Table> createTableAsync(TableDefinition definition) {
>     return new CreateFromDefinitionImpl(sql)
>             .from(definition)
>             .executeAsync()
>             .thenCompose(tableZoneId -> 
> tables.tableAsync(tableZoneId.tableName()));
> } {code}
> When the table is created in a custom schema, the returned result is null.
> The code below fix the behavior in my use-case.
> {code:java}
> @Override
> public CompletableFuture<Table> createTableAsync(TableDefinition definition) {
>     return new CreateFromDefinitionImpl(sql)
>             .from(definition)
>             .executeAsync()
>             .thenCompose(tableZoneId -> 
> tables.tableAsync(QualifiedName.of(definition.schemaName(), 
> definition.tableName())));
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to