v.21.9Improvement
Allow Multiple Reads from Regular Files in ClickHouse Local
If file descriptor inFiletable is regular file - allow to read multiple times from it. It allowsclickhouse-localto read multiple times from stdin (with multiple SELECT queries or subqueries) if stdin is a regular file likeclickhouse-local --query "SELECT * FROM table UNION ALL SELECT * FROM table" ... < file. This closes #11124. Co-authored with (alexey-milovidov). #25960 (BoloniniD).
Why it matters
This feature resolves the issue whereclickhouse-local could not execute multiple SELECT queries or subqueries reading from stdin when it was a regular file. It enables scenarios like running multiple queries with input redirected from a file, improving usability and flexibility for batch processing and complex query executions using stdin.How to use it
Simply redirect a regular file as stdin toclickhouse-local with multiple SELECT queries or subqueries. For example:clickhouse-local --query "SELECT * FROM table UNION ALL SELECT * FROM table" < fileThis allows the input file to be read multiple times within the same command session.