mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
fixed codestyle, added record to changelog
This commit is contained in:
parent
805bfd286c
commit
2ad01c59da
@ -7,6 +7,7 @@
|
||||
* Added column transformers `EXCEPT`, `REPLACE`, `APPLY`, which can be applied to the list of selected columns (after `*` or `COLUMNS(...)`). For example, you can write `SELECT * EXCEPT(URL) REPLACE(number + 1 AS number)`. Another example: `select * apply(length) apply(max) from wide_string_table` to find out the maxium length of all string columns. [#14233](https://github.com/ClickHouse/ClickHouse/pull/14233) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Added an aggregate function `rankCorr` which computes a rank correlation coefficient. [#11769](https://github.com/ClickHouse/ClickHouse/pull/11769) ([antikvist](https://github.com/antikvist)) [#14411](https://github.com/ClickHouse/ClickHouse/pull/14411) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
|
||||
* Added table function `view` which turns a subquery into a table object. This helps passing queries around. For instance, it can be used in remote/cluster table functions. [#12567](https://github.com/ClickHouse/ClickHouse/pull/12567) ([Amos Bird](https://github.com/amosbird)).
|
||||
* Added support for `xz` compression format. This enables using `*.xz` files in `table()` function. [#16578](https://github.com/ClickHouse/ClickHouse/pull/16578) ([Abi Palagashvili](https://github.com/fibersel))
|
||||
|
||||
#### Bug Fix
|
||||
|
||||
|
@ -64,16 +64,14 @@ bool LzmaReadBuffer::nextImpl()
|
||||
eof = true;
|
||||
return working_buffer.size() != 0;
|
||||
} else {
|
||||
throw Exception(
|
||||
std::string("lzma decoder finished, but stream is still alive: error code: ") + std::to_string(ret) + "; lzma version: " + LZMA_VERSION_STRING,
|
||||
ErrorCodes::LZMA_STREAM_DECODER_FAILED);
|
||||
throw Exception(ErrorCodes::LZMA_STREAM_DECODER_FAILED,
|
||||
"lzma decoder finished, but stream is still alive: error code: {}; lzma version: {}", ret, LZMA_VERSION_STRING);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret != LZMA_OK)
|
||||
throw Exception(
|
||||
std::string("lzma_stream_decoder failed: error code: ") + std::to_string(ret) + "; lzma version: " + LZMA_VERSION_STRING,
|
||||
ErrorCodes::LZMA_STREAM_DECODER_FAILED);
|
||||
throw Exception(ErrorCodes::LZMA_STREAM_DECODER_FAILED,
|
||||
"lzma_stream_decoder failed: error code: error codeL {}; lzma version: {}", ret, LZMA_VERSION_STRING);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,9 +25,9 @@ LzmaWriteBuffer::LzmaWriteBuffer(
|
||||
|
||||
// options for further compression
|
||||
lzma_options_lzma opt_lzma2;
|
||||
if (lzma_lzma_preset(&opt_lzma2, compression_level)) {
|
||||
if (lzma_lzma_preset(&opt_lzma2, compression_level))
|
||||
throw Exception(std::string("lzma preset failed: ") + "; lzma version: " + LZMA_VERSION_STRING, ErrorCodes::LZMA_STREAM_ENCODER_FAILED);
|
||||
}
|
||||
|
||||
|
||||
lzma_filter filters[] = {
|
||||
{ .id = LZMA_FILTER_X86, .options = NULL },
|
||||
@ -43,7 +43,8 @@ LzmaWriteBuffer::LzmaWriteBuffer(
|
||||
|
||||
LzmaWriteBuffer::~LzmaWriteBuffer()
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
finish();
|
||||
|
||||
lzma_end(&lstr);
|
||||
@ -60,31 +61,26 @@ void LzmaWriteBuffer::nextImpl()
|
||||
|
||||
lstr.next_in = reinterpret_cast<unsigned char *>(working_buffer.begin());
|
||||
lstr.avail_in = offset();
|
||||
//std::cout << lstr.avail_in << std::endl;
|
||||
|
||||
lzma_action action = LZMA_RUN;
|
||||
do {
|
||||
do
|
||||
{
|
||||
out->nextIfAtEnd();
|
||||
lstr.next_out = reinterpret_cast<unsigned char *>(out->position());
|
||||
lstr.avail_out = out->buffer().end() - out->position();
|
||||
//std::cout << lstr.avail_out << " BEFOR" << std::endl;
|
||||
|
||||
|
||||
lzma_ret ret = lzma_code(&lstr, action);
|
||||
out->position() = out->buffer().end() - lstr.avail_out;
|
||||
|
||||
//std::cout << lstr.avail_out << " AFTER" << std::endl;
|
||||
|
||||
//std::cout << ret << " RET IMPL" << std::endl;
|
||||
|
||||
if (ret == LZMA_STREAM_END) {
|
||||
return;
|
||||
}
|
||||
if (ret == LZMA_STREAM_END)
|
||||
return;
|
||||
|
||||
if (ret != LZMA_OK)
|
||||
throw Exception(std::string("lzma stream encoding failed: ") + "; lzma version: " + LZMA_VERSION_STRING, ErrorCodes::LZMA_STREAM_ENCODER_FAILED);
|
||||
|
||||
//std::cout << lstr.avail_in << " " << lstr.avail_out << std::endl;
|
||||
} while (lstr.avail_in > 0 || lstr.avail_out == 0);
|
||||
}
|
||||
|
||||
@ -96,7 +92,8 @@ void LzmaWriteBuffer::finish()
|
||||
|
||||
next();
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
out->nextIfAtEnd();
|
||||
lstr.next_out = reinterpret_cast<unsigned char *>(out->position());
|
||||
lstr.avail_out = out->buffer().end() - out->position();
|
||||
@ -104,9 +101,9 @@ void LzmaWriteBuffer::finish()
|
||||
lzma_ret ret = lzma_code(&lstr, LZMA_FINISH);
|
||||
out->position() = out->buffer().end() - lstr.avail_out;
|
||||
|
||||
//std::cout << ret << " RET FIN" << std::endl;
|
||||
|
||||
if (ret == LZMA_STREAM_END) {
|
||||
if (ret == LZMA_STREAM_END)
|
||||
{
|
||||
finished = true;
|
||||
return;
|
||||
}
|
||||
@ -114,8 +111,7 @@ void LzmaWriteBuffer::finish()
|
||||
if (ret != LZMA_OK)
|
||||
throw Exception(std::string("lzma stream encoding failed: ") + "; lzma version: " + LZMA_VERSION_STRING, ErrorCodes::LZMA_STREAM_ENCODER_FAILED);
|
||||
|
||||
//std::cout << lstr.avail_in << std::endl;
|
||||
} while (lstr.avail_out == 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user