Skip to content

Commit

Permalink
Rest of BRecord changes for tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
LDonoughe-mdsol committed Dec 28, 2022
1 parent 132ae86 commit d2eccc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/test/avro/BRecord.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{ "name": "b0", "type": "string" },
{ "name": "b1", "type": ["null", "int"] },
{ "name": "b2", "type": ["null", "double"] },
{ "name": "b3", "type": {"type": "long", "logicalType": "timestamp-millis" }}
{ "name": "b3", "type": {"type": "long", "logicalType": "timestamp-millis" }},
{ "name": "b4", "type": "string" }
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DelimitedRowEncoderTest

property("encode non-nested avro property") {
def csvLine(b: BRecord): String =
s"${b.b0},${b.b1.getOrElse("")},${b.b2.getOrElse("")},${b.b3.toEpochMilli}${System.lineSeparator()}"
s"${b.b0},${b.b1.getOrElse("")},${b.b2.getOrElse("")},${b.b3.toEpochMilli},${b.b4}${System.lineSeparator()}"
val encoder = getTypedRowEncoder[BRecord]()
forAll { test: BRecord =>
encoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class AvroUtilsTest extends PropSpec {
.set("b1", spec.b1.getOrElse(null)) // orNull won't work here
.set("b2", spec.b2.getOrElse(null)) // orNull won't work here
.set("b3", spec.b3.toEpochMilli)
.set("b4", spec.b4)
.build()

def fromSpecCRecord(spec: CRecord): GenericRecord =
Expand Down

0 comments on commit d2eccc9

Please sign in to comment.