Skip to content

Conversation

@featzhang
Copy link
Member

What is the purpose of the change

This PR implements support for viewing SQL execution history in the Flink SQL Client by adding a new HISTORY command.

Related JIRA: https://issues.apache.org/jira/browse/FLINK-39069

Brief change log

  • Add SHOW_HISTORY command enum type in Command.java
  • Implement HistoryCommandPrinter class to read and display history file content
  • Add "HISTORY" keyword parsing in SqlCommandParserImpl
  • Pass history file path through SqlMultiLineParser to enable history reading
  • Update help message in CliStrings to include the new HISTORY command
  • Handle edge cases (empty file, file not exists, IO errors)

Verifying this change

This change can be verified manually as follows:

  1. Start SQL Client: ./bin/sql-client.sh embedded
  2. Execute some SQL statements, e.g., CREATE TABLE t1 (id INT);
  3. Run HISTORY; command
  4. Verify that previously executed statements are displayed with line numbers
  5. Test edge cases: Run HISTORY when no history file exists

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths: no
  • Anything that affects deployment or recovery: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? code comments and JavaDoc
  • The HISTORY command is included in the SQL Client help message

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 11, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants