Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client needs to know which merger to use when merging column type BYTES that is consumed in chunks as part of a read. Without this fix, client gives a traceback: .../venv/lib/python2.7/site-packages/google/cloud/spanner/streamed.py", line 262, in _merge_by_type merger = _MERGE_BY_TYPE[type_.code] KeyError: 7 Type 7 is BYTES from the proto definition (https://github.com/googleapis/googleapis/blob/master/google/spanner/v1/type.proto) The error condition will arise if you write an image (a few MB in size) as base64 encoded in a bytes column. When trying to read the column back using the client, the above traceback will be given. With this fix, the client will use the string merger (treating bytes as a string) and allow the row to be consumed. The test is to read the entire column (with this fix) and write the bytes back to a file (base64 decoded).
- Loading branch information