You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mn-mikke <gi...@git.apache.org> on 2018/05/15 13:39:01 UTC
[GitHub] spark issue #21045: [WIP][SPARK-23931][SQL] Adds zip function to sparksql
Github user mn-mikke commented on the issue:
https://github.com/apache/spark/pull/21045
@DylanGuedes What about `eval.value`?
Example:
```
val evals = children.map(_.genCode(ctx))
val args = ctx.freshName("args")
val inputs = evals.zipWithIndex.map { case (eval, index) =>
s"""
${eval.code}
if (!${eval.isNull}) {
$args[$index] = ${eval.value};
}
"""
}.mkString("\n")
val result =
s"""
ArrayData[] $args = new ArrayData[${evals.length}];
$inputs
...your transformation logic
"""
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org