Skip to content

Instantly share code, notes, and snippets.

@mshakhomirov
Created November 27, 2022 11:21
Show Gist options
  • Save mshakhomirov/1eb179de99aa1c13fc2f67c3f273755c to your computer and use it in GitHub Desktop.
Save mshakhomirov/1eb179de99aa1c13fc2f67c3f273755c to your computer and use it in GitHub Desktop.
config {
type: "view",
name: "reputation_data_v",
schema: "production",
dependencies: "reputation_data",
tags: ["reputation_data"]
}
select
cast(json_extract(src,'$.user_id') as int64) as user_id
,cast(json_extract(src,'$.reputation_level') as float64) as reputation_level
,cast(json_extract_scalar(src, '$.updated_at') as timestamp) as updated_at
from
${ref("reputation_data")} --production.reputation_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment