| -- Automatically generated by SQLQueryTestSuite |
| -- !query |
| SELECT elt(2, col1, col2, col3, col4, col5) col |
| FROM ( |
| SELECT |
| 'prefix_' col1, |
| id col2, |
| string(id + 1) col3, |
| encode(string(id + 2), 'utf-8') col4, |
| CAST(id AS DOUBLE) col5 |
| FROM range(10) |
| ) |
| -- !query analysis |
| Project [elt(2, col1#x, cast(col2#xL as string), col3#x, cast(col4#x as string), cast(col5#x as string), false) AS col#x] |
| +- SubqueryAlias __auto_generated_subquery_name |
| +- Project [prefix_ AS col1#x, id#xL AS col2#xL, cast((id#xL + cast(1 as bigint)) as string) AS col3#x, encode(cast((id#xL + cast(2 as bigint)) as string), utf-8, false) AS col4#x, cast(id#xL as double) AS col5#x] |
| +- Range (0, 10, step=1) |
| |
| |
| -- !query |
| SELECT elt(3, col1, col2, col3, col4) col |
| FROM ( |
| SELECT |
| string(id) col1, |
| string(id + 1) col2, |
| encode(string(id + 2), 'utf-8') col3, |
| encode(string(id + 3), 'utf-8') col4 |
| FROM range(10) |
| ) |
| -- !query analysis |
| Project [elt(3, col1#x, col2#x, cast(col3#x as string), cast(col4#x as string), false) AS col#x] |
| +- SubqueryAlias __auto_generated_subquery_name |
| +- Project [cast(id#xL as string) AS col1#x, cast((id#xL + cast(1 as bigint)) as string) AS col2#x, encode(cast((id#xL + cast(2 as bigint)) as string), utf-8, false) AS col3#x, encode(cast((id#xL + cast(3 as bigint)) as string), utf-8, false) AS col4#x] |
| +- Range (0, 10, step=1) |
| |
| |
| -- !query |
| set spark.sql.function.eltOutputAsString=true |
| -- !query analysis |
| SetCommand (spark.sql.function.eltOutputAsString,Some(true)) |
| |
| |
| -- !query |
| SELECT elt(1, col1, col2) col |
| FROM ( |
| SELECT |
| encode(string(id), 'utf-8') col1, |
| encode(string(id + 1), 'utf-8') col2 |
| FROM range(10) |
| ) |
| -- !query analysis |
| Project [elt(1, cast(col1#x as string), cast(col2#x as string), false) AS col#x] |
| +- SubqueryAlias __auto_generated_subquery_name |
| +- Project [encode(cast(id#xL as string), utf-8, false) AS col1#x, encode(cast((id#xL + cast(1 as bigint)) as string), utf-8, false) AS col2#x] |
| +- Range (0, 10, step=1) |
| |
| |
| -- !query |
| set spark.sql.function.eltOutputAsString=false |
| -- !query analysis |
| SetCommand (spark.sql.function.eltOutputAsString,Some(false)) |
| |
| |
| -- !query |
| SELECT elt(2, col1, col2) col |
| FROM ( |
| SELECT |
| encode(string(id), 'utf-8') col1, |
| encode(string(id + 1), 'utf-8') col2 |
| FROM range(10) |
| ) |
| -- !query analysis |
| Project [elt(2, col1#x, col2#x, false) AS col#x] |
| +- SubqueryAlias __auto_generated_subquery_name |
| +- Project [encode(cast(id#xL as string), utf-8, false) AS col1#x, encode(cast((id#xL + cast(1 as bigint)) as string), utf-8, false) AS col2#x] |
| +- Range (0, 10, step=1) |