Allowed to switch between 'basic' and 'best effort' methods of parsing DateTime from text #1710

This commit is contained in:
Alexey Milovidov 2018-06-08 06:27:34 +03:00
parent 101276e541
commit 96fbe1d716
4 changed files with 10 additions and 5 deletions

View File

@ -74,6 +74,8 @@ void PrettyBlockOutputStream::calculateWidths(
void PrettyBlockOutputStream::write(const Block & block)
{
UInt64 max_rows = format_settings.pretty.max_rows;
if (total_rows >= max_rows)
{
total_rows += block.rows();
@ -210,10 +212,10 @@ void PrettyBlockOutputStream::writeValueWithPadding(const ColumnWithTypeAndName
void PrettyBlockOutputStream::writeSuffix()
{
if (total_rows >= max_rows)
if (total_rows >= format_settings.pretty.max_rows)
{
writeCString(" Showed first ", ostr);
writeIntText(max_rows, ostr);
writeIntText(format_settings.pretty.max_rows, ostr);
writeCString(".\n", ostr);
}

View File

@ -35,7 +35,6 @@ protected:
WriteBuffer & ostr;
const Block header;
size_t max_rows;
size_t total_rows = 0;
size_t terminal_width = 0;

View File

@ -95,6 +95,8 @@ void PrettyCompactBlockOutputStream::writeRow(
void PrettyCompactBlockOutputStream::write(const Block & block)
{
UInt64 max_rows = format_settings.pretty.max_rows;
if (total_rows >= max_rows)
{
total_rows += block.rows();

View File

@ -9,6 +9,8 @@ namespace DB
void PrettySpaceBlockOutputStream::write(const Block & block)
{
UInt64 max_rows = format_settings.pretty.max_rows;
if (total_rows >= max_rows)
{
total_rows += block.rows();
@ -81,10 +83,10 @@ void PrettySpaceBlockOutputStream::write(const Block & block)
void PrettySpaceBlockOutputStream::writeSuffix()
{
if (total_rows >= max_rows)
if (total_rows >= format_settings.pretty.max_rows)
{
writeCString("\nShowed first ", ostr);
writeIntText(max_rows, ostr);
writeIntText(format_settings.pretty.max_rows, ostr);
writeCString(".\n", ostr);
}