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

Queries with functions returning Color type fail #5575

Closed
akshatnair opened this Issue Jul 5, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@akshatnair
Member

akshatnair commented Jul 5, 2016

SQL

presto> select rgb(0,0,0);
Query is gone (server restarted?)

Stack Trace

Query 20160701_183636_00000_9c6sb, RUNNING, 1 node, 0 splits
http://localhost:8080/query.html?20160701_183636_00000_9c6sb
java.lang.RuntimeException: Error fetching next at http://localhost:8080/v1/statement/20160701_183636_00000_9c6sb/52 returned an invalid response: JsonResponse{statusCode=200, statusMessage=OK, headers={Vary=[Accept-Encoding, User-Agent], Content-Length=[899], Date=[Fri, 01 Jul 2016 18:36:38 GMT], X-Content-Type-Options=[nosniff], Content-Type=[application/json]}, hasValue=false, value=null} [Error: {"id":"20160701_183636_00000_9c6sb","infoUri":"http://localhost:8080/query.html?20160701_183636_00000_9c6sb","partialCancelUri":"http://192.168.30.1:8080/v1/stage/20160701_183636_00000_9c6sb.0","nextUri":"http://localhost:8080/v1/statement/20160701_183636_00000_9c6sb/53","columns":[{"name":"_col0","type":"color","typeSignature":{"rawType":"color","typeArguments":[],"literalArguments":[],"arguments":[]}}],"data":[["#ffff00"]],"stats":{"state":"RUNNING","scheduled":true,"nodes":1,"totalSplits":1,"queuedSplits":0,"runningSplits":0,"completedSplits":1,"userTimeMillis":0,"cpuTimeMillis":4,"wallTimeMillis":25,"processedRows":0,"processedBytes":0,"rootStage":{"stageId":"0","state":"RUNNING","done":false,"nodes":1,"totalSplits":1,"queuedSplits":0,"runningSplits":0,"completedSplits":1,"userTimeMillis":0,"cpuTimeMillis":4,"wallTimeMillis":25,"processedRows":1,"processedBytes":0,"subStages":[]}}}
]
    at com.facebook.presto.client.StatementClient.requestFailedException(StatementClient.java:344)
    at com.facebook.presto.client.StatementClient.advance(StatementClient.java:294)
    at com.facebook.presto.cli.StatusPrinter.printInitialStatusUpdates(StatusPrinter.java:121)
    at com.facebook.presto.cli.Query.renderQueryOutput(Query.java:123)
    at com.facebook.presto.cli.Query.renderOutput(Query.java:107)
    at com.facebook.presto.cli.Console.process(Console.java:294)
    at com.facebook.presto.cli.Console.runConsole(Console.java:234)
    at com.facebook.presto.cli.Console.run(Console.java:139)
    at com.facebook.presto.cli.Presto.main(Presto.java:32)
Caused by: java.lang.IllegalArgumentException: Unable to create class com.facebook.presto.client.QueryResults from JSON response:
{"id":"20160701_183636_00000_9c6sb","infoUri":"http://localhost:8080/query.html?20160701_183636_00000_9c6sb","partialCancelUri":"http://192.168.30.1:8080/v1/stage/20160701_183636_00000_9c6sb.0","nextUri":"http://localhost:8080/v1/statement/20160701_183636_00000_9c6sb/53","columns":[{"name":"_col0","type":"color","typeSignature":{"rawType":"color","typeArguments":[],"literalArguments":[],"arguments":[]}}],"data":[["#ffff00"]],"stats":{"state":"RUNNING","scheduled":true,"nodes":1,"totalSplits":1,"queuedSplits":0,"runningSplits":0,"completedSplits":1,"userTimeMillis":0,"cpuTimeMillis":4,"wallTimeMillis":25,"processedRows":0,"processedBytes":0,"rootStage":{"stageId":"0","state":"RUNNING","done":false,"nodes":1,"totalSplits":1,"queuedSplits":0,"runningSplits":0,"completedSplits":1,"userTimeMillis":0,"cpuTimeMillis":4,"wallTimeMillis":25,"processedRows":1,"processedBytes":0,"subStages":[]}}}

    at io.airlift.http.client.FullJsonResponseHandler$JsonResponse.<init>(FullJsonResponseHandler.java:119)
    at io.airlift.http.client.FullJsonResponseHandler.handle(FullJsonResponseHandler.java:66)
    at io.airlift.http.client.FullJsonResponseHandler.handle(FullJsonResponseHandler.java:35)
    at io.airlift.http.client.jetty.JettyHttpClient.execute(JettyHttpClient.java:365)
    at com.facebook.presto.client.StatementClient.advance(StatementClient.java:281)
    ... 7 more
Caused by: java.lang.IllegalArgumentException: Invalid [simple type, class com.facebook.presto.client.QueryResults] json bytes
    at io.airlift.json.JsonCodec.fromJson(JsonCodec.java:174)
    at io.airlift.http.client.FullJsonResponseHandler$JsonResponse.<init>(FullJsonResponseHandler.java:116)
    ... 11 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Instantiation of [simple type, class com.facebook.presto.client.QueryResults] value failed: Illegal base64 character 23
    at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.wrapException(StdValueInstantiator.java:405)
    at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:234)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:167)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:398)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:124)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3066)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2262)
    at io.airlift.json.JsonCodec.fromJson(JsonCodec.java:171)
    ... 12 more
Caused by: java.lang.IllegalArgumentException: Illegal base64 character 23
    at java.util.Base64$Decoder.decode0(Base64.java:714)
    at java.util.Base64$Decoder.decode(Base64.java:526)
    at java.util.Base64$Decoder.decode(Base64.java:549)
    at com.facebook.presto.client.QueryResults.fixValue(QueryResults.java:319)
    at com.facebook.presto.client.QueryResults.fixData(QueryResults.java:220)
    at com.facebook.presto.client.QueryResults.<init>(QueryResults.java:92)
    at sun.reflect.GeneratedConstructorAccessor14.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

@akshatnair akshatnair added the bug label Jul 5, 2016

@akshatnair akshatnair self-assigned this Jul 5, 2016

@akshatnair

This comment has been minimized.

Show comment
Hide comment
@akshatnair

akshatnair Jul 5, 2016

Member

As a short term solution it might be better to print the Color String code like #000000 for Color datatype output.

Member

akshatnair commented Jul 5, 2016

As a short term solution it might be better to print the Color String code like #000000 for Color datatype output.

@electrum

This comment has been minimized.

Show comment
Hide comment
@electrum

electrum Jul 6, 2016

Member

I think we need to update the protocol (and probably the Type API) to return a flag indicating if a value is text or binary. The ObjectId type in the MongoDB connector has the same problem.

Member

electrum commented Jul 6, 2016

I think we need to update the protocol (and probably the Type API) to return a flag indicating if a value is text or binary. The ObjectId type in the MongoDB connector has the same problem.

@cawallin

This comment has been minimized.

Show comment
Hide comment
@cawallin

cawallin Mar 31, 2017

Member

Duplicate of #2210

Member

cawallin commented Mar 31, 2017

Duplicate of #2210

@cawallin cawallin closed this Mar 31, 2017

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