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

function: correctly transform up explode nodes #757

Merged
merged 1 commit into from
Jun 20, 2019
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
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