Skip to content
Snippets Groups Projects
Commit 133495d8 authored by Cheng Hao's avatar Cheng Hao Committed by Michael Armbrust
Browse files

[SQL]Add base row updating methods for JoinedRow

This will be helpful in join operators.

Author: Cheng Hao <hao.cheng@intel.com>

Closes #1187 from chenghao-intel/joinedRow and squashes the following commits:

87c19e3 [Cheng Hao] Add base row set methods for JoinedRow
parent 8ca41769
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,18 @@ class JoinedRow extends Row {
this
}
/** Updates this JoinedRow by updating its left base row. Returns itself. */
def withLeft(newLeft: Row): Row = {
row1 = newLeft
this
}
/** Updates this JoinedRow by updating its right base row. Returns itself. */
def withRight(newRight: Row): Row = {
row2 = newRight
this
}
def iterator = row1.iterator ++ row2.iterator
def length = row1.length + row2.length
......@@ -124,4 +136,9 @@ class JoinedRow extends Row {
}
new GenericRow(copiedValues)
}
override def toString() = {
val row = (if (row1 != null) row1 else Seq[Any]()) ++ (if (row2 != null) row2 else Seq[Any]())
s"[${row.mkString(",")}]"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment