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

Fix empty tuple handling in a few formats #72616

Merged
merged 4 commits into from
Dec 31, 2024
Merged

Fix empty tuple handling in a few formats #72616

merged 4 commits into from
Dec 31, 2024

Conversation

al13n321
Copy link
Member

@al13n321 al13n321 commented Nov 28, 2024

Changelog category (leave one):

  • Bug Fix

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

Fix handling of empty tuples in some input and output formats (e.g. Parquet, Arrow).

Closes #71583

When writing or reading empty tuples, a few formats were returning LOGICAL_ERROR, a couple formats were crashing. Here are the trivial fixes.

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 28, 2024
@robot-clickhouse-ci-1
Copy link
Contributor

robot-clickhouse-ci-1 commented Nov 28, 2024

This is an automated comment for commit 2098ab3 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
Bugfix validationChecks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch✅ 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

@antaljanosbenjamin antaljanosbenjamin self-assigned this Nov 29, 2024

# Formats that don't support empty tuples.
$CLICKHOUSE_LOCAL -q "
insert into function file('$FILE', 'Parquet') select () settings engine_file_truncate_on_insert=1; -- {serverError BAD_ARGUMENTS}
Copy link
Member

Choose a reason for hiding this comment

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

How does it come that this results in BAD_ARGUMENTS, while the similar query in 02735_parquet_encoder.sql returns PARQUET_EXCEPTION?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, 02735_parquet_encoder.sql failed:

024-11-29 03:46:31 Expected server error code: 723 but got: 36 (query: insert into function file(empty_tuple_02735.parquet) select (); -- {serverError PARQUET_EXCEPTION}).
2024-11-29 03:46:31 Received exception from server (version 24.12.1):
2024-11-29 03:46:31 Code: 36. DB::Exception: Received from localhost:9000. DB::Exception: Parquet doesn't support empty tuples. (BAD_ARGUMENTS)
2024-11-29 03:46:31 (query: insert into function file(empty_tuple_02735.parquet) select (); -- {serverError PARQUET_EXCEPTION})

So I guess that should be changed.

@antaljanosbenjamin
Copy link
Member

And I think this is a noticeable bugfix, so it makes sense to have a changelog entry.

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-bugfix Pull request with bugfix, not backported by default and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Dec 3, 2024
@alexey-milovidov alexey-milovidov self-assigned this Dec 31, 2024
@alexey-milovidov alexey-milovidov merged commit 56af087 into master Dec 31, 2024
219 checks passed
@alexey-milovidov alexey-milovidov deleted the empt branch December 31, 2024 19:21
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default 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.

Can't read empty tuple from Arrow file
7 participants