Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Commit

Permalink
function: correctly transform up explode nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
  • Loading branch information
erizocosmico committed Jun 20, 2019
1 parent eaab179 commit fc71411
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,16 @@ var generatorQueries = []struct {
{int64(3), "f", "third"},
},
},
{
`SELECT EXPLODE(SPLIT(c, "")) FROM t LIMIT 5`,
[]sql.Row{
{"f"},
{"i"},
{"r"},
{"s"},
{"t"},
},
},
{
`SELECT a, EXPLODE(b) AS x, c FROM t WHERE x = 'e'`,
[]sql.Row{
Expand Down
2 changes: 1 addition & 1 deletion sql/expression/function/explode.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (e *Generate) String() string {

// TransformUp implements the sql.Expression interface.
func (e *Generate) TransformUp(f sql.TransformExprFunc) (sql.Expression, error) {
c, err := f(e.Child)
c, err := e.Child.TransformUp(f)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit fc71411

Please sign in to comment.