Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VALUES list #6209

Merged
merged 10 commits into from
Aug 1, 2019
Merged

VALUES list #6209

merged 10 commits into from
Aug 1, 2019

Conversation

dimarub2000
Copy link
Contributor

@dimarub2000 dimarub2000 commented Jul 29, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

For changelog. Remove if this is non-significant change.

Category (leave one):

  • New Feature

Short description (up to few sentences):
#5984 implemented
#6217 Fixed


if (case_sensitiveness == CaseInsensitive
&& !case_insensitive_table_functions.emplace(Poco::toLower(name), creator).second)
throw Exception("TableFunctionFactory: the case insensitive aggregate function name '" + name + "' is not unique",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an aggregate function


for (size_t j = 0; j < value_tuple.size(); ++j)
{
Field value = convertFieldToType(value_tuple[j], *sample_block.getByPosition(j).type, value_type_ptr.get());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it cannot convertFieldToType?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it cannot convertFieldToType?

For example : Received exception from server (version 19.13.1): Code: 53. DB::Exception: Received from localhost:9000. DB::Exception: Type mismatch in IN or VALUES section. Expected: String. Got: UInt64.

Do we need to throw more local exception?
Tests will be added soon

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Ok.

@dimarub2000
Copy link
Contributor Author

dimarub2000 commented Jul 29, 2019

Single column ValuesList queries doesn't work yet. Trying to implement.

UPD: Fixed in parseAndInsertValues. But not sure if it looks OK.

namespace DB
{

class TableFunctionValues : public ITableFunction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment needed.

namespace DB
{

class StorageValues : public ext::shared_ptr_helper<StorageValues>, public IStorage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment needed.

Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@dimarub2000
Copy link
Contributor Author

Latest commits also fix problem #6217, fix is implemented in parseColumnsListFromString function which is used in ITableFunctionFileLike.cpp and TableFunctionValues.cpp.

namespace DB
{

void parseColumnsList(const std::string & structure, Block & sample_block, const Context & context);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment needed.
Better to return Block by value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is comment in later commit

@alexey-milovidov alexey-milovidov merged commit a8793fb into ClickHouse:master Aug 1, 2019
@alexey-milovidov
Copy link
Member

Continued in #6255

@KochetovNicolai KochetovNicolai added pr-improvement Pull request with some product improvements pr-feature Pull request with new product feature and removed pr-improvement Pull request with some product improvements labels Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants