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

select_ipc can not handle empty query result. #19

Open
norci opened this issue Feb 26, 2021 · 1 comment
Open

select_ipc can not handle empty query result. #19

norci opened this issue Feb 26, 2021 · 1 comment

Comments

@norci
Copy link

norci commented Feb 26, 2021

If the result of a select statement is empty, then select_ipc will raise an error:

TTransportException('TSocket read 0 bytes')
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/pymapd/connection.py", line 489, in select_ipc
    tdf = self._client.sql_execute_df(
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/omnisci/thrift/OmniSci.py", line 1798, in sql_execute_df
    return self.recv_sql_execute_df()
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/omnisci/thrift/OmniSci.py", line 1814, in recv_sql_execute_df
    (fname, mtype, rseqid) = iprot.readMessageBegin()
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/thrift/protocol/TBinaryProtocol.py", line 134, in readMessageBegin
    sz = self.readI32()
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/thrift/protocol/TBinaryProtocol.py", line 217, in readI32
    buff = self.trans.readAll(4)
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/thrift/transport/TTransport.py", line 62, in readAll
    chunk = self.read(sz - have)
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/thrift/transport/TTransport.py", line 164, in read
    self.__rbuf = BufferIO(self.__trans.read(max(sz, self.__rbuf_size)))
  File "/home/coder/.conda/envs/conda_jl/lib/python3.8/site-packages/thrift/transport/TSocket.py", line 142, in read
    raise TTransportException(type=TTransportException.END_OF_FILE,

the bug is in
https://github.com/omnisci/pymapd/blob/7750cec20ee4904ccec1f3828144fd14ada00e04/omnisci/thrift/OmniSci.py#L1814

What about catch this exception, and returns an empty dataframe?

@mikehinchey mikehinchey transferred this issue from heavyai/pymapd Oct 20, 2021
@hardikchheda
Copy link

hardikchheda commented Oct 21, 2021 via email

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