timeplus-io / proton

A streaming SQL engine, a fast and lightweight alternative to ksqlDB and Apache Flink, 🚀 powered by ClickHouse.
https://timeplus.com
Apache License 2.0
1.48k stars 62 forks source link

TEE FILE #204

Open chenziliang opened 10 months ago

chenziliang commented 10 months ago

Use case

As proton client user, I would like my query result to be able to dump a file in interactive Proton console but still keep the interactive console printing its own output. I would like the file to be on client side and I can specify the location of the file if necessary. By default, if a file is not having absolute path, dump it to home directory.

Describe the solution you'd like

Case 1: my_file will be located in $HOME directory.

SELET * FROM my_stream TEE my_file;

Case 2: my_file will be located in /tmp directory.

SELET * FROM my_stream TEE /tmp/my_file;

Describe alternatives you've considered

Additional context

chenziliang commented 10 months ago

If the file is too big eventually, we may need split it into multiple parts like my_file.1, my_file.2, but it is nice to have for now.