Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7bf45dd
Adds zip function to sparksql
DylanGuedes Apr 11, 2018
99848fe
Changes zip construction
DylanGuedes Apr 13, 2018
27b0bc2
Changes tests and uses builtin namespace in pyspark
DylanGuedes Apr 13, 2018
93826b6
fixes examples string and uses struct instead of arrays
DylanGuedes Apr 26, 2018
a7e29f6
working pyspark zip_lists
DylanGuedes May 11, 2018
7130fec
Fixes java version when arrays have different lengths
DylanGuedes May 11, 2018
d552216
remove unused variables
DylanGuedes May 11, 2018
1fecef4
rename zip_lists to zip
DylanGuedes May 11, 2018
f71151a
adds expression tests and uses strip margin syntax
DylanGuedes May 12, 2018
6b4bc94
Adds variable number of inputs to zip function
DylanGuedes May 15, 2018
1549928
uses foldleft instead of while for iterating
DylanGuedes May 15, 2018
9f7bba1
rewritten some notation
DylanGuedes May 16, 2018
3ba2b4f
fix dogencode generation
DylanGuedes May 17, 2018
3a59201
Adds new tests, uses lazy val and split calls
DylanGuedes May 17, 2018
6462fa8
uses splitFunction
DylanGuedes May 17, 2018
8b1eb7c
move arraytypes to private member
DylanGuedes May 18, 2018
2bfba80
adds binary and array of array tests
DylanGuedes May 18, 2018
c3b062c
uses stored array types names
DylanGuedes May 18, 2018
d9b95c4
split input function using ctxsplitexpression
DylanGuedes May 18, 2018
26bbf66
uses splitexpression for inputs
DylanGuedes May 19, 2018
d9ad04d
Refactor cases, add new tests with empty seq, check size of array
DylanGuedes May 22, 2018
f29ee1c
Check empty seq as input
DylanGuedes May 22, 2018
c58d09c
Uses switch instead of if
DylanGuedes May 23, 2018
38fa996
refactor switch and else methods
DylanGuedes May 23, 2018
5b3066b
uses if instead of switch
DylanGuedes May 30, 2018
759a4d4
Not using storedarrtype anymore
DylanGuedes Jun 4, 2018
68e69db
split between empty and nonempty codegen
DylanGuedes Jun 4, 2018
12b3835
remove ternary if
DylanGuedes Jun 4, 2018
643cb9b
Fixes null values evaluation and adds back tests
DylanGuedes Jun 4, 2018
5876082
move to else
DylanGuedes Jun 4, 2018
0223960
remove unused lines
DylanGuedes Jun 4, 2018
2b88387
use zip alias
DylanGuedes Jun 5, 2018
bbc20ee
using same docs for all apis
DylanGuedes Jun 8, 2018
8d3a838
adds transient to method
DylanGuedes Jun 8, 2018
d8f3dea
rename zip function to arrays_zip
DylanGuedes Jun 10, 2018
3d68ea9
adds pretty_name for arrays_zip
DylanGuedes Jun 11, 2018
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
Prev Previous commit
Next Next commit
uses stored array types names
Signed-off-by: DylanGuedes <[email protected]>
  • Loading branch information
DylanGuedes committed Jun 4, 2018
commit c3b062cd6bb97be56b6d36c3f55bc463e75485cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ case class Zip(children: Seq[Expression]) extends Expression with ExpectsInputTy
val arrVals = ctx.freshName("arrVals")
val arrCardinality = ctx.freshName("arrCardinality")
val biggestCardinality = ctx.freshName("biggestCardinality")
val storedArrTypes = ctx.freshName("storedArrTypes")

val inputs = evals.zipWithIndex.map { case (eval, index) =>
s"""
Expand All @@ -182,6 +183,7 @@ case class Zip(children: Seq[Expression]) extends Expression with ExpectsInputTy
| $arrVals[$index] = null;
| $arrCardinality[$index] = 0;
|}
|$storedArrTypes[$index] = "${arrayElementTypes(index)}";
|$biggestCardinality = Math.max($biggestCardinality, $arrCardinality[$index]);
""".stripMargin
}.mkString("\n")
Expand All @@ -191,10 +193,10 @@ case class Zip(children: Seq[Expression]) extends Expression with ExpectsInputTy
val i = ctx.freshName("i")
val args = ctx.freshName("args")

val fillValue = evals.zipWithIndex.map { case (eval, index) =>
val getArrValsItem = CodeGenerator.getValue(s"$arrVals[$j]", arrayElementTypes(index), i)
val fillValue = arrayElementTypes.distinct.map { case (elementType) =>
val getArrValsItem = CodeGenerator.getValue(s"$arrVals[$j]", elementType, i)
s"""
| if ($j == ${index}) {
| if ($storedArrTypes[$j] == "${elementType}") {
| $myobject[$j] = $getArrValsItem;
| }
""".stripMargin
Expand All @@ -211,6 +213,7 @@ case class Zip(children: Seq[Expression]) extends Expression with ExpectsInputTy
|ArrayData[] $arrVals = new ArrayData[$numberOfArrays];
|int[] $arrCardinality = new int[$numberOfArrays];
|int $biggestCardinality = 0;
|String[] $storedArrTypes = new String[$numberOfArrays];
|$inputs
|Object[] $args = new Object[$biggestCardinality];
|for (int $i = 0; $i < $biggestCardinality; $i ++) {
Expand Down