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

Elasticsearch storage plugin error on connect to elastic cloud #2975

Open
dceldran opened this issue Jan 21, 2025 · 5 comments
Open

Elasticsearch storage plugin error on connect to elastic cloud #2975

dceldran opened this issue Jan 21, 2025 · 5 comments

Comments

@dceldran
Copy link

dceldran commented Jan 21, 2025

Describe the bug
I have an elastic search cluster inside elastic official cloud and i can't connect to the cluster. When i try to do a show schemas for example, i receive the error:

ERROR o.a.calcite.jdbc.DynamicRootSchema - Failed to load schema for elastic_prod

java.lang.ClassCastException: null

I've launch a elastic single node in my local environment with docker and this elastic single node works perfectly.

To Reproduce

  1. Create a elastic cluster inside elastic.cl
  2. Add this cluster inside apache drill
  3. Try to do a query, for example show schemas;

Expected behavior
It should do the expected query.

Error detail, log output or screenshots

ERROR o.a.calcite.jdbc.DynamicRootSchema - Failed to load schema for elastic_prod

java.lang.ClassCastException: null

Drill version
1.21.2
Additional context
Add any other context about the problem here.

@dceldran dceldran added the bug label Jan 21, 2025
@cgivre
Copy link
Contributor

cgivre commented Jan 21, 2025

Can you please share your Drill config?

@dceldran
Copy link
Author

Do you refer the elastic storage plugin config?

{
  "type": "elastic",
  "hosts": [
    "https://my-elastic-cluster-from-elastic-cloud.com"
  ],
  "authMode": "SHARED_USER",
  "disableSSLVerification": false,
  "credentialsProvider": {
    "credentialsProviderType": "PlainCredentialsProvider",
    "credentials": {
      "username": "myelasticuser",
      "password": "myelasticpassword"
    },
    "userCredentials": {}
  },
  "enabled": true
}

If you refer to the apache drill config, i'm using the default one, i'm new with apache drill and i mounted it with docker in my local environment without changing anything.

Thanks!

@dceldran
Copy link
Author

In logs the extended error is:

apache drill> 15:36:44.421 [qtp975982615-45] ERROR o.a.calcite.jdbc.DynamicRootSchema - Failed to load schema for elastic_prod
java.lang.ClassCastException: com.fasterxml.jackson.databind.node.BooleanNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchJson.visitMappingProperties(ElasticsearchJson.java:131)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchJson.visitMappingProperties(ElasticsearchJson.java:101)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchTransport.fetchAndCreateMapping(ElasticsearchTransport.java:128)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchTransport.<init>(ElasticsearchTransport.java:94)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchSchema.createTables(ElasticsearchSchema.java:97)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchSchema.<init>(ElasticsearchSchema.java:81)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchSchema.<init>(ElasticsearchSchema.java:66)
	at org.apache.calcite.adapter.elasticsearch.ElasticsearchSchemaFactory.create(ElasticsearchSchemaFactory.java:140)
	at org.apache.drill.exec.store.elasticsearch.schema.ElasticsearchDrillSchemaFactory.registerSchemas(ElasticsearchDrillSchemaFactory.java:49)
	at org.apache.drill.exec.store.elasticsearch.ElasticsearchStoragePlugin.registerSchemas(ElasticsearchStoragePlugin.java:67)
	at org.apache.calcite.jdbc.DynamicRootSchema.registerSchemasWithRetry(DynamicRootSchema.java:112)
	at org.apache.calcite.jdbc.DynamicRootSchema.loadSchemaFactory(DynamicRootSchema.java:156)
	at org.apache.calcite.jdbc.DynamicRootSchema.getSchema(DynamicRootSchema.java:88)
	at org.apache.calcite.jdbc.DynamicRootSchema.getImplicitSubSchema(DynamicRootSchema.java:74)
	at org.apache.calcite.jdbc.CalciteSchema.getSubSchema(CalciteSchema.java:271)
	at org.apache.calcite.jdbc.CalciteSchema$SchemaPlusImpl.getSubSchema(CalciteSchema.java:690)
	at org.apache.drill.exec.planner.sql.SchemaUtilities.searchSchemaTree(SchemaUtilities.java:101)
	at org.apache.drill.exec.planner.sql.SchemaUtilities.findSchema(SchemaUtilities.java:53)
	at org.apache.drill.exec.rpc.user.UserSession.setDefaultSchemaPath(UserSession.java:225)
	at org.apache.drill.exec.server.rest.BaseQueryRunner.applyDefaultSchema(BaseQueryRunner.java:111)
	at org.apache.drill.exec.server.rest.RestQueryRunner.run(RestQueryRunner.java:52)
	at org.apache.drill.exec.server.rest.QueryResources.submitQuery(QueryResources.java:161)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:256)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:235)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:311)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656)
	at org.apache.drill.exec.server.rest.header.ResponseHeadersSettingFilter.doFilter(ResponseHeadersSettingFilter.java:71)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at org.apache.drill.exec.server.rest.CsrfTokenValidateFilter.doFilter(CsrfTokenValidateFilter.java:55)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at org.apache.drill.exec.server.rest.CsrfTokenInjectFilter.doFilter(CsrfTokenInjectFilter.java:54)
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.lang.Thread.run(Thread.java:750)

Thanks!

@dceldran
Copy link
Author

Hi,

I think that the upgrade of calcite solves the problem. I can see that apache drill 1.21.2 it's using calcite 1.34.0. I'm doing some tests overriding the 1.34.0 calcite with 1.38.0 and if i only upgrade calcite-elasticsearch-1.38.0.jar i can do a show schemas; query without any problem but i still can't do any select from an elastic index. I also try to upgrade the 4 calcite jars inside 3rd party folder but i've receive another error. So i understand that apache drill 1.21.2 it's not ready to work with calcite 1.38.0 right?

It's any way to upgrade calcite 1.34.0 without breaking apache drill?

Thanks!

@cgivre
Copy link
Contributor

cgivre commented Jan 22, 2025

@dceldran I started working on that but I ran into some issues. You can try my branch here: #2961

With that said, the upgrade broke something in how Drill handles VARDECIMAL conversion and I haven't been able to resolve that. Any advice would be greatly appreciated. @vvysotskyi @jnturton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants