review fixes

This commit is contained in:
Alexander Kuzmenkov 2020-04-15 17:10:33 +03:00
parent 2ee49c9d68
commit d15d6e1661
4 changed files with 2 additions and 9 deletions

View File

@ -9,11 +9,6 @@
namespace DB
{
Field IColumn::get(size_t n) const
{
return (*this)[n];
}
String IColumn::dumpStructure() const
{
WriteBufferFromOwnString res;

View File

@ -70,7 +70,6 @@ public:
/// Returns value of n-th element in universal Field representation.
/// Is used in rare cases, since creation of Field instance is expensive usually.
virtual Field operator[](size_t n) const = 0;
Field get(size_t n) const;
/// Like the previous one, but avoids extra copying if Field is in a container, for example.
virtual void get(size_t n, Field & res) const = 0;

View File

@ -617,7 +617,7 @@ void ActionsMatcher::visit(const ASTLiteral & literal, const ASTPtr & /* ast */,
&& existing_column->column
&& isColumnConst(*existing_column->column)
&& existing_column->column->size() == 1
&& existing_column->column->get(0) == value)
&& existing_column->column->operator[](0) == value)
{
const_cast<ASTLiteral &>(literal).unique_column_name = default_name;
}

View File

@ -875,8 +875,7 @@ void SelectQueryExpressionAnalyzer::appendProjectResult(ExpressionActionsChain &
* names and identifiers for columns. This code is a workaround for
* a particular subclass of problems, and not a proper solution.
*/
if (auto as_literal = ast->as<ASTLiteral>();
as_literal)
if (auto as_literal = ast->as<ASTLiteral>())
{
source_name = as_literal->unique_column_name;
assert(!source_name.empty());