MCPcopy Create free account
hub / github.com/araddon/qlbridge / RewriteSelect

Function RewriteSelect

rel/sql_rewrite.go:13–23  ·  view source on GitHub ↗

RewriteSelect We are removing Column Aliases "user_id as uid" as well as functions - used when we are going to defer projection, aggs

(m *SqlSelect)

Source from the content-addressed store, hash-verified

11// RewriteSelect We are removing Column Aliases "user_id as uid"
12// as well as functions - used when we are going to defer projection, aggs
13func RewriteSelect(m *SqlSelect) {
14 originalCols := m.Columns
15 m.Columns = make(Columns, 0, len(originalCols)+5)
16 rewriteIntoProjection(m, originalCols)
17 rewriteIntoProjection(m, m.GroupBy)
18 if m.Where != nil {
19 colsToAdd := expr.FindAllIdentityField(m.Where.Expr)
20 addIntoProjection(m, colsToAdd)
21 }
22 rewriteIntoProjection(m, m.OrderBy)
23}
24
25// RewriteSqlSource this Source to act as a stand-alone query to backend
26// @parentStmt = the parent statement that this a partial source to

Callers 1

RewriteAsRawSelectMethod · 0.85

Calls 3

FindAllIdentityFieldFunction · 0.92
rewriteIntoProjectionFunction · 0.85
addIntoProjectionFunction · 0.85

Tested by

no test coverage detected