Skip to content
Closed
Changes from 1 commit
Commits
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
Move the row encoder test out of flag
  • Loading branch information
MaxGekk committed Oct 11, 2019
commit ce397ce52aab62c477dd23e5d40d43cf8d948692
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,13 @@ class RowEncoderSuite extends CodegenInterpretedPlanTest {
}

test("encoding/decoding CalendarIntervalType to/from java.time.Duration") {
withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") {
val schema = new StructType().add("i", CalendarIntervalType)
val encoder = RowEncoder(schema).resolveAndBind()
val duration = java.time.Duration.parse("P2DT3H4M")
val row = encoder.toRow(Row(duration))
assert(row.getInterval(0) === DateTimeUtils.durationToInterval(duration))
val readback = encoder.fromRow(row)
assert(readback.get(0).equals(duration))
}
val schema = new StructType().add("i", CalendarIntervalType)
val encoder = RowEncoder(schema).resolveAndBind()
val duration = java.time.Duration.parse("P2DT3H4M")
val row = encoder.toRow(Row(duration))
assert(row.getInterval(0) === DateTimeUtils.durationToInterval(duration))
val readback = encoder.fromRow(row)
assert(readback.get(0).equals(duration))
}

for {
Expand Down