8000 Update issue table name · coder/labeler@692046d · GitHub
[go: up one dir, main page]

Skip to content

Commit 692046d

Browse files
committed
Update issue table name
1 parent d7d8ec1 commit 692046d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

indexer.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ func (s *Indexer) embedIssue(ctx context.Context, issue *github.Issue) ([]float6
9191
return f32to64(resp.Data[0].Embedding), nil
9292
}
9393

94+
// issuesTableName is incremented with major schema changes since DML on
95+
// active tables is very slow.
96+
const issuesTableName = "issues_v2"
97+
9498
func (s *Indexer) issuesTable() *bigquery.Table {
95-
return s.BigQuery.Dataset("ghindex").Table("issues")
99+
return s.BigQuery.Dataset("ghindex").Table(issuesTableName)
96100
}
97101

98102
// getUpdatedAts helps avoid duplicate inserts by letting the caller skip over
@@ -106,7 +110,7 @@ func (s *Indexer) getUpdatedAts(ctx context.Context, installID int64) (map[int64
106110
inserted_at,
107111
ROW_NUMBER() OVER (PARTITION BY inserted_at, id ORDER BY inserted_at DESC) AS rn
108112
FROM
109-
` + "`coder-labeler.ghindex.issues`" + `
113+
` + "`coder-labeler.ghindex." + issuesTableName + "`" + `
110114
WHERE install_id = @install_id
111115
)
112116
SELECT

0 commit comments

Comments
 (0)
0