dataSourcePlan.go 670 B

1234567891011121314151617181920212223242526272829303132
  1. package planner
  2. import "github.com/emqx/kuiper/xsql"
  3. type DataSourcePlan struct {
  4. baseLogicalPlan
  5. name string
  6. isWildCard bool
  7. needMeta bool
  8. // if is wildCard, leave it empty
  9. fields xsql.Fields
  10. metaFields xsql.Fields
  11. alias xsql.Fields
  12. }
  13. func (p DataSourcePlan) Init() *DataSourcePlan {
  14. p.baseLogicalPlan.self = &p
  15. return &p
  16. }
  17. // Presume no children for data source
  18. func (p *DataSourcePlan) PushDownPredicate(condition xsql.Expr) (xsql.Expr, LogicalPlan) {
  19. if condition != nil {
  20. // Add a filter plan for children
  21. f := FilterPlan{
  22. condition: condition,
  23. }.Init()
  24. f.SetChildren([]LogicalPlan{p})
  25. return nil, f
  26. }
  27. return nil, p
  28. }