prestoclient icon indicating copy to clipboard operation
prestoclient copied to clipboard

CPrestoClient uses escaped quotes when writing results

Open jeffwong opened this issue 9 years ago • 1 comments

I have data which contains a string, similar to

The song "Candle in the Wind"

Normally if this wrote to a csv I would expect The song ""Candle in the Wind""

When I use the CPrestoClient it writes it as The song "Candle in the Wind"

How can I use "" instead of "? I think the answer is inside prestoclientjsonstream.c, where backslashes and quotes are detected, but I cannot find the exact solution

jeffwong avatar Oct 08 '15 06:10 jeffwong

Hi, looking through the sourcecode of prestoclientjsonstream.c. I think the escaping comes directly from Presto. Haven't got a working Hadoop/Presto setup at the moment, so I can't check it.

What you could do is add some code to the write_callback_function to change the escaping. Not an ideal solution, but probably more than fast enough.

easydatawarehousing avatar Oct 10 '15 08:10 easydatawarehousing