From 26fc9973869c5f28a90f28ac5a5db4da6ccff0e5 Mon Sep 17 00:00:00 2001 From: Peng Huo Date: Fri, 28 Oct 2022 09:44:24 -0700 Subject: [PATCH] update Signed-off-by: Peng Huo --- .../java/org/opensearch/sql/ppl/StandaloneIT.java | 14 ++++++++++---- .../sql/plugin/config/OpenSearchPluginConfig.java | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/ppl/StandaloneIT.java b/integ-test/src/test/java/org/opensearch/sql/ppl/StandaloneIT.java index bad86a011a..bcd0c0ffb8 100644 --- a/integ-test/src/test/java/org/opensearch/sql/ppl/StandaloneIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/ppl/StandaloneIT.java @@ -182,10 +182,16 @@ QueryManager queryManager() { @Bean @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) QueryPlanFactory queryExecutionFactory(BuiltinFunctionRepository functionRepository) { - catalogService.getCatalogs() - .forEach(catalog -> catalogService.getStorageEngine(catalog) - .getFunctions() - .forEach(functionResolver -> functionRepository.register(catalog, functionResolver))); + catalogService + .getCatalogs() + .forEach( + catalog -> + catalog + .getStorageEngine() + .getFunctions() + .forEach( + functionResolver -> + functionRepository.register(catalog.getName(), functionResolver))); Analyzer analyzer = new Analyzer(new ExpressionAnalyzer(functionRepository), catalogService, functionRepository); Planner planner = diff --git a/plugin/src/main/java/org/opensearch/sql/plugin/config/OpenSearchPluginConfig.java b/plugin/src/main/java/org/opensearch/sql/plugin/config/OpenSearchPluginConfig.java index a98ede628a..596296522c 100644 --- a/plugin/src/main/java/org/opensearch/sql/plugin/config/OpenSearchPluginConfig.java +++ b/plugin/src/main/java/org/opensearch/sql/plugin/config/OpenSearchPluginConfig.java @@ -102,10 +102,16 @@ public QueryManager queryManager() { @Bean @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) public QueryPlanFactory queryExecutionFactory(BuiltinFunctionRepository functionRepository) { - catalogService.getCatalogs() - .forEach(catalog -> catalogService.getStorageEngine(catalog) - .getFunctions() - .forEach(functionResolver -> functionRepository.register(catalog, functionResolver))); + catalogService + .getCatalogs() + .forEach( + catalog -> + catalog + .getStorageEngine() + .getFunctions() + .forEach( + functionResolver -> + functionRepository.register(catalog.getName(), functionResolver))); Analyzer analyzer = new Analyzer(new ExpressionAnalyzer(functionRepository), catalogService, functionRepository); Planner planner =