treasure-data / prestogres

PostgreSQL protocol gateway for Presto distributed SQL query engine
Other
292 stars 61 forks source link

presto_fetch: Remove null character from strings #31

Closed frsyuki closed 9 years ago

frsyuki commented 9 years ago

Because PostgreSQL doesn't allow them although Presto allows. Fixes #30.

frsyuki commented 9 years ago

Consider to use U+FFFD.

xerial commented 9 years ago

Looks good. Thanks for the quick fix!

frsyuki commented 9 years ago

did this patch solve your problem?

xerial commented 9 years ago

I tested this with a column c containing \00 characters. This fix failed with the following error:

td-presto=> select c from support.null_value ;
ERROR:  attribute "c" does not exist in Python object
HINT:  To return null in a column, let the returned object have an attribute named after column with value None.
CONTEXT:  while creating return value
PL/Python function "presto_fetch"
xerial commented 9 years ago

I made a fix so that it can work.