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

fix: improve print topic error message when topic does not exist #3464

Merged
merged 3 commits into from
Oct 4, 2019

Conversation

big-andy-coates
Copy link
Contributor

@big-andy-coates big-andy-coates commented Oct 2, 2019

Description

The message incorrectly stated that KSQL treats unquoted topic names as uppercase. This is not the case.

Also, the suggested alternative was just the opposite case to the supplied, which is fairly arbitrary, e.g. if the user issues print PageView and the topic does not exist the error message will suggest pAGEvIEW, even though no such topic exists.

With this change the error message will include any other topics that exist in the cluster with the same name, but different case.

New error message looks like:

ksql> print PageVIEWS;
Could not find topic 'PageVIEWS', or the KSQL user does not have permissions to list the topic. Topic names are case-sensitive.
Did you mean:
	print pageviews;
	print PageViews;
ksql>

Testing done

Test class switched from EasyMock to Mockito and suitable test added.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

The message incorrectly stated that KSQL treats unquoted topic names as uppercase. This is not the case.

Also, the suggested alternative was just the opposite case to the supplied, which is fairly arbitrary, e.g. if the user issues `print PageView` and the topic does not exist the error message will suggest `pAGEvIEW`, even though no such topic exists.

With this change the error message will include any other topics that exist in the cluster with the same name,  but different case.
@big-andy-coates big-andy-coates requested a review from a team as a code owner October 2, 2019 22:55
@big-andy-coates big-andy-coates merged commit 0fa4d24 into confluentinc:master Oct 4, 2019
@big-andy-coates big-andy-coates deleted the print_topic branch October 4, 2019 17:43
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