Skip to content

Commit

Permalink
updated schema & null behavior for hashtags & urls to biqquery
Browse files Browse the repository at this point in the history
  • Loading branch information
Parker-Kasiewicz committed Nov 3, 2024
1 parent 8f09c7d commit 134e704
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/hydrator/hydrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ func (h *Hydrator) flattenFullProfile(profile *bsky.ActorDefs_ProfileViewDetaile
}

func (h *Hydrator) flattenFacets(facets []*bsky.RichtextFacet) (hashtags []string, urls []string) {
hashtags = []string{}
urls = []string{}
if facets != nil {
for _, facet := range facets {
if facet != nil {
Expand Down
30 changes: 30 additions & 0 deletions pkg/output/bq/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ func GetSchema() bigquery.Schema {
"name": "RepostCount",
"type": "INTEGER"
},
{
"mode": "REPEATED",
"name": "Hashtags",
"type": "STRING"
},
{
"mode": "REPEATED",
"name": "URLs",
"type": "STRING"
},
{
"name": "Text",
"type": "STRING"
Expand Down Expand Up @@ -399,6 +409,16 @@ func GetSchema() bigquery.Schema {
"name": "ReplyParentCID",
"type": "STRING"
},
{
"mode": "REPEATED",
"name": "Hashtags",
"type": "STRING"
},
{
"mode": "REPEATED",
"name": "URLs",
"type": "STRING"
},
{
"name": "Text",
"type": "STRING"
Expand Down Expand Up @@ -566,6 +586,16 @@ func GetSchema() bigquery.Schema {
"name": "RepostCount",
"type": "INTEGER"
},
{
"mode": "REPEATED",
"name": "Hashtags",
"type": "STRING"
},
{
"mode": "REPEATED",
"name": "URLs",
"type": "STRING"
},
{
"name": "Text",
"type": "STRING"
Expand Down

0 comments on commit 134e704

Please sign in to comment.