Open nezed opened 5 years ago
Clickhouse understands the FORMAT statement which is accepted for both read (SELECT/DESCRIBE/SHOW/etc) and write (INSERT) kinds of queries.
FORMAT
SELECT
DESCRIBE
SHOW
INSERT
That means format public option is redundant because we'll always have to parse FORMAT value from query.
format
ch.query('INSERT INTO table FORMAT CSV')
Has #25 bug
ch.query ('INSERT INTO testTable', {format: 'CSV'})
Not even described in readme
ch.query ('INSERT INTO testTable FORMAT CSV', {format: 'CSV'})
No comments
ch.query ('INSERT INTO testTable', {inputFormat: 'CSV'})
Not working
inputFormat
@apla are you agree with this solution? I can add deprecation warning to master, for current 1+ releases and create 2.0.0 branch with deprecation.
2.0.0
The problem:
Clickhouse understands the
FORMAT
statement which is accepted for both read (SELECT
/DESCRIBE
/SHOW
/etc) and write (INSERT
) kinds of queries.That means
format
public option is redundant because we'll always have to parseFORMAT
value from query.For now, we have several issues related to it:
ch.query('INSERT INTO table FORMAT CSV')
as described in CH docsch.query ('INSERT INTO testTable', {format: 'CSV'})
as supported by node-clickhousech.query ('INSERT INTO testTable FORMAT CSV', {format: 'CSV'})
as a panic solutionch.query ('INSERT INTO testTable', {inputFormat: 'CSV'})
as described by node-clickhouse readmech.query('INSERT INTO table FORMAT CSV')
(Fix #39 )inputFormat
option, which isn't implemented.Proposed solution:
format
option as deprecated and remove it from public options laterFORMAT
statementinputFormat
references (It useless too)@apla are you agree with this solution? I can add deprecation warning to master, for current 1+ releases and create
2.0.0
branch with deprecation.