-
-
Save yjshen/7853e675604c3690353ef406b61fc7ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val df = spark | |
.read | |
.format("pulsar") | |
.option("service.url", "pulsar://localhost:6650") | |
.option("admin.url", "http://localhost:8080") | |
.option("topicsPattern", "topic.*") | |
.option("startingOffsets", "earliest") | |
.option("endingOffsets", "latest") | |
.load() | |
df.selectExpr("CAST(__key AS STRING)", "CAST(value AS STRING)") | |
.as[(String, String)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment