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

Convert history file from readline format to replxx format #25888

Merged

Conversation

azat
Copy link
Collaborator

@azat azat commented Jun 30, 2021

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Convert history file from readline format to replxx format

Detailed description / Documentation draft:
replxx requires each history line to prepended with time line:

### YYYY-MM-DD HH:MM:SS.SSS
select 1

And w/o those service lines it will load all lines from history file as
one history line for suggestion. And if there are lots of lines in file it
will take lots of time (getline() + tons of reallocations).

Cc: @den-crane
Cc: @filimonov

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Jun 30, 2021
@azat azat force-pushed the replxx-convert-history-file branch from efd440f to 3d32463 Compare June 30, 2021 19:05
replxx requires each history line to prepended with time line:

    ### YYYY-MM-DD HH:MM:SS.SSS
    select 1

And w/o those service lines it will load all lines from history file as
one history line for suggestion. And if there are lots of lines in file it
will take lots of time (getline() + tons of reallocations).
@azat azat force-pushed the replxx-convert-history-file branch from 3d32463 to 626f47e Compare June 30, 2021 19:06
@alexey-milovidov alexey-milovidov self-assigned this Jul 2, 2021
@alexey-milovidov
Copy link
Member

Thank you!

LGTM. The code is dirty but we don't need anything good here.

@alexey-milovidov alexey-milovidov merged commit e4cb2b4 into ClickHouse:master Jul 2, 2021
@azat azat deleted the replxx-convert-history-file branch July 3, 2021 13:36
@alexey-milovidov
Copy link
Member

Sorry, this PR contains a bug.

Fresh installation:

ubuntu@ip-172-31-43-234:~$ clickhouse-client 
ClickHouse client version 21.9.1.7510 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 21.9.1 revision 54449.


Cannot read from /home/ubuntu/.clickhouse-client-history (for conversion): errno: 2, strerror: No such file or directory
ip-172-31-43-234.us-east-2.compute.internal :)

I will revert.

@alexey-milovidov alexey-milovidov added the bug Confirmed user-visible misbehaviour in official release label Jul 19, 2021
alexey-milovidov added a commit that referenced this pull request Jul 19, 2021
@azat azat removed the bug Confirmed user-visible misbehaviour in official release label May 6, 2023
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.

3 participants