Skip to content
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

Support JSONEachRow as response format #638

Open
gingerwizard opened this issue Jun 29, 2022 · 5 comments
Open

Support JSONEachRow as response format #638

gingerwizard opened this issue Jun 29, 2022 · 5 comments

Comments

@gingerwizard
Copy link
Collaborator

Useful for debugging and some use cases e.g. grafana/clickhouse-datasource#148
All responses would be marshalled into a map or struct.

@vladimir-golovchenko
Copy link

As an alternative consider returning string:

SELECT toString(tuple(*)) as result
FROM system.functions
LIMIT 3

/*
┌─result───────────────────────────┐
│ ('aes_encrypt_mysql',0,0,'')     │
│ ('decrypt',0,0,'')               │
│ ('wordShingleMinHashArg',0,0,'') │
└──────────────────────────────────┘
*/

@benwen-instacart
Copy link

Need the same support. For example query

select * from table_name FORMAT JSONEachRow

where the table has id and version columns.
and the expected result is like

{"id":1, "version":1}
{"id":2, "version":2}

The ClickHouse client returns the expected result. Expect the driver can return the same.

@jkaflik
Copy link
Contributor

jkaflik commented Feb 28, 2023

Currently, driver support NATIVE format only. We plan to introduce in/out multiple formats support in v3.

@jkaflik jkaflik added this to the v3.0.0 milestone Feb 28, 2023
@benwen-instacart
Copy link

Thanks @jkaflik ! Just curious what is the timeline for v3?

@jkaflik
Copy link
Contributor

jkaflik commented Feb 28, 2023

@benwen-instacart unfortunetely, we don't have it yet defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants