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

Query String line breaks not rendered correctly #4900

Closed
rmoff opened this issue Mar 26, 2020 · 0 comments · Fixed by #4956
Closed

Query String line breaks not rendered correctly #4900

rmoff opened this issue Mar 26, 2020 · 0 comments · Fixed by #4956
Labels

Comments

@rmoff
Copy link
Member

rmoff commented Mar 26, 2020

Describe the bug

The output for SHOW QUERIES does not render Query String correctly if there are line breaks present

To Reproduce

ksqlDB : 0.8.0

Create a query:

CREATE TABLE CUSTOMER_SUMMARY AS 
    SELECT C.FIRST_NAME + ' ' + C.LAST_NAME AS FULL_NAME, 
           C.EMAIL, 
           MAX(T.AMOUNT) AS LARGEST_ORDER
    FROM   TXNS T 
             LEFT JOIN 
           CUSTOMERS C 
             ON T.CUSTOMER_ID=C.ROWKEY 
    GROUP BY C.FIRST_NAME + ' ' + C.LAST_NAME, 
             C.EMAIL
    EMIT CHANGES;

View the query:

ksql> SHOW QUERIES;

 Query ID                | Status  | Sink Name        | Sink Kafka Topic | Query String
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 CTAS_CUSTOMER_SUMMARY_7 | RUNNING | CUSTOMER_SUMMARY | CUSTOMER_SUMMARY | CREATE TABLE CUSTOMER_SUMMARY WITH (KAFKA_TOPIC='CUSTOMER_SUMMARY', PARTITIONS=1, REPLICAS=1) AS SELECT  ((C.FIRST_NAME + ' ') + C.LAST_NAME) FULL_NAME,  C.EMAIL EMAIL,  MAX(T.AMOUNT) LARGEST_ORDERFROM TXNS TLEFT OUTER JOIN CUSTOMERS C ON ((T.CUSTOMER_ID = C.ROWKEY))GROUP BY ((C.FIRST_NAME + ' ') + C.LAST_NAME), C.EMAILEMIT CHANGES;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For detailed information on a Query run: EXPLAIN <Query ID>;

Expected behavior

Replace line breaks with spaces, don't delete them

ksql> SHOW QUERIES;

 Query ID                | Status  | Sink Name        | Sink Kafka Topic | Query String
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 CTAS_CUSTOMER_SUMMARY_7 | RUNNING | CUSTOMER_SUMMARY | CUSTOMER_SUMMARY | CREATE TABLE CUSTOMER_SUMMARY WITH (KAFKA_TOPIC='CUSTOMER_SUMMARY', PARTITIONS=1, REPLICAS=1) AS SELECT  ((C.FIRST_NAME + ' ') + C.LAST_NAME) FULL_NAME,  C.EMAIL EMAIL,  MAX(T.AMOUNT) LARGEST_ORDER FROM TXNS T LEFT OUTER JOIN CUSTOMERS C ON ((T.CUSTOMER_ID = C.ROWKEY)) GROUP BY ((C.FIRST_NAME + ' ') + C.LAST_NAME), C.EMAIL EMIT CHANGES;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For detailed information on a Query run: EXPLAIN <Query ID>;

Additional context
This may seem like a nit but being able to use the Query string as a way to rebuild one's application history after prototyping is useful, but scuppered if it's full of invalid code (e.g. MAX(T.AMOUNT) LARGEST_ORDERFROM TXNS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant