Open peaksnail opened 3 years ago
yandex/clickhouse-server:20.3.21.2
none of these work:
stream = clickHouseCliento.query('SELECT 1', { format: 'CSV' })
// makes RecordStream with format CSV
stream.on('data',console.log).on('end',()=>console.log('end'))
// console output: end
stream = clickHouseCliento.query('SELECT 1 FORMAT CSV', {})
// makes RecordStream with format JSONCompact
stream.on('data',console.log).on('end',()=>console.log('end'))
// console output: end
stream = clickHouseCliento.query('SELECT 1 FORMAT CSV', {omitFormat:true})
// makes RecordStream with format JSONCompact
stream.on('data',console.log).on('end',()=>console.log('end'))
// console output: end
stream = clickHouseCliento.query('SELECT 1 FORMAT CSV', {omitFormat:true,readonly:true})
// makes RecordStream with format JSONCompact
stream.on('data',console.log).on('end',()=>console.log('end'))
// console output: end
Only JSON streams are working:
clickHouseCliento.query('SELECT 1').on('data',console.log).on('end',()=>console.log('end'))
// [ 1 ]\n end
CURL confirms the sanity:
$ echo 'SELECT 1 FORMAT CSVWithNames' | curl 'http://localhost:8123/' --data-binary @-
"1"
1
var stream = ch.query ("SELECT 1 FORMAT CSV"); // or var stream = ch.query ("SELECT 1",format: 'CSV'); stream.on ('data', function (row) { console.log(row); });
not work return nothing
when var stream = ch.query ("SELECT 1 ");
it works