diff --git a/docs-mintlify/admin/connect-to-data/data-sources/ksqldb.mdx b/docs-mintlify/admin/connect-to-data/data-sources/ksqldb.mdx index c78f6d2210f83..3ff866c830b7a 100644 --- a/docs-mintlify/admin/connect-to-data/data-sources/ksqldb.mdx +++ b/docs-mintlify/admin/connect-to-data/data-sources/ksqldb.mdx @@ -335,10 +335,11 @@ cubes: time_dimension: CUBE.created_at granularity: second partition_granularity: day + # ksqlDB does not support NOW(); use CURRENT_TIMESTAMP with INTERVAL arithmetic instead. build_range_start: - sql: "SELECT date_trunc('day', DATE_SUB(NOW(), INTERVAL '5 hour'))" + sql: "SELECT date_trunc('day', CURRENT_TIMESTAMP - INTERVAL '5 hour')" build_range_end: - sql: "SELECT DATE_ADD(NOW(), INTERVAL '15 minute')" + sql: "SELECT CURRENT_TIMESTAMP + INTERVAL '15 minute'" refresh_key: every: 1 minute update_window: 1 hour @@ -510,11 +511,12 @@ cube("order_events_stream", { time_dimension: CUBE.created_at, granularity: `second`, partition_granularity: `day`, + // ksqlDB does not support NOW(); use CURRENT_TIMESTAMP with INTERVAL arithmetic instead. build_range_start: { - sql: `SELECT date_trunc('day', DATE_SUB(NOW(), INTERVAL '5 hour'))`, + sql: `SELECT date_trunc('day', CURRENT_TIMESTAMP - INTERVAL '5 hour')`, }, build_range_end: { - sql: `SELECT DATE_ADD(NOW(), INTERVAL '15 minute')`, + sql: `SELECT CURRENT_TIMESTAMP + INTERVAL '15 minute'`, }, refresh_key: { every: `1 minute`, @@ -603,6 +605,22 @@ with: +**The ksqlDB stream (or table) name and the backing Kafka topic name +MUST be identical, including case.** Kafka streams mode will fail if +they differ in any way. + +Take this into account when creating the stream — explicitly set the +topic name to match the stream name (and vice versa). For example: + +```sql +CREATE STREAM ORDER_EVENTS_STREAM (...) + WITH (KAFKA_TOPIC='ORDER_EVENTS_STREAM', VALUE_FORMAT='JSON', ...); +``` + +The match is **case-sensitive**: `OrderEvents` and `ORDEREVENTS` are +treated as different names and will cause the build to fail with +`Topic table ... is not found`. + This is a known limitation of Kafka streams mode. It does not occur when the ksqlDB object name and the Kafka topic name are the same, which is the default behavior when ksqlDB creates a stream or table @@ -672,10 +690,11 @@ pre_aggregations: time_dimension: CUBE.created_at granularity: second partition_granularity: day + # ksqlDB does not support NOW(); use CURRENT_TIMESTAMP with INTERVAL arithmetic instead. build_range_start: - sql: "SELECT date_trunc('day', DATE_SUB(NOW(), INTERVAL '5 hour'))" + sql: "SELECT date_trunc('day', CURRENT_TIMESTAMP - INTERVAL '5 hour')" build_range_end: - sql: "SELECT DATE_ADD(NOW(), INTERVAL '15 minute')" + sql: "SELECT CURRENT_TIMESTAMP + INTERVAL '15 minute'" refresh_key: every: 1 minute update_window: 1 hour @@ -707,11 +726,12 @@ pre_aggregations: { time_dimension: CUBE.created_at, granularity: `second`, partition_granularity: `day`, + // ksqlDB does not support NOW(); use CURRENT_TIMESTAMP with INTERVAL arithmetic instead. build_range_start: { - sql: `SELECT date_trunc('day', DATE_SUB(NOW(), INTERVAL '5 hour'))`, + sql: `SELECT date_trunc('day', CURRENT_TIMESTAMP - INTERVAL '5 hour')`, }, build_range_end: { - sql: `SELECT DATE_ADD(NOW(), INTERVAL '15 minute')`, + sql: `SELECT CURRENT_TIMESTAMP + INTERVAL '15 minute'`, }, refresh_key: { every: `1 minute`,