/oracle-ai-data-platform-workbench-spark-connectors:aidp-streaming-kafkafrom oracle-ai-data-platform-workbench-spark-connectors
Consume an OCI Streaming stream from an AIDP notebook via Spark structured streaming (Kafka-compat). Use when the user mentions OCI Streaming, Kafka on OCI, stream pool, structured streaming, or wants to read Kafka messages into Spark. Auth is SASL/PLAIN with an OCI auth token. Pattern matches the official Oracle AIDP sample.
Ships in oracle-ai-data-platform-workbench-spark-connectors. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
aidp-streaming-kafka — OCI Streaming via Spark structured streamingMirrors the official Oracle AIDP sample at oracle-samples/oracle-aidp-samples → data-engineering/ingestion/Streaming/StreamingFromOCIStreamingService.ipynb.
spark.read.format("csv"|"parquet").load("oci://...") is fine without this skill.bootstrap.servers at the right broker and skip the OCI-specific username format.spark-sql-kafka-0-10_<scala>:<spark> — AIDP's tpcds cluster has this).sys.path./Volumes/<catalog>/<schema>/<volume>/_checkpoints/...). Do NOT use /Workspace/... — the streaming engine fails silently. The helper's validate_checkpoint_path() raises a clear ValueError if you try.import os
from oracle_ai_data_platform_connectors.streaming import (
bootstrap_for_region, build_kafka_options_sasl_plain,
validate_checkpoint_path,
)
# Bootstrap. Either generic-regional (default) or cell-prefixed (matches OCI
# Console's "messages-endpoint" shape — pick whichever your stream pool shows):
bootstrap = bootstrap_for_region(os.environ["OCI_REGION"]) # streaming.<region>...:9092
# bootstrap = bootstrap_for_region(os.environ["OCI_REGION"], cell=1) # cell-1.streaming.<region>...:9092
opts = build_kafka_options_sasl_plain(
bootstrap_servers=bootstrap,
tenancy_name=os.environ["OCI_TENANCY_NAME"], # display name, NOT OCID
username=os.environ["OCI_USERNAME"], # OCI user; for IAM-Domains
# use "oracleidentitycloudservice/<email>"
stream_pool_ocid=os.environ["OCI_STREAM_POOL_OCID"],
auth_token=os.environ["OCI_AUTH_TOKEN"], # 1h TTL — refresh before long jobs
topic=os.environ["KAFKA_TOPIC"],
starting_offsets="latest", # or "earliest" for backfill
# Optional tuning (matches the official sample):
max_partition_fetch_bytes=1024 * 1024,
max_offsets_per_trigger=5, # cap rows per micro-batch (demo-friendly)
)
raw = spark.readStream.format("kafka").options(**opts).load()
# Validate checkpoint path BEFORE starting (saves you from silent FUSE failures)
checkpoint = validate_checkpoint_path(os.environ["KAFKA_CHECKPOINT_VOLUME"])
sink_path = os.environ["KAFKA_SINK_VOLUME"] # e.g. /Volumes/default/default/streaming/kafkaStreamingSink
# Match the official sample: write to a Delta sink under /Volumes/.
query = (
raw.writeStream
.queryName("OCIStreamingSource")
.format("delta")
.option("checkpointLocation", checkpoint)
.start(sink_path)
)
query.awaitTermination(timeout=120)
print("input rows in last batch:", (query.lastProgress or {}).get("numInputRows"))
For an inline test against an existing topic with print-style output:
out_df = raw.selectExpr("CAST(key AS STRING) AS k", "CAST(value AS STRING) AS v",
"topic", "partition", "offset")
q = (out_df.writeStream.format("memory").queryName("kafka_test")
.option("checkpointLocation", checkpoint)
.trigger(processingTime="5 seconds").start())
q.awaitTermination(timeout=60)
spark.sql("SELECT * FROM kafka_test").show()
q.stop()
OCI Streaming's Kafka SASL username is <tenancy_name>/<user>/<stream_pool_ocid>. The middle segment depends on tenancy type:
| Tenancy | username argument |
|---|---|
| Legacy IAM | <email> |
| IAM Domains (modern) | oracleidentitycloudservice/<email> |
If you oci iam user list shows the user with oracleidentitycloudservice/... prefix, use the prefixed form.
/Volumes/.... The validate_checkpoint_path() helper raises a ValueError if you pass /Workspace/... or oci://.... This is the #1 cause of "stream runs but no data appears" complaints in AIDP.com.oracle.bmc.auth.sasl.ResourcePrincipalsLoginModule) is blocked at the AIDP platform level (RP tokens not provided).oracleidentitycloudservice/ prefix.Max Concurrent Runs = 1 on the wrapping job.https://cell-1.streaming.<region>.oci.oraclecloud.com. Either form (streaming.<region>... or cell-N.streaming.<region>...) works for the Kafka layer.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub ahmedawan-oracle/claude-code-plugins --plugin oracle-ai-data-platform-workbench-spark-connectors25 skills in this plugin
/aidp-alh`aidp-alh` — Oracle AI Lakehouse / ADW / ATP via Spark JDBCConnect from an AIDP notebook to Oracle AI Lakehouse (ALH), Autonomous Data Warehouse (ADW), or Autonomous Transaction Processing (ATP) via Spark JDBC. Use when the user mentions ALH, AI Lakehouse, ADW, ATP, Autonomous Database, or wants to query a 26ai-backed Oracle Autonomous DB from Spark. Covers wallet (mTLS), IAM DB-Token (with on-executor refresh for long jobs), and API Key auth paths./aidp-aws-s3`aidp-aws-s3` — AWS S3 via the S3A connectorRead and write AWS S3 (`s3a://`) from an AIDP notebook. Use when the user mentions S3, AWS S3 bucket, s3a, or has AWS access keys. Auth is access key + secret key via the Hadoop S3A connector. boto3 is also available for non-Spark management operations (list, copy)./aidp-azure-adls`aidp-azure-adls` — Azure ADLS Gen2 via OAuth client-credentialsRead and write Azure Data Lake Storage Gen2 (`abfss://`) from an AIDP notebook. Use when the user mentions ADLS, Azure Data Lake, abfss, or wants to ingest from a multi-cloud Azure source. Auth is OAuth client-credentials (Service Principal client_id + secret + tenant)./aidp-connectors-bootstrap`aidp-connectors-bootstrap` — first-time setup of the helper package in AIDPFirst-time setup. Use when the user wants to install/upload the AIDP Spark connectors helper package into their AIDP workspace, or has just installed this plugin and asks "how do I set it up", "first-time setup", "install the helpers", "bootstrap aidp connectors". Drives the AIDP MCP tools to push the helper package to /Workspace/Shared/ and runs a sanity import./aidp-connectors-overview`aidp-connectors-overview` — pick the right connector skillHelp the user pick the right connector skill for their data source from an AIDP notebook. Use as a router when the user mentions multiple sources, isn't sure which connector applies, or asks "how do I connect to X from AIDP". Covers 23 data sources — Oracle Autonomous DB family (ALH/ADW/ATP), generic Oracle DB, ExaCS, PeopleSoft, Siebel, Fusion ERP/BICC, EPM Cloud, Essbase, OCI Streaming, Object Storage, Iceberg, plus PostgreSQL, MySQL/HeatWave, SQL Server, Hive, Snowflake, Azure ADLS, AWS S3, Salesforce, generic REST, custom JDBC, Excel./aidp-epm-cloud`aidp-epm-cloud` — EPM Cloud Planning REST → SparkRun a Planning data-slice export against Oracle EPM Cloud (Planning / EPBCS) and materialize as a Spark DataFrame in an AIDP notebook. Use when the user mentions EPM Cloud, EPBCS, Hyperion Planning, planning app, MDX export, or wants Planning data in Spark. HTTP Basic auth with identity-domain-prefixed username.