Skip to content

Commit 8bc96c5

Browse files
committed
set catalog description as name if catalog description is null
Signed-off-by: dbulahov <[email protected]>
1 parent 9c1fbba commit 8bc96c5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static RowSetR dbSchemaCatalogsResponseRowToRowSet(List<DbSchemaCatalogsR
182182
r.catalogName().ifPresent(
183183
v -> rowSetRowItem.add(new RowSetRowItemR(CATALOG_NAME, v, Optional.of(ItemTypeEnum.STRING))));
184184
r.description().ifPresent(
185-
v -> rowSetRowItem.add(new RowSetRowItemR(DESCRIPTION, v, Optional.of(ItemTypeEnum.STRING))));
185+
v -> rowSetRowItem.add(new RowSetRowItemR(DESCRIPTION, v != null ? "" : v, Optional.of(ItemTypeEnum.STRING))));
186186
r.roles().ifPresent(
187187
v -> rowSetRowItem.add(new RowSetRowItemR("ROLES", v, Optional.of(ItemTypeEnum.STRING))));
188188
r.dateModified().ifPresent(v -> rowSetRowItem.add(

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)