-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't write Dataset[SensorData] to Kafka without transformation #6
Comments
@konobey |
@Kiollpt I'm sorry for this error in the code. This should do the trick:
Then, the kvStream can be written to Kafka:
|
@maasg Thank you for the method |
About the action in val KafkaSchema = Encoders.product[SensorData].schema
val iotData = rawData
.select(from_json($"value".cast("string"),KafkaSchema) as "record")
.select("record.*").as[SensorData] |
@maasg Thanks! Could you fix the code in notebook, please? |
Hello!
The code in notebook kafka-sensor-data-generator.snb.ipynb:
doesn't work because sensorValues is of type Dataset[SensorData], but there should be value attribute of type String concatenating all the attributes from Dataset[SensorData] row.
The text was updated successfully, but these errors were encountered: