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

null is string ? #904

Closed
Laboltus opened this issue Jun 2, 2022 · 2 comments
Closed

null is string ? #904

Laboltus opened this issue Jun 2, 2022 · 2 comments

Comments

@Laboltus
Copy link

Laboltus commented Jun 2, 2022

From time to time we get 500 error when use some specific set of measures and time shift. In broker response I see following error:

{
  "error": "Unknown exception",
  "errorMessage": "unsupported type STRING",
  "errorClass": "java.lang.IllegalArgumentException",
  "host": null
}

at the same time I see following error in historical log:

[ERROR] 2022-06-02 11:37:01,299 org.apache.druid.server.QueryResource logException - Unable to send query response. (com.fasterxml.jackson.databind.JsonMappingException: unsupported type STRING (through reference chain: org.apache.druid.query.Result["result"]->org.apache.druid.query.BySegmentResultValueClass["results"]->com.google.common.collect.Lists$TransformingRandomAccessList[0]))
[ERROR] 2022-06-02 11:37:01,299 org.apache.druid.server.QueryLifecycle logException - Exception while processing queryId [4485a8e9-34f8-47db-99f5-5940bf4fce32] (com.fasterxml.jackson.databind.JsonMappingException: unsupported type STRING (through reference chain: org.apache.druid.query.Result["result"]->org.apache.druid.query.BySegmentResultValueClass["results"]->com.google.common.collect.Lists$TransformingRandomAccessList[0]))
[WARN] 2022-06-02 11:37:01,301 org.eclipse.jetty.server.Http

I tried to localize what part of request triggers the error and here it is:

...
   "postAggregations":[
...
      {
         "type":"expression",
         "expression":"(if(\"!T_8\"!=0,(cast(\"!T_0\",'DOUBLE')/\"!T_8\"),null)-if(\"!T_9\"!=0,(cast(\"!T_4\",'DOUBLE')/\"!T_9\"),null))",
         "name":"_delta__media_cost_ecpc"
      },
...

If I replace any or both of 'null' with '0', the query works. Looks like the error appears in case of "expression":"null/null"

@Ans-hrfc
Copy link

Ans-hrfc commented Oct 26, 2024

Hi @Laboltus

i'm running into a similar error. I saw you closed the issue have you been able to find a workaround so that turnilo doesn't use null ?
I'm using v.1.40.2

from what i could see the problem was more about the casting to Double than the null. When i retrieve the cast the query succeed on druid (don't know how to avoid the cast from turnilo)

@Laboltus
Copy link
Author

In our case we found out that the expression's divisor can be null on some intervals. It's not a common situation, so it's just became a known issue in our workflow. I guess the function fallback could be used as a workaround, but we haven't tested it.

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

No branches or pull requests

2 participants