Remove trailing whitespaces from formatted queries in some cases#11325
Merged
alexey-milovidov merged 16 commits intomasterfrom Jun 15, 2020
Merged
Remove trailing whitespaces from formatted queries in some cases#11325alexey-milovidov merged 16 commits intomasterfrom
alexey-milovidov merged 16 commits intomasterfrom
Conversation
azat
reviewed
Jun 1, 2020
| { | ||
| if (separator) | ||
| settings.ostr << separator; | ||
| settings.ostr << ' '; |
Member
There was a problem hiding this comment.
FWIW TSVRaw uses formatImpl and it will still has trailing whitespaces
Member
Author
There was a problem hiding this comment.
Ok, I will fix it also.
| CREATE VIEW test_01083.view\n(\n `n` Int64\n) AS\nSELECT toInt64(n) AS n\nFROM \n(\n SELECT toString(n) AS n\n FROM test_01083.merge\n WHERE _table != \'qwerty\'\n ORDER BY _table ASC\n)\nUNION ALL\nSELECT *\nFROM test_01083.file | ||
| CREATE DICTIONARY test_01083.dict\n(\n `n` UInt64, \n `col` String DEFAULT \'42\'\n)\nPRIMARY KEY n\nSOURCE(CLICKHOUSE(HOST \'localhost\' PORT 9440 SECURE 1 USER \'default\' TABLE \'url\' DB \'test_01083\'))\nLIFETIME(MIN 0 MAX 1)\nLAYOUT(CACHE(SIZE_IN_CELLS 1)) | ||
| CREATE VIEW test_01083.view\n(`n` Int64\n) AS\nSELECT toInt64(n) AS n\nFROM \n(\n SELECT toString(n) AS n\n FROM test_01083.merge\n WHERE _table != \'qwerty\'\n ORDER BY _table ASC\n)\nUNION ALL\nSELECT *\nFROM test_01083.file | ||
| CREATE DICTIONARY test_01083.dict\n(\n \n `n` UInt64,\n \n `col` String DEFAULT \'42\'\n)\nPRIMARY KEY n\nSOURCE(CLICKHOUSE(HOST \'localhost\' PORT 9440 SECURE 1 USER \'default\' TABLE \'url\' DB \'test_01083\'))\nLIFETIME(MIN 0 MAX 1)\nLAYOUT(CACHE(SIZE_IN_CELLS 1)) |
| 3 | ||
| 4 | ||
| CREATE TABLE memory_01069.file\n(\n `n` UInt8\n)\nENGINE = File(\'CSV\') | ||
| CREATE TABLE memory_01069.file\n(`n` UInt8\n)\nENGINE = File(\'CSV\') |
Member
There was a problem hiding this comment.
I suppose we need to remove \n before ( and after ). Or restore previous behaviour.
Member
Author
There was a problem hiding this comment.
Now you can see that the test results only differ in trailing whitespaces, as expected.
azat
added a commit
to azat/ClickHouse
that referenced
this pull request
Jun 17, 2020
After ClickHouse#11325 trailing whitespaces has been removed for data skipping indicies, and it may be different, if you have multiple skip indices, and in this case new server will not load such tables, because metadata will be different. Fix this by re-parse metadata in zookeeper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Remove trailing whitespaces from formatted queries in
clickhouse-clientorclickhouse-formatin some cases.Detailed description / Documentation draft:
Trailing whitespaces in queries copy-pasted from terminal look ugly.