You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "zhuangdaz (via GitHub)" <gi...@apache.org> on 2023/06/09 16:36:47 UTC

[GitHub] [pinot] zhuangdaz opened a new issue, #10879: execute() should return true and non-null _resultSet when there is no match

zhuangdaz opened a new issue, #10879:
URL: https://github.com/apache/pinot/issues/10879

   Hi team, I am using [jooq](https://www.jooq.org/) for querying Pinot but running into an exception when there is no match. 
   ```
   Caused by: java.sql.SQLException: Unknown column index : 2
   ```
   
   I think the root cause is b/c:
   
   1. [PinotStatement](https://github.com/apache/pinot/blob/master/pinot-clients/pinot-jdbc-client/src/main/java/org/apache/pinot/client/PinotStatement.java#L87-L88) returns a null when there is empty-row(no match) result;
   2. Then [Jooq](https://github.com/jOOQ/jOOQ/blob/main/jOOQ/src/main/java/org/jooq/impl/AbstractResultQuery.java#L253-L259) tries to insert an updateCount row which is not able to be parsed with the original cols
   
   I wonder if this has any existing solution or we should update `PinotStatement.execute()`(and `PinotPreparedStatement.execute()`) to return a non-null ResultSet with 0 row instead(this looks the correct fix since an empty-row ResultSet should still be valid based on the discussion [here](https://github.com/jOOQ/jOOQ/issues/6907#:~:text=So%20yes.%20I%20come%20from%20SQL%20and%20JDBC%2C%20and%20null%20meaning%20no%20result%2C%20not%20empty%20result%2C%20is%20the%20only%20reasonable%20interpretation%20here.)).


-- 
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-unsubscribe@pinot.apache.org.apache.org

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


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


[GitHub] [pinot] lukaseder commented on issue #10879: execute() should return true and non-null _resultSet when there is no match

Posted by "lukaseder (via GitHub)" <gi...@apache.org>.
lukaseder commented on issue #10879:
URL: https://github.com/apache/pinot/issues/10879#issuecomment-1589205560

   Folks, I was pointed here from twitter. Maybe, this blog post helps with the delicate JDBC statement execution protocol:
   https://blog.jooq.org/how-i-incorrectly-fetched-jdbc-resultsets-again/
   
   It's really not obvious to implement correctly, unfortunately.


-- 
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-unsubscribe@pinot.apache.org

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


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


[GitHub] [pinot] zhuangdaz commented on issue #10879: execute() should return true and non-null _resultSet when there is no match

Posted by "zhuangdaz (via GitHub)" <gi...@apache.org>.
zhuangdaz commented on issue #10879:
URL: https://github.com/apache/pinot/issues/10879#issuecomment-1584857319

   The Jooq integration was introduced from this issue: https://github.com/apache/pinot/issues/6557


-- 
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-unsubscribe@pinot.apache.org

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


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


[GitHub] [pinot] Jackie-Jiang closed issue #10879: execute() should return true and non-null _resultSet when there is no match

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang closed issue #10879: execute() should return true and non-null _resultSet when there is no match
URL: https://github.com/apache/pinot/issues/10879


-- 
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-unsubscribe@pinot.apache.org

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


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


[GitHub] [pinot] mayankshriv commented on issue #10879: execute() should return true and non-null _resultSet when there is no match

Posted by "mayankshriv (via GitHub)" <gi...@apache.org>.
mayankshriv commented on issue #10879:
URL: https://github.com/apache/pinot/issues/10879#issuecomment-1587832526

   Seems like returning an empty resultSet should be the right approach? Can you file a PR?
   cc: @KKcorps 


-- 
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-unsubscribe@pinot.apache.org

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


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


[GitHub] [pinot] KKcorps commented on issue #10879: execute() should return true and non-null _resultSet when there is no match

Posted by "KKcorps (via GitHub)" <gi...@apache.org>.
KKcorps commented on issue #10879:
URL: https://github.com/apache/pinot/issues/10879#issuecomment-1587941687

   iirc these classes are adhering to JDBC interfaces
   
   if JDBC allows the signature change then we can do it


-- 
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-unsubscribe@pinot.apache.org

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


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