kafka-tutorials icon indicating copy to clipboard operation
kafka-tutorials copied to clipboard

MINOR: Replace deprectated 'TIMESTAMPTOSTRING' with 'FORMAT_TIMESTAMP'

Open bbejeck opened this issue 3 years ago • 1 comments

Description

Updated insert statements to use 'UNIX_TIMESTAMP()' to generate dates

This PR proposes to solve the "too old" date issue by using UNIX_TIMESTAMP() to generate dates for inserting the initial data for the tutorial. Additionally, the tutorial uses a deprecated method TIMESTAMPTOSTRING, so it's been replaced with the recommendedFORMAT_TIMESTAMP function.

NOTE There's one issue remaining - the test data relies on hardcoded dates in a JSON file, so the tests for this PR will fail until we develop approach for creating test data

Staging Docs

New tutorial checklist

bbejeck avatar Aug 04 '22 20:08 bbejeck

oops I missed this:

NOTE There's one issue remaining - the test data relies on hardcoded dates in a JSON file, so the tests for this PR will fail until we develop approach for creating test data

How about:

  1. update the "dev" queries and expected outputs to not select timestamp / window boundaries
  2. update the "test" input / output timestamps to be hardcoded but recent
  3. add infinite retention so that we're safe against race condition build failures

That would get us to a happy place of improved quality and reliable build, right?

davetroiano avatar Aug 04 '22 22:08 davetroiano

@davetroiano - PR updated

Should we do anything about stale dates with the ksql-test-runner? i.e., this part here

After spending a good deal of time on this, I think we should leave the dates for the test runner alone because updating requires a lot of manual work for little-to-no gain.

The timestamps used in the tutorial are set to use the current time so it should always work as expected for users working through the tutorial

bbejeck avatar Sep 12 '22 21:09 bbejeck

Only one test failure and it's unrelated

Test for this PR passed https://confluentinc.semaphoreci.com/jobs/d8c26926-d73d-4f55-acfe-0feb12b2628f

bbejeck avatar Sep 13 '22 13:09 bbejeck

After spending a good deal of time on this, I think we should leave the dates for the test runner alone because updating requires a lot of manual work for little-to-no gain.

@bbejeck sounds good, I agree

davetroiano avatar Sep 13 '22 13:09 davetroiano

latest change unrelated to files for the tutorial so merging now

bbejeck avatar Sep 13 '22 13:09 bbejeck

Thanks for the review @davetroiano!

bbejeck avatar Sep 13 '22 13:09 bbejeck