-
Notifications
You must be signed in to change notification settings - Fork 127
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
Unicode decoding errors with qds-sdk #125
Comments
This is all with Python 3.5. |
We run into the same exact error twice again last night in our team.
I have also verified I have the latest for
The two jobs last night that run into this problem: |
When you specify a delimiter, we need to decode the bytes fetched from s3 and replace the existing delimiter in there with the delimiter you want. We decode the bytes assuming 'utf-8' encoding. From the error message:
It looks like the encoding of the result is not in 'utf-8'. Did anything changed recently at your end which changed the encoding from utf-8 to something else. Or are these new types of queries which encode result in some other encoding and don't use utf-8? One workaround I can thing of is to not specify the delimiter while calling |
Thanks @mindprince I tried not using the delimeter option, but am now running into a different problem That is, using: if (HiveCommand.is_success(cmd.status)):
with open(out_file, 'wt') as writer:
cmd.get_results(writer, inline=False) I run into the following problem: Traceback (most recent call last):
File "/avazquez/code/repositories/optimization-sandbox/utils/py_packages/qubole/query.py", line 54, in run_query
cmd.get_results(writer, inline=False)
File "/avazquez/code/bin/anaconda/envs/py35/lib/python3.5/site-packages/qds_sdk/commands.py", line 208, in get_results
_download_to_local(boto_conn, s3_path, fp, num_result_dir, delim=delim)
File "/avazquez/code/bin/anaconda/envs/py35/lib/python3.5/site-packages/qds_sdk/commands.py", line 1157, in _download_to_local
key_instance.get_contents_to_file(fp) # cb=_callback
File "/avazquez/code/bin/anaconda/envs/py35/lib/python3.5/site-packages/boto/s3/key.py", line 1650, in get_contents_to_file
response_headers=response_headers)
File "/avazquez/code/bin/anaconda/envs/py35/lib/python3.5/site-packages/boto/s3/key.py", line 1482, in get_file
query_args=None)
File "/avazquez/code/bin/anaconda/envs/py35/lib/python3.5/site-packages/boto/s3/key.py", line 1536, in _get_file_internal
fp.write(bytes)
TypeError: write() argument must be str, not bytes Some example queries that produced this error:
They all completed correctly, the problem was in downloading the data. |
Try,
https://github.com/qubole/qds-sdk-py/blob/v1.7.0/qds_sdk/commands.py#L201-L205 |
Please close this issue if the above solution works. |
Hi, I have started running into Unicode decoding errors recently. When running:
I ended up with:
Here is the Job ID with the query mentioend above.
The text was updated successfully, but these errors were encountered: