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
Added firstLine
function to extract the first line from the multi-line string
#52209
Conversation
d692b95
to
98e0fbd
Compare
This is an automated comment for commit 4f7fd69 with description of existing statuses. It's updated for the latest CI running
|
98e0fbd
to
ba61f17
Compare
Added |
drop table if exists 02815_first_line_vector; | ||
create table 02815_first_line_vector (n Int32, text String) engine = MergeTree order by n; | ||
|
||
insert into 02815_first_line_vector values (1, 'foo\nbar\nbaz'), (2, 'quux\n'), (3, 'single line'), (4, 'windows\r\nline breaks'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For one line you can just select firstLine(materialize('foo\nbar\nbaz'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's good to know!
I'll probably prefer leaving a table with multiple values because it creates a tiny chance it will trigger the vector
handler for the function. Do you know btw if it can be triggered deterministically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this case (from current test) with three lines (ColumnString) is meant, then I don’t know. Or what vector do you mean?
(additionally FunctionStringToString has useDefaultImplementationForConstants = true, which means that the Const and non Const expression will be processed the same way.)
ba61f17
to
b88e6c1
Compare
Rebased and resolved conflicts in documentation |
b88e6c1
to
4f7fd69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Added
firstLine
function to extract the first line from the multi-line string. This closes #51172.Documentation entry for user-facing changes