Skip to content

Commit f4dc4cd

Browse files
committed
set catalog description as name if catalog description is null
Signed-off-by: dbulahov <bulahovdenis@gmail.com>
1 parent 9c1fbba commit f4dc4cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

xmla/bridge/src/main/java/org/eclipse/daanse/olap/xmla/bridge/discover/DBSchemaDiscoverService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public List<DbSchemaCatalogsResponseRow> dbSchemaCatalogs(DbSchemaCatalogsReques
7575
}
7676

7777
public DbSchemaCatalogsResponseRow dbSchemaCatalogsRow(Context catalog) {
78-
return new DbSchemaCatalogsResponseRowR(Optional.ofNullable(catalog.getName()), catalog.getDescription(),
78+
return new DbSchemaCatalogsResponseRowR(Optional.ofNullable(catalog.getName()),
79+
Optional.of((String)catalog.getDescription().orElse("")),
7980
getRoles(catalog.getAccessRoles()), Optional.of(LocalDateTime.now()), Optional.empty(),
8081
Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(),
8182
Optional.empty(), Optional.empty(), Optional.empty());

xmla/bridge/src/main/java/org/eclipse/daanse/olap/xmla/bridge/execute/OlapExecuteService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ public StatementResponse statement(StatementRequest statementRequest, RequestMet
256256
}
257257

258258
Optional<String> oCatalog = statementRequest.properties().catalog();
259-
259+
if (!oCatalog.isPresent() && contextsListSupplyer.getContexts() != null && contextsListSupplyer.getContexts().size() == 1) {
260+
oCatalog = Optional.ofNullable(contextsListSupplyer.getContexts().get(0).getName());
261+
}
260262
if (oCatalog.isPresent()) {
261263
String catalogName = oCatalog.get();
262264
Optional<Context<?>> oContext = contextsListSupplyer.getContexts().stream()

0 commit comments

Comments
 (0)