vrajat opened a new pull request, #13846:
URL: https://github.com/apache/pinot/pull/13846

   JDBC clients parse queries to extract tables and choose the right broker. 
However the clients do not handle queries with no FROM clause. The clients work 
because of two catch-all blocks.
   
   Fix the code to handle queries with no FROM clause.
   
   Example:
   
   ```
   2024-08-19 18:50:31,096             [main] ERROR 
org.apache.pinot.client.Connection - Cannot parse table name from query: SET 
useMultistageEngine=true;
   select '3' as "one",
     case
       when 1 < 2 then 3
     end as "simple when" LIMIT 1000000. Fallback to broker selector default.
   java.lang.NullPointerException: Cannot invoke 
"org.apache.pinot.common.request.DataSource.getSubquery()" because "dataSource" 
is null
        at 
org.apache.pinot.common.utils.request.RequestUtils.getTableNames(RequestUtils.java:535)
 
~[pinot-common-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT-186115880ee7ec9aedaf1925f707b5836bafc6fd]
        at 
org.apache.pinot.common.utils.request.RequestUtils.getTableNames(RequestUtils.java:545)
 
~[pinot-common-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT-186115880ee7ec9aedaf1925f707b5836bafc6fd]
        at 
org.apache.pinot.client.Connection.resolveTableName(Connection.java:146) 
~[pinot-java-client-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT-186115880ee7ec9aedaf1925f707b5836bafc6fd]
        at org.apache.pinot.client.Connection.execute(Connection.java:96) 
~[pinot-java-client-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT-186115880ee7ec9aedaf1925f707b5836bafc6fd]
        at org.apache.pinot.client.Connection.execute(Connection.java:83) 
~[pinot-java-client-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT-186115880ee7ec9aedaf1925f707b5836bafc6fd]
        at 
org.apache.pinot.client.PinotStatement.executeQuery(PinotStatement.java:67) 
~[pinot-jdbc-client-1.3.0-SNAPSHOT.jar:1.3.0-SNAPSHOT-186115880ee7ec9aedaf1925f707b5836bafc6fd]
        at 
com.startree.repository.PinotRepository.executeSelectQuery(PinotRepository.java:86)
 ~[classes/:?]
   ```
   tag: bugfix
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to