Skip to content

fix DataTypeAggregateFunction deserialization#6773

Merged
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
infinivision:fix_issue_6575
Sep 3, 2019
Merged

fix DataTypeAggregateFunction deserialization#6773
alexey-milovidov merged 3 commits intoClickHouse:masterfrom
infinivision:fix_issue_6575

Conversation

@yuzhichang
Copy link
Copy Markdown
Contributor

@yuzhichang yuzhichang commented Sep 2, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Bug Fix

Short description (up to few sentences):
Try to fix 6575.
I have to enlarge DEFAULT_MAX_STRING_SIZE in dbms/src/IO/ReadHelpers.h, and max_query_size in users.xml.



#define DEFAULT_MAX_STRING_SIZE 0x00FFFFFFULL
#define DEFAULT_MAX_STRING_SIZE 0x3FFFFFFFULL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing comment here. Why 3F, how it is motivated?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The intermediate state of bitmap is also contained within the query to be transferred among nodes, it's very easy to exceed the original 16MB size for a bitmap state and it would be cut leading to parsing exception.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

bitmap serialization writes each UInt32 as 4 bytes, and become at most 8 bytes when escaped. 0x3FFFFFFFULL can cover at least (2^30)/8=125M UInt32 integers.
We could reduce bitmap serialization size by using the official CRoaring serialization. This also could help to improve bitmap serialization/deserialization performance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok.

This also could help to improve bitmap serialization/deserialization performance.

It will be appreciated if you can implement it with backwards compatibility.

@alexey-milovidov
Copy link
Copy Markdown
Member

Ok. But test is missing.
Could you please make a simple functional test
(it can involve remote('127.0.0.{2,3}', ... to emulate distributed queries, see examples around; it should contain shard in it's name as a tag that it performs distributed query)

@yuzhichang
Copy link
Copy Markdown
Contributor Author

yuzhichang commented Sep 3, 2019

@alexey-milovidov I don't understand how remote('127.0.0.{2,3}', ... to emulate distributed queries work. The log indicates that the standalone node receives the query which aim to 127.0.0.2, without listening on 127.0.0.2. Could you provide document or code link?

@alexey-milovidov alexey-milovidov merged commit 845a612 into ClickHouse:master Sep 3, 2019
@alexey-milovidov
Copy link
Copy Markdown
Member

The log indicates that the standalone node receives the query which aim to 127.0.0.2, without listening on 127.0.0.2.

We run ClickHouse that listen to :: (everything) to run tests with shard tag.

@KochetovNicolai KochetovNicolai added pr-bugfix Pull request with bugfix, not backported by default v19.12 labels Sep 19, 2019
KochetovNicolai pushed a commit that referenced this pull request Sep 19, 2019
fix DataTypeAggregateFunction deserialization

(cherry picked from commit 845a612)
KochetovNicolai pushed a commit that referenced this pull request Sep 20, 2019
fix DataTypeAggregateFunction deserialization

(cherry picked from commit 845a612)
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL parsing exception on worker node if the outer query is against distributed table and the scalar subquery contains bitmap function

4 participants