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

Unable to delete data from columns with special character in column #24584

Open
sumi-mathew opened this issue Feb 18, 2025 · 0 comments
Open
Labels

Comments

@sumi-mathew
Copy link
Contributor

sumi-mathew commented Feb 18, 2025

Error is displayed when we try to delete data from columns with special character in column name.

delete from "iceberg"."test_special"."abcd" where "<>col" ='Sample';

Your Environment

Presto Version Used: Latest
Deployment: Cloud, On-prem

Logs:

Query 20250217_162734_00004_8r24q failed: Expected response code from http://192.168.1.4:8080/v1/task/20250217_162734_00004_8r24q.1.0.0.0?summarize to be 200, but was 500: java.lang.IllegalArgumentException: Invalid JSON bytes for [simple type, class com.facebook.presto.sql.planner.PlanFragment] at com.facebook.airlift.json.JsonCodec.fromJson(JsonCodec.java:199) at com.facebook.airlift.json.JsonCodec.fromBytes(JsonCodec.java:230) at java.util.Optional.map(Optional.java:215) at com.facebook.presto.server.TaskResource.createOrUpdateTask(TaskResource.java:141) 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:76) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104) at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268) at org.glassfish.jersey.internal.Errors.process(Errors.java:316) at org.glassfish.jersey.internal.Errors.process(Errors.java:298) at org.glassfish.jersey.internal.Errors.process(Errors.java:268) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1656) at com.facebook.presto.server.AsyncPageTransportForwardFilter.doFilter(AsyncPageTransportForwardFilter.java:55) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) at com.facebook.presto.server.security.AuthenticationFilter.doFilter(AuthenticationFilter.java:92) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) at com.facebook.airlift.http.server.TraceTokenFilter.doFilter(TraceTokenFilter.java:63) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626) at com.facebook.airlift.http.server.TimingFilter.doFilter(TimingFilter.java:51) 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.handle(ScopedHandler.java:143) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:722) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) 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.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.HandlerCollection.handle(HandlerCollection.java:146) at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:181) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59) 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) Caused by: com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of com.facebook.presto.common.Subfield, problem: Invalid subfield path: '‸<>col' at [Source: (byte[])"{"id":"1","root":{"@type":".DeleteNode","sourceLocation":{"line":1,"column":1},"id":"2","source":{"@type":".ProjectNode","sourceLocation":{"line":1,"column":1},"id":"188","source":{"@type":".FilterNode","sourceLocation":{"line":1,"column":1},"id":"376","source":{"@type":".TableScanNode","sourceLocation":{"line":1,"column":1},"id":"0","table":{"connectorId":"iceberg","connectorHandle":{"@type":"iceberg","schemaName":"test_special","icebergTableName":{"tableName":"abcd","tableType":"DATA","snapsho"[truncated 5518 bytes]; line: 1, column: 1509] (through reference chain: com.facebook.presto.sql.planner.PlanFragment["root"]->com.facebook.presto.spi.plan.DeleteNode["source"]->com.facebook.presto.spi.plan.ProjectNode["source"]->com.facebook.presto.spi.plan.FilterNode["source"]->com.facebook.presto.spi.plan.TableScanNode["table"]->com.facebook.presto.spi.TableHandle["connectorTableLayout"]->com.facebook.presto.iceberg.IcebergTableLayoutHandle["domainPredicate"]->com.facebook.presto.common.predicate.TupleDomain["columnDomains"]->java.util.ArrayList[0]->com.facebook.presto.common.predicate.TupleDomain$ColumnDomain["column"]) at com.fasterxml.jackson.databind.exc.ValueInstantiationException.from(ValueInstantiationException.java:47) at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:2058) at

Expected Behavior

Delete data from columns

Current Behavior

Error is displayed when we try to delete data from columns with special character in column name.

Inside the SubfieldTokenizer class, there is a check for special characters that is causing this issue. However, Presto supports these special characters during table creation and in select queries. The error only occurs when special characters are used in the column name within the WHERE condition

 private static boolean isUnquotedPathCharacter(char c)

    {
        return c == ':' || c == '$' || c == '-' || c == '/' || c == '@' || c == '|' || c == '#' || c == ' ' || isUnquotedSubscriptCharacter(c);
    }

Steps to Reproduce

1 create schema iceberg.test_special;
2 CREATE TABLE "iceberg"."test_special"."abcd"("id" int, "<>col" VARCHAR);
3 INSERT INTO "iceberg"."test_special"."abcd" VALUES (1,'Sample');
4 delete from "iceberg"."test_special"."abcd" where "<>col" ='Sample';

@github-project-automation github-project-automation bot moved this to 🆕 Unprioritized in Bugs and support requests Feb 18, 2025
@ZacBlanco ZacBlanco changed the title Unable to delete data from columns with special character in column | Iceberg Unable to delete data from columns with special character in column Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 Unprioritized
Development

No branches or pull requests

1 participant