Created
June 23, 2022 23:54
-
-
Save jingningzhang1/9a0b199cd41c839ff375079024ebafb6 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
-- DBTITLE 1,Incrementally Ingest Source Data from Raw Files | |
COPY INTO plotly_iot_dashboard.bronze_sensors | |
FROM (SELECT | |
id::bigint AS Id, | |
device_id::integer AS device_id, | |
user_id::integer AS user_id, | |
calories_burnt::decimal(10,2) AS calories_burnt, | |
miles_walked::decimal(10,2) AS miles_walked, | |
num_steps::decimal(10,2) AS num_steps, | |
timestamp::timestamp AS timestamp, | |
value AS value | |
FROM "/databricks-datasets/iot-stream/data-device/") | |
FILEFORMAT = json | |
COPY_OPTIONS('force'='true') --option to be incremental or always load all files | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment