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

feat: add new and rename show queries columns for sink Kafka Topic and Stream/Table #4430

Merged

Conversation

stevenpyzhang
Copy link
Member

@stevenpyzhang stevenpyzhang commented Feb 3, 2020

Description

Fixes #4344
Renames columns and adds a new column in order to have both the sink Kafka Topic and the sink Stream/Table displayed

Testing done

Updated unit tests

ksql> show queries;

 Query ID    | Status  | Sink Name | Sink Kafka Topic | Query String                                                                                                                                
-----------------------------------------------------------------------------------------------------------------------------------------------------
 CSAS_FOO4_2 | RUNNING | FOO4      | FOO4             | CREATE STREAM FOO4 WITH (KAFKA_TOPIC='FOO4', PARTITIONS=1, REPLICAS=1) AS SELECT *FROM KSQL_PROCESSING_LOG KSQL_PROCESSING_LOGEMIT CHANGES; 
 CSAS_FOO3_4 | RUNNING | FOO3      | BAZ              | CREATE STREAM FOO3 WITH (KAFKA_TOPIC='BAZ', PARTITIONS=1, REPLICAS=1) AS SELECT *FROM KSQL_PROCESSING_LOG KSQL_PROCESSING_LOGEMIT CHANGES;  
 CSAS_FOO2_0 | RUNNING | FOO2      | BAR              | CREATE STREAM FOO2 WITH (KAFKA_TOPIC='BAR', PARTITIONS=1, REPLICAS=1) AS SELECT *FROM KSQL_PROCESSING_LOG KSQL_PROCESSING_LOGEMIT CHANGES;  
-----------------------------------------------------------------------------------------------------------------------------------------------------
For detailed information on a Query run: EXPLAIN <Query ID>;

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 #")

@stevenpyzhang stevenpyzhang requested a review from a team as a code owner February 3, 2020 23:49
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

Can we add an extra column so that we have both the sink name and the kafka topic name?

@stevenpyzhang stevenpyzhang force-pushed the fix-show-query-with-clause branch from dd453b8 to df9b17b Compare February 4, 2020 18:19
@stevenpyzhang stevenpyzhang changed the title fix: show queries now returns the correct Kafka Topic if the query string contains with clause feat: add new and rename show queries columns for sink Kafka Topic and Stream/Table Feb 4, 2020
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

LGTM with one caveat (inline)

@@ -304,18 +304,19 @@ public void testPrintQueries() {
+ " \"statementText\" : \"e\",\n"
+ " \"queries\" : [ {\n"
+ " \"queryString\" : \"select * from t1\",\n"
+ " \"sinks\" : [ \"Test\" ],\n"
+ " \"sinkNames\" : [ \"Test\" ],\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

check with the C3 people whether or not we need to keep this backwards compatible (i.e. keep the name sinks instead of sinkNmaes)

Copy link
Member Author

Choose a reason for hiding this comment

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

good point, I'll keep the original to avoid inadvertently breaking the frontend

@stevenpyzhang stevenpyzhang force-pushed the fix-show-query-with-clause branch 2 times, most recently from 1dd6945 to 66202bb Compare February 4, 2020 18:46
@stevenpyzhang stevenpyzhang force-pushed the fix-show-query-with-clause branch from 66202bb to 4ef62ab Compare February 4, 2020 18:48
@stevenpyzhang stevenpyzhang merged commit 1b713cd into confluentinc:master Feb 4, 2020
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.

SHOW QUERIES has incorrect field heading
2 participants