Created
January 29, 2021 19:00
-
-
Save izeigerman/f9148aec88c35bc9be25c1a5d5b7a424 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| sealed trait DeviceMeasurement | |
| object DeviceMeasurement { | |
| implicit val deviceMeasurementDataSource = new DataSource[DeviceMeasurement, Unit] { | |
| override def read(parameters: Unit)(implicit spark: SparkSession) = | |
| AnnotatedDataFrame[DeviceMeasurement]( | |
| spark.createDataFrame(Seq( | |
| (0, 1.0), | |
| (0, 2.0), | |
| (1, 3.0) | |
| )) | |
| .toDF("device_model_id", "measurement_value") | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment