sergioferragut commented on code in PR #14742:
URL: https://github.com/apache/druid/pull/14742#discussion_r1289197249


##########
examples/quickstart/jupyter-notebooks/notebooks/02-ingestion/01-streaming-from-kafka.ipynb:
##########
@@ -258,16 +238,56 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "kafka_ingestion_spec = \"{\\\"type\\\": \\\"kafka\\\",\\\"spec\\\": 
{\\\"ioConfig\\\": {\\\"type\\\": \\\"kafka\\\",\\\"consumerProperties\\\": 
{\\\"bootstrap.servers\\\": \\\"kafka:9092\\\"},\\\"topic\\\": 
\\\"social_media\\\",\\\"inputFormat\\\": {\\\"type\\\": 
\\\"json\\\"},\\\"useEarliestOffset\\\": true},\\\"tuningConfig\\\": 
{\\\"type\\\": \\\"kafka\\\"},\\\"dataSchema\\\": {\\\"dataSource\\\": 
\\\"social_media\\\",\\\"timestampSpec\\\": {\\\"column\\\": 
\\\"__time\\\",\\\"format\\\": \\\"iso\\\"},\\\"dimensionsSpec\\\": 
{\\\"dimensions\\\": [\\\"username\\\",\\\"post_title\\\",{\\\"type\\\": 
\\\"long\\\",\\\"name\\\": \\\"views\\\"},{\\\"type\\\": 
\\\"long\\\",\\\"name\\\": \\\"upvotes\\\"},{\\\"type\\\": 
\\\"long\\\",\\\"name\\\": 
\\\"comments\\\"},\\\"edited\\\"]},\\\"granularitySpec\\\": 
{\\\"queryGranularity\\\": \\\"none\\\",\\\"rollup\\\": 
false,\\\"segmentGranularity\\\": \\\"hour\\\"}}}}\""
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "print(json.dumps(json.loads(kafka_ingestion_spec), indent=4))"
+    "kafka_ingestion_spec = {\n",
+    "    \"type\": \"kafka\",\n",
+    "    \"spec\": {\n",
+    "        \"ioConfig\": {\n",
+    "            \"type\": \"kafka\",\n",
+    "            \"consumerProperties\": {\n",
+    "                \"bootstrap.servers\": \"kafka:9092\"\n",
+    "            },\n",
+    "            \"topic\": \"social_media\",\n",
+    "            \"inputFormat\": {\n",
+    "                \"type\": \"json\"\n",
+    "            },\n",
+    "            \"useEarliestOffset\": True\n",
+    "        },\n",
+    "        \"tuningConfig\": {\n",
+    "            \"type\": \"kafka\"\n",
+    "        },\n",
+    "        \"dataSchema\": {\n",
+    "            \"dataSource\": \"social_media\",\n",
+    "            \"timestampSpec\": {\n",
+    "                \"column\": \"time\",\n",
+    "                \"format\": \"iso\"\n",
+    "            },\n",
+    "            \"dimensionsSpec\": {\n",
+    "                \"dimensions\": [\n",
+    "                    \"username\",\n",
+    "                    \"post_title\",\n",
+    "                    {\n",
+    "                        \"type\": \"long\",\n",
+    "                        \"name\": \"views\"\n",
+    "                    },\n",
+    "                    {\n",
+    "                        \"type\": \"long\",\n",
+    "                        \"name\": \"upvotes\"\n",
+    "                    },\n",
+    "                    {\n",
+    "                        \"type\": \"long\",\n",
+    "                        \"name\": \"comments\"\n",
+    "                    },\n",
+    "                    \"edited\"\n",
+    "                ]\n",
+    "            },\n",
+    "            \"granularitySpec\": {\n",
+    "                \"queryGranularity\": \"none\",\n",
+    "                \"rollup\": False,\n",
+    "                \"segmentGranularity\": \"hour\"\n",
+    "            }\n",
+    "        }\n",
+    "    }\n",
+    "}\n"

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to