Skip to content

Commit

Permalink
add tuple expressions (#5428)
Browse files Browse the repository at this point in the history
This commit adds a tuple expression to the query language.  Since the
data model and runtime do not support native tuplesm, these expressions
are mapped onto records with columns c0, c1, ...  Datafusion does this
and other SQLs map tuples to structs with unnamed fields.

This will be needed by a subsequent PR implementing the VALUES clause.
  • Loading branch information
mccanne authored Nov 3, 2024
1 parent f812b58 commit d5118d1
Show file tree
Hide file tree
Showing 5 changed files with 3,789 additions and 3,655 deletions.
7 changes: 7 additions & 0 deletions compiler/ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ type EntryExpr struct {
Loc `json:"loc"`
}

type TupleExpr struct {
Kind string `json:"kind" unpack:""`
Elems []Expr `json:"elems"`
Loc `json:"loc"`
}

type OverExpr struct {
Kind string `json:"kind" unpack:""`
Locals []Def `json:"locals"`
Expand Down Expand Up @@ -322,6 +328,7 @@ func (*RecordExpr) ExprAST() {}
func (*ArrayExpr) ExprAST() {}
func (*SetExpr) ExprAST() {}
func (*MapExpr) ExprAST() {}
func (*TupleExpr) ExprAST() {}
func (*OverExpr) ExprAST() {}
func (*FString) ExprAST() {}

Expand Down
Loading

0 comments on commit d5118d1

Please sign in to comment.