Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
44d66d6
modify class CalendarInterval and CalendarIntervalSuite
LinhongLiu Oct 11, 2019
4979e1e
modify DateTimeUtils, DateTimeUtilsSuite, TemporalSequenceImpl
LinhongLiu Oct 12, 2019
f09b529
modify CalendarInterval related classes in sql/catalyst
LinhongLiu Oct 12, 2019
0db5b7a
fix test in sql/catalyst
LinhongLiu Oct 12, 2019
ce879c2
fix remaining tests
LinhongLiu Oct 14, 2019
4ee8354
fix failed tests
LinhongLiu Oct 15, 2019
3d954d6
code clean and more bug fix
LinhongLiu Oct 16, 2019
05042e8
address comments and fix tests
LinhongLiu Oct 16, 2019
4c31401
Merge remote-tracking branch 'origin/master' into calendarinterval
LinhongLiu Oct 16, 2019
064be74
fix python
LinhongLiu Oct 18, 2019
211543f
Merge remote-tracking branch 'origin/master' into calendarinterval
LinhongLiu Oct 18, 2019
0778f9a
use 24 hours = 1 day assumption in window, trigger and watermark
LinhongLiu Oct 20, 2019
3a6518a
Merge remote-tracking branch 'origin/master' into calendarinterval
LinhongLiu Oct 20, 2019
4d8383c
streaming changes followup
LinhongLiu Oct 20, 2019
1ac157e
fix conflict
LinhongLiu Oct 20, 2019
aac92bd
Merge remote-tracking branch 'origin/master' into calendarinterval
LinhongLiu Oct 26, 2019
076ce42
fix code sytle and test cases
LinhongLiu Oct 28, 2019
3d62a24
Merge remote-tracking branch 'origin/master' into calendarinterval
LinhongLiu Oct 28, 2019
2edd8a0
change long,long,long to int,int,long when store CanlendarInterval in…
LinhongLiu Oct 28, 2019
4e97bc0
fix comment
LinhongLiu Oct 29, 2019
0e87e2d
Merge remote-tracking branch 'origin/master' into calendarinterval
LinhongLiu Oct 31, 2019
2f90189
address comments
LinhongLiu Nov 1, 2019
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
fix remaining tests
  • Loading branch information
LinhongLiu committed Oct 16, 2019
commit ce879c2cf53d83152563fbdb6225b458d8a2b42b
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ private static void appendValue(WritableColumnVector dst, DataType t, Object o)
CalendarInterval c = (CalendarInterval)o;
dst.appendStruct(false);
dst.getChild(0).appendInt(c.months);
dst.getChild(1).appendLong(c.microseconds);
dst.getChild(1).appendInt(c.days);
dst.getChild(2).appendLong(c.microseconds);
} else if (t instanceof DateType) {
dst.appendInt(DateTimeUtils.fromJavaDate((Date)o));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,11 @@ protected WritableColumnVector(int capacity, DataType type) {
this.childColumns[0] = reserveNewColumn(capacity, mapType.keyType());
this.childColumns[1] = reserveNewColumn(capacity, mapType.valueType());
} else if (type instanceof CalendarIntervalType) {
// Two columns. Months as int. Microseconds as Long.
this.childColumns = new WritableColumnVector[2];
// Three columns. Months as int. Days as Int. Microseconds as Long.
this.childColumns = new WritableColumnVector[3];
this.childColumns[0] = reserveNewColumn(capacity, DataTypes.IntegerType);
this.childColumns[1] = reserveNewColumn(capacity, DataTypes.LongType);
this.childColumns[1] = reserveNewColumn(capacity, DataTypes.IntegerType);
this.childColumns[2] = reserveNewColumn(capacity, DataTypes.LongType);
} else {
this.childColumns = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,30 +636,40 @@ class ColumnarBatchSuite extends SparkFunSuite {
assert(column.arrayData().elementsAppended == 0)
}

testVector("CalendarInterval APIs", 4, CalendarIntervalType) {
testVector("CalendarInterval APIs", 5, CalendarIntervalType) {
column =>
val reference = mutable.ArrayBuffer.empty[CalendarInterval]

val months = column.getChild(0)
val microseconds = column.getChild(1)
val days = column.getChild(1)
val microseconds = column.getChild(2)
assert(months.dataType() == IntegerType)
assert(days.dataType() == IntegerType)
assert(microseconds.dataType() == LongType)

months.putInt(0, 1)
days.putInt(0, 10)
microseconds.putLong(0, 100)
reference += new CalendarInterval(1, 100)
reference += new CalendarInterval(1, 10, 100)

months.putInt(1, 0)
days.putInt(1, 0)
microseconds.putLong(1, 2000)
reference += new CalendarInterval(0, 2000)
reference += new CalendarInterval(0, 0, 2000)

column.putNull(2)
assert(column.getInterval(2) == null)
reference += null

months.putInt(3, 20)
days.putInt(3, 0)
microseconds.putLong(3, 0)
reference += new CalendarInterval(20, 0)
reference += new CalendarInterval(20, 0, 0)

months.putInt(4, 0)
days.putInt(4, 200)
microseconds.putLong(4, 0)
reference += new CalendarInterval(0, 200, 0)

reference.zipWithIndex.foreach { case (v, i) =>
val errMsg = "VectorType=" + column.getClass.getSimpleName
Expand Down