Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop SQL language syntax from Zed language #5109

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions compiler/ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ func (*MapExpr) ExprAST() {}

func (*OverExpr) ExprAST() {}

func (*SQLExpr) ExprAST() {}

type ConstDecl struct {
Kind string `json:"kind" unpack:""`
Name string `json:"name"`
Expand Down Expand Up @@ -390,24 +388,6 @@ type (
Kind string `json:"kind" unpack:""`
Expr Expr `json:"expr"`
}
// A SQLExpr can be an operator, an expression inside of a SQL FROM clause,
// or an expression used as a Zed value generator. Currenly, the "select"
// keyword collides with the select() generator function (it can be parsed
// unambiguosly because of the parens but this is not user friendly
// so we need a new name for select()... see issue #2133).
// TBD: from alias, "in" over tuples, WITH sub-queries, multi-table FROM
// implying a JOIN, aliases for tables in FROM and JOIN.
SQLExpr struct {
Kind string `json:"kind" unpack:""`
Select []Assignment `json:"select"`
From *SQLFrom `json:"from"`
Joins []SQLJoin `json:"joins"`
Where Expr `json:"where"`
GroupBy []Expr `json:"group_by"`
Having Expr `json:"having"`
OrderBy *SQLOrderBy `json:"order_by"`
Limit int `json:"limit"`
}
Shape struct {
Kind string `json:"kind" unpack:""`
}
Expand Down Expand Up @@ -489,25 +469,6 @@ type Case struct {
Path Seq `json:"path"`
}

type SQLFrom struct {
Table Expr `json:"table"`
Alias Expr `json:"alias"`
}

type SQLOrderBy struct {
Kind string `json:"kind" unpack:""`
Keys []Expr `json:"keys"`
Order order.Which `json:"order"`
}

type SQLJoin struct {
Table Expr `json:"table"`
Style string `json:"style"`
LeftKey Expr `json:"left_key"`
RightKey Expr `json:"right_key"`
Alias Expr `json:"alias"`
}

type Assignment struct {
Kind string `json:"kind" unpack:""`
LHS Expr `json:"lhs"`
Expand Down Expand Up @@ -552,8 +513,6 @@ func (*Sample) OpAST() {}
func (*Load) OpAST() {}
func (*Assert) OpAST() {}

func (*SQLExpr) OpAST() {}

func (seq *Seq) Prepend(front Op) {
*seq = append([]Op{front}, *seq...)
}
Expand Down
2 changes: 0 additions & 2 deletions compiler/ast/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ var unpacker = unpack.New(
astzed.Set{},
SetExpr{},
Spread{},
SQLExpr{},
SQLOrderBy{},
SliceExpr{},
Sort{},
String{},
Expand Down
Loading
Loading