Open alex-krash opened 5 years ago
I like this
.write()
.send("INSERT INTO my_table VALUES", InputStream stream, ClickHouseFormat.CSV);
it should support : --format_csv_delimiter=";" --query="INSERT INTO test_table_log FORMAT CSVWithNames"
.write()
.withDbParams((new dbParams).add(format_csv_delimiter,";" ).add () )
.input(new FileInputStream("filename")
.sql("INSERT INTO my_table (X,Y,Z) FORMAT CSVWithNames")
.send();
Goal: reduce number of public proprietary methods, exposed by ru.yandex.clickhouse.ClickHouseStatement
Current situation: interface exposes many methods for data manipulations, that differs by:
Proposal: create single method, returning builder for data manipulations. Design is inspired by Spark DataFrameWriter/DataFrameReader. https://spark.apache.org/docs/2.3.0/api/java/org/apache/spark/sql/DataFrameWriter.html
Example of all the options, available for configuration:
For operation of binary formats, requiring callback:
Possible shortcuts for sending the data:
@den-crane, @filimonov, you are inexhaustible source of ideas - please, expose your opinion.