v.23.7New Feature

Added firstLine function for extracting first line from multi-line string

Added firstLine function to extract the first line from the multi-line string. This closes #51172. #52209 (Mikhail Koviazin).
Added a new firstLine function that extracts the first line from a multi-line string.

Why it matters

The firstLine function addresses the need to quickly and efficiently retrieve the first line from text data containing multiple lines. This simplifies text processing tasks where only the initial line of a string is relevant, improving query expressiveness and reducing the need for complex string manipulations.

How to use it

Use the firstLine function in your queries by passing a multi-line string column or expression as an argument. It returns the substring up to the first newline character. For example:

SELECT firstLine(multi_line_column) FROM table_name;