Hello, I’m having a weird query issue, when I try ...
# troubleshooting
e
Hello, I’m having a weird query issue, when I try to query my cluster (via Pinot UI) with:
Copy code
SELECT "tmpId" from datasource_5ffdbf421eb80003001818fe
WHERE "name" = "identify" AND "clientId" = "ef8e0112fbac1450776931712bdaad3bb0deb121"
GROUP BY "tmpId"
LIMIT 1
The query is executed But with:
Copy code
SELECT "tmpId" from datasource_5ffdbf421eb80003001818fe
WHERE "name" = "identify" AND "clientId" = "3f8e0112fbac1450776931712bdaad3bb0deb121" -- 3f8e0112fbac1450776931712bdaad3bb0deb121
GROUP BY "tmpId"
LIMIT 1
I get the following error:
Copy code
[
  {
    "errorCode": 200,
    "message": "QueryExecutionError:\norg.antlr.v4.runtime.misc.ParseCancellationException\n\tat org.antlr.v4.runtime.BailErrorStrategy.recoverInline(BailErrorStrategy.java:66)\n\tat org.antlr.v4.runtime.Parser.match(Parser.java:203)\n\tat org.apache.pinot.pql.parsers.PQL2Parser.expression(PQL2Parser.java:828)\n\tat org.apache.pinot.pql.parsers.PQL2Parser.expression(PQL2Parser.java:745)\n\tat org.apache.pinot.pql.parsers.Pql2Compiler.parseToAstNode(Pql2Compiler.java:148)\n\tat org.apache.pinot.pql.parsers.Pql2Compiler.compileToExpressionTree(Pql2Compiler.java:153)\n\tat org.apache.pinot.common.request.transform.TransformExpressionTree.compileToExpressionTree(TransformExpressionTree.java:46)\n\tat org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleSubquery(BaseBrokerRequestHandler.java:471)\n\tat org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleRequest(BaseBrokerRequestHandler.java:215)\n\tat org.apache.pinot.broker.api.resources.PinotClientRequest.processSqlQueryPost(PinotClientRequest.java:155)\n\tat sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)"
  }
]
I don’t really understand the error and why it’s happening, the only thing that changes between 2 queries is the
clientId
value that starts with
ef
in the first query and starts with
3f
in the 2nd one
m
Any reason you are using PQL instead of SQL?
e
I’m using SQL (via the pinot ui, the HTTP call is
<http://localhost:9000/sql>
)
m
I see, the stack trace suggested otherwise, but that is for transform, not the query. Not sure why this might happen just by changing two characters. Can you try removing the quotes from the literals.
Seems you have a typo in the second query? Check the clientId predicate (it has — character)
e
You’re talking about the comment? I have the same issue without it:
Copy code
SELECT tmpId from datasource_5ffdbf421eb80003001818fe
WHERE name = "identify" AND clientId = "3f8e0112fbac1450776931712bdaad3bb0deb121"
GROUP BY tmpId
LIMIT 1
m
Ah, on the phone so didn’t see the syntax correctly. Seems like a bug, could you file an issue
👍 1
k
are you using pql or sql?
m
SQL, however, from stack trace we see that we internally use PQL for transforms
FWIW, I can compile the query from IDE
k
Copy code
org.apache.pinot.broker.requesthandler.BaseBrokerRequestHandler.handleSubquery(BaseBrokerRequestHandler.java:471)
there is no subquery here
m
Yeah, noticed that too. But the code doesn't have 'if'
k
ok
@Jackie ^^
j
@eywek Can you try single quote instead of double quote? In SQL, double quote is for identifier, you need single quote for literal
v
@Jackie Indeed that works with single quote for the literal value, thanks for the insight
However not sure to get why it get sometimes "correctly" interpreted
j
@vmarchaud IIRC, it is not interpreted correctly, but just not throwing exception.
"name" = "identify"
will be interpreted into
name - identify = 0
, where both
name
and
identify
are treated as identifier (column)
👍 1