Skip to content

Commit

Permalink
fix: unhandled parse BQ table FQN
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jun 11, 2024
1 parent 749a210 commit fd8b816
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,10 @@ func parseBQTableFQN(fqn string) (projectID, datasetID, tableID string, err erro
ss := strings.FieldsFunc(fqn, func(r rune) bool {
return r == ':' || r == '.'
})
if len(ss) < 3 {
return "", "", "", fmt.Errorf(
"unexpected BigQuery table FQN '%s', expected in format projectID:datasetID.tableID", fqn,
)
}
return ss[0], ss[1], ss[2], nil
}

0 comments on commit fd8b816

Please sign in to comment.