ClickhouseClient icon indicating copy to clipboard operation
ClickhouseClient copied to clipboard

Update HttpTransport.php

Open giko45 opened this issue 5 years ago • 3 comments

using a format on the builder gave an error.

    -> format(Format::JSON_COMPACT)

The sql send to clickhpuse server contained 2 FORMAT settings.

giko45 avatar Jun 27 '20 12:06 giko45

Have you tested this? I think this can lead to an exception because of calling json_decode on request result.

evsign avatar Jun 29 '20 12:06 evsign

Yes i tested my use case (i did not run the included tests). It required an change in the builder too. See: https://github.com/the-tinderbox/ClickhouseBuilder/pull/28

However by writing a raw select i can use the Clickhouse JSONCompact format without modifications to ClickhouseClient and/or Builder -> select("select * from table order by time DESC limit 5000 FORMAT JSONCompact")

giko45 avatar Jun 29 '20 14:06 giko45

Sorry,

even writing a raw select like this -> select("select * from table order by time DESC limit 5000 FORMAT JSONCompact") needs the modification in this PR to work.

json_decode on request result works without issues. JSONCompact is still valid json

giko45 avatar Jul 09 '20 12:07 giko45