Skip to content

Commit

Permalink
Merge pull request #1088 from confluentinc/master
Browse files Browse the repository at this point in the history
Kafka Tutorials Release [February 22, 2022]
  • Loading branch information
ybyzek authored Feb 24, 2022
2 parents c01b84e + 1fb24cb commit a2d3209
Show file tree
Hide file tree
Showing 38 changed files with 87 additions and 77 deletions.
2 changes: 1 addition & 1 deletion _data/harnesses/SSH-attack/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/audit-logs/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/aviation/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/clickstream/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/credit-card-activity/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/customer-journey/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/datacenter/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/ddos/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/denormalization/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/discount-promo/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/dynamic-pricing/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/firewall-splunk/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/fleet-management/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/internet-of-things/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/inventory/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/location-based-alerting/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/logistics/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/loyalty-rewards/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/mainframe-offload/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/messaging-modernization/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/model-retraining/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/next-best-offer/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/online-dating/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/payment-status-check/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
2 changes: 1 addition & 1 deletion _data/harnesses/salesforce/confluent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dev:

- action: skip
render:
file: shared/markup/ccloud/ksqlb_processing_intro.adoc
file: shared/markup/ccloud/ksqldb_processing_intro.adoc

- action: skip
render:
Expand Down
8 changes: 4 additions & 4 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@
</nav>
</div>
<div class="copyright">
<div class="copyright-links"><a target="_blank" rel="noopener noreferrer" href="terms-of-use/">Terms &amp;
<div class="copyright-links"><a target="_blank" rel="noopener noreferrer" href="https://www.confluent.io/terms-of-use/">Terms &amp;
Conditions</a> | <a target="_blank" rel="noopener noreferrer"
href="legal/confluent-privacy-statement/">Privacy Policy</a> | <a target="_blank" rel="noopener noreferrer"
href="legal/confluent-privacy-statement/#california-privacy-rights">Do Not Sell My Information</a> | <a
target="_blank" rel="noopener noreferrer" href="modern-slavery-policy/">Modern Slavery Policy</a> | <a
href="https://www.confluent.io/legal/confluent-privacy-statement/">Privacy Policy</a> | <a target="_blank" rel="noopener noreferrer"
href="https://www.confluent.io/legal/confluent-privacy-statement/#california-privacy-rights">Do Not Sell My Information</a> | <a
target="_blank" rel="noopener noreferrer" href="https://www.confluent.io/modern-slavery-policy/">Modern Slavery Policy</a> | <a
rel=" noreferrer" href="/#">Cookie Settings</a></div>
<p class="copy">
Copyright © Confluent, Inc. 2014-<span>2021</span>. Apache, Apache Kafka, Kafka, and associated open source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ CREATE STREAM audit_log_events (
>
) WITH (
KAFKA_TOPIC = 'confluent-audit-log-events',
VALUE_FORMAT='JSON',
TIMESTAMP='time',
TIMESTAMP_FORMAT='yyyy-MM-dd''T''HH:mm:ss.SSSX',
VALUE_FORMAT = 'JSON',
TIMESTAMP = 'time',
TIMESTAMP_FORMAT = 'yyyy-MM-dd''T''HH:mm:ss.SSSX',
PARTITIONS = 6
);


-- Application logic
CREATE STREAM audit_log_topics
WITH (
KAFKA_TOPIC='topic-operations-audit-log',
PARTITIONS=6
KAFKA_TOPIC = 'topic-operations-audit-log',
PARTITIONS = 6
)
AS SELECT time, data
FROM audit_log_events
WHERE data->authorizationinfo->resourcetype = 'Topic'
EMIT CHANGES;
EMIT CHANGES;
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ CREATE SOURCE CONNECTOR aviation WITH (
'timestamp.column.name' = 'created_at',
'output.data.format' = 'JSON',
'db.timezone' = 'UTC',
'tasks.max' = '1');
'tasks.max' = '1'
);
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
-- Stream of users
CREATE SOURCE CONNECTOR datagen_clickstream_users WITH (
'name' = 'Datagen_users',
'connector.class' = 'DatagenSource',
'kafka.api.key' = '<my-kafka-api-key>',
'kafka.api.secret' = '<my-kafka-api-secret>',
'kafka.topic' = 'clickstream_users',
'quickstart' = 'clickstream_users',
'quickstart' = 'CLICKSTREAM_USERS',
'maxInterval' = '10',
'format' = 'JSON',
'key.converter' = 'org.apache.kafka.connect.converters.IntegerConverter'
'tasks.max' = '1',
'output.data.format' = 'JSON'
);

-- Stream of per-user session information
CREATE SOURCE CONNECTOR datagen_clickstream WITH (
'name' = 'Datagen_clicks',
'connector.class' = 'DatagenSource',
'kafka.api.key' = '<my-kafka-api-key>',
'kafka.api.secret' = '<my-kafka-api-secret>',
'kafka.topic' = 'clickstream',
'quickstart' = 'clickstream',
'quickstart' = 'CLICKSTREAM',
'maxInterval' = '30',
'format' = 'JSON'
'tasks.max' = '1',
'output.data.format' = 'JSON'
);
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CREATE STREAM fd_transactions_enriched WITH (KAFKA_TOPIC = 'transactions_enriche
-- Aggregate the stream of transactions for each account ID using a two-hour
-- tumbling window, and filter for accounts in which the total spend in a
-- two-hour period is greater than the customer’s average:
CREATE TABLE fd_possible_stolen_card WITH (KAFKA_TOPIC = 'FD_possible_stolen_card', KEY_FORMAT = JSON') AS
CREATE TABLE fd_possible_stolen_card WITH (KAFKA_TOPIC = 'FD_possible_stolen_card', KEY_FORMAT = 'JSON') AS
SELECT
TIMESTAMPTOSTRING(WINDOWSTART, 'yyyy-MM-dd HH:mm:ss Z') AS WINDOW_START,
T.ACCOUNT_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ CREATE SOURCE CONNECTOR inventory WITH (
'timestamp.column.name' = 'created_at',
'output.data.format' = 'JSON',
'db.timezone' = 'UTC',
'tasks.max' = '1');
'tasks.max' = '1'
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ CREATE TABLE merchant_locations (
longitude DECIMAL(10,7),
geohash VARCHAR
) WITH (
KAFKA_TOPIC='merchant-locations',
VALUE_FORMAT='JSON',
KAFKA_TOPIC = 'merchant-locations',
VALUE_FORMAT = 'JSON',
PARTITIONS = 6
);

-- Creates a table to lookup merchants based on a
-- substring (precision) of the geohash
CREATE TABLE merchants_by_geohash
WITH (
KAFKA_TOPIC='merchant-geohash',
FORMAT='JSON',
PARTITIONS=6
KAFKA_TOPIC = 'merchant-geohash',
FORMAT = 'JSON',
PARTITIONS = 6
) AS
SELECT
SUBSTRING(geohash, 1, 6) AS geohash,
Expand All @@ -34,19 +34,19 @@ CREATE STREAM user_locations (
longitude DECIMAL(10,7),
geohash VARCHAR
) WITH (
KAFKA_TOPIC='user-locations',
VALUE_FORMAT='JSON',
PARTITIONS=6
KAFKA_TOPIC = 'user-locations',
VALUE_FORMAT = 'JSON',
PARTITIONS = 6
);

-- Creates a stream of alerts when a user's geohash based location roughly
-- intersects a collection of merchants locations from the
-- merchants_by_geohash table.
CREATE STREAM alerts_raw
WITH (
KAFKA_TOPIC='alerts-raw',
VALUE_FORMAT='JSON',
PARTITIONS=6
KAFKA_TOPIC = 'alerts-raw',
VALUE_FORMAT = 'JSON',
PARTITIONS = 6
) AS
SELECT
user_locations.id as user_id,
Expand All @@ -63,9 +63,9 @@ PARTITION BY null;
-- intersects with a merchant within a specified distance (0.2 KM)
CREATE STREAM promo_alerts
WITH (
KAFKA_TOPIC='promo-alerts',
VALUE_FORMAT='JSON',
PARTITIONS=6
KAFKA_TOPIC = 'promo-alerts',
VALUE_FORMAT = 'JSON',
PARTITIONS = 6
) AS
SELECT
alerts_raw.user_id,
Expand Down
Loading

0 comments on commit a2d3209

Please sign in to comment.