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

Mistake in PRINT statement on stream-stream join tutorial #714

Open
chuck-confluent opened this issue Feb 9, 2021 · 5 comments
Open

Mistake in PRINT statement on stream-stream join tutorial #714

chuck-confluent opened this issue Feb 9, 2021 · 5 comments
Labels
enhancement New feature or request UX

Comments

@chuck-confluent
Copy link

In this tutorial, there is a mistake in this PRINT statement:

PRINT SHIPPED_ORDERS FROM BEGINNING LIMIT 3;

The PRINT statement takes a topic as input, not a kstream. To use PRINT, the user would have to use the name of the derived topic, or an earlier step would have to use a WITH kafka_topic = 'blah' to set the topic name.

A better approach would probably be to use this instead:

SELECT * FROM SHIPPED_ORDERS EMIT CHANGES LIMIT 3;
@chuck-confluent chuck-confluent added the bug Something isn't working label Feb 9, 2021
@mikebin
Copy link

mikebin commented Feb 9, 2021

Is this statement not valid? SHIPPED_ORDERS would be the name of the output topic in this case, and the intent of the tutorial seems to be to show what's in the topic.

@chuck-confluent
Copy link
Author

I see -- I'm working in Confluent Cloud where the topic is called pksqlc-yo50oSHIPPED_ORDERS

You're right, we lose the intentioned purpose, which is to show that the data is in a kafka topic and consumable by any consumer, not just ksqlDB.

The safe thing to do would be to set the topic name explicitly with a WITH statement. There's already topics _shipped and _orders, so _shipped-orders or something similar would work

@ybyzek
Copy link
Contributor

ybyzek commented Feb 9, 2021

cc: @bbejeck regarding @chuck-confluent 's comment above -- this an example of one issue KT would have to take into consideration if it presents Confluent Cloud workflows but validates locally.

@chuck-confluent
Copy link
Author

chuck-confluent commented Feb 9, 2021

On a strange related note, I have never gotten this to work in confluent cloud for this tutorial:

PRINT 'pksqlc-yo50oSHIPPED_ORDERS' FROM BEGINNING;

I know there are messages in the topic because I was able to see them with a SELECT statement on the kstream. I can't print the topic, and when I go to the topic viewer and jump to offset 0 of each partition, I see nothing.

I can print and inspect the messages of other topics, but something weird might be happening if there are very few messages in a topic. This might affect other tutorials in confluent cloud that don't use datagen, but instead use insert into with a small number of input records.

@bbejeck
Copy link
Contributor

bbejeck commented Feb 22, 2021

IMO this isn't a bug; it's working as expected locally. We definitely need to take into consideration running the tutorials in the cloud vs. locally. But it's important to realize that KT was set up entirely thinking of running locally.

@bbejeck bbejeck added enhancement New feature or request UX and removed bug Something isn't working labels Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UX
Projects
None yet
Development

No branches or pull requests

4 participants