Created
January 29, 2021 19:00
-
-
Save izeigerman/fe0533335881206b4b125273191dfa80 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 DeviceModel | |
| object DeviceModel { | |
| implicit val deviceModelDataSource = new DataSource[DeviceModel, Unit] { | |
| override def read(parameters: Unit)(implicit spark: SparkSession) = | |
| AnnotatedDataFrame[DeviceModel]( | |
| spark | |
| .createDataFrame(Seq( | |
| (0, "model_0"), | |
| (1, "model_1") | |
| )) | |
| .toDF("device_model_id", "model_name") | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment