Skip to content

Is it possible to output raw JSON when using TabSeparated format? #38334

Answered by UnamedRus
iosifnicolae2 asked this question in Q&A
Discussion options

You must be logged in to vote
SELECT
    num,
    formatRowNoNewline('JSONEachRow', res) AS a,
    JSONExtractRaw(formatRowNoNewline('JSONEachRow', res), 'res')
FROM
(
    SELECT
        111 AS num,
        CAST((1, 0, '2022-06-21T13:29:05.060Z'), 'Tuple(avl_1 Int8, avl_10349 Int8, timestamp String)') AS res
)
FORMAT TSVRaw

Query id: 77c48770-86fb-4258-91e4-2590cb9619a2

111     {"res":{"avl_1":1,"avl_10349":0,"timestamp":"2022-06-21T13:29:05.060Z"}}        {"avl_1":1,"avl_10349":0,"timestamp":"2022-06-21T13:29:05.060Z"}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@iosifnicolae2
Comment options

Answer selected by den-crane
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants