@@ -39,13 +39,13 @@ func pushdown(ctx *sql.Context, a *Analyzer, n sql.Node) (sql.Node, error) {
3939 // First step is to find all col exprs and group them by the table they mention.
4040 // Even if they appear multiple times, only the first one will be used.
4141 plan .InspectExpressions (n , func (e sql.Expression ) bool {
42- if e , ok := e .(* expression.GetField ); ok {
43- tf := tableField {e .Table (), e .Name ()}
42+ if gf , ok := e .(* expression.GetField ); ok {
43+ tf := tableField {gf .Table (), gf .Name ()}
4444 if _ , ok := tableFields [tf ]; ! ok {
45- a .Log ("found used column %s.%s" , e .Table (), e .Name ())
45+ a .Log ("found used column %s.%s" , gf .Table (), gf .Name ())
4646 tableFields [tf ] = struct {}{}
47- fieldsByTable [e .Table ()] = append (fieldsByTable [e .Table ()], e .Name ())
48- exprsByTable [e .Table ()] = append (exprsByTable [e .Table ()], e )
47+ fieldsByTable [gf .Table ()] = append (fieldsByTable [gf .Table ()], gf .Name ())
48+ exprsByTable [gf .Table ()] = append (exprsByTable [gf .Table ()], gf )
4949 }
5050 }
5151 return true
@@ -59,14 +59,14 @@ func pushdown(ctx *sql.Context, a *Analyzer, n sql.Node) (sql.Node, error) {
5959
6060 // then find all filters, also by table. Note that filters that mention
6161 // more than one table will not be passed to neither.
62- filters := make (filters )
62+ filt := make (filters )
6363 plan .Inspect (n , func (node sql.Node ) bool {
6464 a .Log ("inspecting node of type: %T" , node )
6565 switch node := node .(type ) {
6666 case * plan.Filter :
6767 fs := exprToTableFilters (node .Expression )
6868 a .Log ("found filters for %d tables %s" , len (fs ), node .Expression )
69- filters .merge (fs )
69+ filt .merge (fs )
7070 }
7171 return true
7272 })
@@ -118,7 +118,7 @@ func pushdown(ctx *sql.Context, a *Analyzer, n sql.Node) (sql.Node, error) {
118118 var table = node .Table
119119
120120 if ft , ok := table .(sql.FilteredTable ); ok {
121- tableFilters := filters [node .Name ()]
121+ tableFilters := filt [node .Name ()]
122122 handled := ft .HandledFilters (tableFilters )
123123 handledFilters = append (handledFilters , handled ... )
124124 schema := node .Schema ()
0 commit comments