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

Add hints for enum names #23919

Merged
merged 1 commit into from
May 7, 2021
Merged

Conversation

ucasfl
Copy link
Collaborator

@ucasfl ucasfl commented May 6, 2021

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

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Add hints for Enum names. Closes #17112

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label May 6, 2021
@ucasfl
Copy link
Collaborator Author

ucasfl commented May 6, 2021

:) SELECT CAST('Helo' AS Enum('Hello' = 1, 'World' = 2))

SELECT CAST('Helo', 'Enum(\'Hello\' = 1, \'World\' = 2)')

Query id: c963ddd6-1db7-4841-9257-b90fbdbdc5e4


0 rows in set. Elapsed: 0.002 sec. 

Received exception from server (version 21.6.1):
Code: 36. DB::Exception: Received from localhost:9000. DB::Exception: Unknown element 'Helo' for enum, may be you meant: ['Hello']: While processing CAST('Helo', 'Enum(\'Hello\' = 1, \'World\' = 2)').

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.

LGTM. Let's also add sh test that will check that hints are present in the exception message.

@alexey-milovidov alexey-milovidov self-assigned this May 6, 2021
@ucasfl ucasfl force-pushed the hint-enum branch 3 times, most recently from 88bc289 to 5ea92a0 Compare May 6, 2021 14:06
@alexey-milovidov
Copy link
Member

Ok. Also I see that the commit message has strange characters: â�”â�
Could you please push --force with another commit message?

@ucasfl
Copy link
Collaborator Author

ucasfl commented May 6, 2021

Ok. Also I see that the commit message has strange characters: â�”â�
Could you please push --force with another commit message?

Ok.

@alexey-milovidov alexey-milovidov merged commit fd56e0a into ClickHouse:master May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hints for Enum names and column names based on Levenshtein distance.
3 participants