Skip to content

Commit 42f847f

Browse files
committed
Bugfix for KSQL JOIN Query
1 parent 402f8e3 commit 42f847f

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

python-jupyter-apache-kafka-ksql-tensorflow-keras.ipynb

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
{
3636
"cell_type": "code",
37-
"execution_count": 14,
37+
"execution_count": 8,
3838
"metadata": {
3939
"scrolled": true
4040
},
@@ -46,7 +46,7 @@
4646
"This CLI is intended for development only, not for production\n",
4747
"https://docs.confluent.io/current/cli/index.html\n",
4848
"\n",
49-
"Using CONFLUENT_CURRENT: /var/folders/0s/0xdkb9n12yqdb3fs71926z3c0000gp/T/confluent.0nWtkbhu\n",
49+
"Using CONFLUENT_CURRENT: /var/folders/0s/0xdkb9n12yqdb3fs71926z3c0000gp/T/confluent.RK2J2sUD\n",
5050
"Starting zookeeper\n",
5151
"zookeeper is [\u001b[0;32mUP\u001b[0m]\n",
5252
"Starting kafka\n",
@@ -59,7 +59,8 @@
5959
}
6060
],
6161
"source": [
62-
"! confluent start ksql-server"
62+
"# Shows correct startup but does not work 100% yet. Better start from Terminal!\n",
63+
"#! confluent start ksql-server"
6364
]
6465
},
6566
{
@@ -287,7 +288,7 @@
287288
},
288289
{
289290
"cell_type": "code",
290-
"execution_count": 7,
291+
"execution_count": 5,
291292
"metadata": {},
292293
"outputs": [
293294
{
@@ -311,7 +312,7 @@
311312
},
312313
{
313314
"cell_type": "code",
314-
"execution_count": 8,
315+
"execution_count": 6,
315316
"metadata": {},
316317
"outputs": [
317318
{
@@ -320,7 +321,7 @@
320321
"True"
321322
]
322323
},
323-
"execution_count": 8,
324+
"execution_count": 6,
324325
"metadata": {},
325326
"output_type": "execute_result"
326327
}
@@ -335,20 +336,33 @@
335336
},
336337
{
337338
"cell_type": "code",
338-
"execution_count": 12,
339+
"execution_count": 7,
339340
"metadata": {},
340-
"outputs": [],
341+
"outputs": [
342+
{
343+
"data": {
344+
"text/plain": [
345+
"[{'@type': 'currentStatus',\n",
346+
" 'statementText': \"CREATE STREAM creditcardfraud_per_user WITH (VALUE_FORMAT='AVRO', KAFKA_TOPIC='creditcardfraud_per_user') AS SELECT Time, Amount, Class FROM creditcardfraud_source c INNER JOIN USERS u on c.user = u.userid WHERE u.USERID = 1;\",\n",
347+
" 'commandId': 'stream/CREDITCARDFRAUD_PER_USER/create',\n",
348+
" 'commandStatus': {'status': 'SUCCESS',\n",
349+
" 'message': 'Stream created and running'}}]"
350+
]
351+
},
352+
"execution_count": 7,
353+
"metadata": {},
354+
"output_type": "execute_result"
355+
}
356+
],
341357
"source": [
342-
"# TODO Bugfix needed in ksql-python to create a JOIN statement:\n",
343-
"# https://github.com/bryanyang0528/ksql-python/issues/53\n",
344-
"# client.ksql('CREATE STREAM creditcardfraud_per_user WITH (VALUE_FORMAT='AVRO', KAFKA_TOPIC='creditcardfraud_per_user') AS SELECT Time, Amount, Class FROM creditcardfraud_source c INNER JOIN USERS u on c.user = u.userid WHERE u.USERID = 1')"
358+
"client.ksql(\"CREATE STREAM creditcardfraud_per_user WITH (VALUE_FORMAT='AVRO', KAFKA_TOPIC='creditcardfraud_per_user') AS SELECT Time, Amount, Class FROM creditcardfraud_source c INNER JOIN USERS u on c.user = u.userid WHERE u.USERID = 1\")"
345359
]
346360
},
347361
{
348362
"cell_type": "markdown",
349363
"metadata": {},
350364
"source": [
351-
"## TODO => The following section will be fixed soon (when Magnus is back at work)\n",
365+
"## TODO => The following section will be fixed soon\n",
352366
"# Mapping from KSQL to Numpy / Pandas for Machine Learning Tasks"
353367
]
354368
},

0 commit comments

Comments
 (0)