Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLPlugin can declare geo module as compileOnly dependency #4461

Open
penghuo opened this issue Sep 8, 2022 · 1 comment
Open

SQLPlugin can declare geo module as compileOnly dependency #4461

penghuo opened this issue Sep 8, 2022 · 1 comment
Labels
Build Libraries & Interfaces enhancement Enhancement or improvement to existing feature or request Plugins

Comments

@penghuo
Copy link
Contributor

penghuo commented Sep 8, 2022

Is your feature request related to a problem? Please describe.

»  java.lang.NoClassDefFoundError: org/opensearch/geo/search/aggregations/bucket/geogrid/GeoGridAggregationBuilder
»       at org.opensearch.sql.legacy.query.AggregationQueryAction.<init>(AggregationQueryAction.java:47)
»       at org.opensearch.sql.legacy.query.planner.converter.SQLToOperatorConverter.scroll(SQLToOperatorConverter.java:74)
»       at org.opensearch.sql.legacy.query.planner.converter.SQLToOperatorConverter.visit(SQLToOperatorConverter.java:52)
»       at com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.accept0(MySqlSelectQueryBlock.java:255)
»       at com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlSelectQueryBlock.accept0(MySqlSelectQueryBlock.java:246)
»       at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
»       at com.alibaba.druid.sql.ast.SQLObjectImpl.acceptChild(SQLObjectImpl.java:62)
»       at com.alibaba.druid.sql.ast.statement.SQLSelect.accept0(SQLSelect.java:85)
»       at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
»       at com.alibaba.druid.sql.ast.SQLObjectImpl.acceptChild(SQLObjectImpl.java:62)
»       at com.alibaba.druid.sql.ast.expr.SQLQueryExpr.accept0(SQLQueryExpr.java:55)
»       at com.alibaba.druid.sql.ast.SQLObjectImpl.accept(SQLObjectImpl.java:40)
»       at org.opensearch.sql.legacy.query.planner.core.BindingTupleQueryPlanner.<init>(BindingTupleQueryPlanner.java:30)
»       at org.opensearch.sql.legacy.query.OpenSearchActionFactory.create(OpenSearchActionFactory.java:118)
»       at org.opensearch.sql.legacy.plugin.SearchDao.explain(SearchDao.java:52)
»       at org.opensearch.sql.legacy.plugin.RestSqlAction.explainRequest(RestSqlAction.java:208)
»       at org.opensearch.sql.legacy.plugin.RestSqlAction.lambda$prepareRequest$1(RestSqlAction.java:164)
»       at org.opensearch.sql.opensearch.executor.Scheduler.lambda$withCurrentContext$0(Scheduler.java:30)
»       at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:747)
»       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
»       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
»       at java.base/java.lang.Thread.run(Thread.java:832)
»  Caused by: java.lang.ClassNotFoundException: org.opensearch.geo.search.aggregations.bucket.geogrid.GeoGridAggregationBuilder
»       at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
»       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
»       at java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:855)
»       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
»       ... 22 more
  • I think the root cause is plugin and module use different ClassLoader when PluginService loadBundle. Currently only ExtendedPluginClassLoader works, but Plugin [opensearch-sql] cannot extend non-extensible plugin [geo].
  • Currently, SQLPlugin has workaround to declare geo as implementation dependency.

Describe the solution you'd like

Describe alternatives you've considered

  • N/A

Additional context
Add any other context or screenshots about the feature request here.

@saratvemulapalli
Copy link
Member

Thanks @penghuo for the issue. Seems like a classpath doesnt have the modules.
We should fix this to avoid bundling multiple jars in the same distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Libraries & Interfaces enhancement Enhancement or improvement to existing feature or request Plugins
Projects
None yet
Development

No branches or pull requests

3 participants