Skip to content

JSONCompactWithProgress query output format#66205

Merged
Algunenano merged 31 commits intoClickHouse:masterfrom
alexkorep:output-format-json-compact-with-progress
Sep 9, 2024
Merged

JSONCompactWithProgress query output format#66205
Algunenano merged 31 commits intoClickHouse:masterfrom
alexkorep:output-format-json-compact-with-progress

Conversation

@alexkorep
Copy link
Copy Markdown
Member

@alexkorep alexkorep commented Jul 8, 2024

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Introduced JSONCompactWithProgress format where ClickHouse outputs each row as a newline-delimited JSON object, including metadata, data, progress, totals, and statistics.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing):

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64, release, debug

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@alexkorep alexkorep requested review from Algunenano and slvrtrn July 8, 2024 07:31
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-feature Pull request with new product feature label Jul 8, 2024
@alexkorep alexkorep added the can be tested Allows running workflows for external contributors label Jul 8, 2024
@robot-ch-test-poll4
Copy link
Copy Markdown
Contributor

robot-ch-test-poll4 commented Jul 8, 2024

This is an automated comment for commit 1eb7cdb with description of existing statuses. It's updated for the latest CI running

✅ Click here to open a full report in a separate page

Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@Algunenano Algunenano self-assigned this Jul 8, 2024
@alexkorep alexkorep marked this pull request as draft July 9, 2024 08:02
@alexkorep alexkorep marked this pull request as ready for review July 23, 2024 15:16
@alexkorep alexkorep changed the title Output format json compact with progress JSONCompactWithProgress query output format Jul 27, 2024
Copy link
Copy Markdown
Member

@Algunenano Algunenano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it looks fine, although I haven't reviewed in detail yet. I've left some comments about issues I found when testing it. I'll review again in more detail once it's addressed

@alexkorep alexkorep requested a review from Algunenano August 25, 2024 12:22
Copy link
Copy Markdown
Member

@Algunenano Algunenano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nicely done.

Minor things about CI failures (TLDR, please merge with master):

  • binary_amd64_compat build: Seems unrelated and probably an infra issue. Let's merge with master.
  • 01168_mutations_isolation: Unrelated
  • [ a timeout in 02735_parquet_encoder.

And a possible improvement for the future, but it's unrelated to the changes and affects all progress reports: result_bytes and result_rows seem to be always 0 even if we've already started sending data to the client. It should either match the rows sent or be removed. E.g:

{"meta": [{"name":"number", "type":"UInt64"}, {"name":"a", "type":"Int64"}, {"name":"'\"'", "type":"String"}]}
{"progress":{"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","result_rows":"0","result_bytes":"0","elapsed_ns":"0"}}
{"progress":{"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"100","result_rows":"0","result_bytes":"0","elapsed_ns":"0"}}
{"progress":{"read_rows":"10","read_bytes":"80","written_rows":"0","written_bytes":"0","total_rows_to_read":"100","result_rows":"0","result_bytes":"0","elapsed_ns":"0"}}
{"data":["0", "0", "\""]}
{"data":["1", "1", "\""]}
{"data":["2", "2", "\""]}
{"data":["3", "3", "\""]}
{"data":["4", "4", "\""]}
{"data":["5", "5", "\""]}
{"data":["6", "6", "\""]}
{"data":["7", "7", "\""]}
{"data":["8", "8", "\""]}
{"data":["9", "9", "\""]}
{"progress":{"read_rows":"20","read_bytes":"160","written_rows":"0","written_bytes":"0","total_rows_to_read":"100","result_rows":"0","result_bytes":"0","elapsed_ns":"0"}}
{"data":["10", "10", "\""]}
{"data":["11", "11", "\""]}
{"data":["12", "12", "\""]}
{"data":["13", "13", "\""]}
{"data":["14", "14", "\""]}
{"data":["15", "15", "\""]}
{"data":["16", "16", "\""]}
{"data":["17", "17", "\""]}
{"data":["18", "18", "\""]}
{"data":["19", "19", "\""]}
{"progress":{"read_rows":"30","read_bytes":"240","written_rows":"0","written_bytes":"0","total_rows_to_read":"100","result_rows":"0","result_bytes":"0","elapsed_ns":"0"}}
...

@Algunenano
Copy link
Copy Markdown
Member

Algunenano commented Aug 28, 2024

Same for elapsed_ns. It's always zero, but it should be the time since the start of the query.

As it's unrelated to the PR, we can leave those improvements for the future and just create a ticket to remember about them. WDYT?

@alexkorep
Copy link
Copy Markdown
Member Author

@Algunenano I've created #69137 to follow-up the problem with zero values in elapsed_ns, result_bytes and result_rows.

@alexkorep
Copy link
Copy Markdown
Member Author

@Algunenano Looks like I don't have permissions to merge.
Could you please merge it for me?
Thanks!

@Algunenano
Copy link
Copy Markdown
Member

It's not possible to merge with failing checks. Please merge master to confirm the build issue goes away

@alexkorep
Copy link
Copy Markdown
Member Author

@Algunenano

Please merge master to confirm the build issue goes away

I did it twice, in both cases the tests failed, but it looks like they failed in different places. The build issue went away though.
Do you know if there is a way to re-run the failed tests?

@Algunenano
Copy link
Copy Markdown
Member

I did it twice, in both cases the tests failed, but it looks like they failed in different places. The build issue went away though.
Do you know if there is a way to re-run the failed tests?

Merging master to retry an infrastructure issue is fine, doing it to pass flaky test is frown upon since it just kicks the problem away until it becomes too big to do anything else.

There is no retry, you can review the tests that failed and report them if they are not reported already. Then either help investigating and fixing them or wait until somebody else does it.

@alexkorep
Copy link
Copy Markdown
Member Author

alexkorep commented Sep 9, 2024

Hi, @Algunenano, looks like this PR has passed all the checks, could you please merge if for me?

@Algunenano Algunenano added this pull request to the merge queue Sep 9, 2024
Merged via the queue into ClickHouse:master with commit d968de6 Sep 9, 2024
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants