Skip to content

Commit

Permalink
AVRO-2755: Add I/O tests for the TimestampMillis logical type to Ruby (
Browse files Browse the repository at this point in the history
  • Loading branch information
sekikn committed Feb 23, 2020
1 parent ebe9080 commit 9cba857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lang/ruby/test/random_data.rb
Expand Up @@ -84,8 +84,10 @@ def logical_nextdata(schm, _d=0)
case schm.logical_type
when 'date'
Avro::LogicalTypes::IntDate.decode(rand_int)
when 'timestamp-millis', 'timestamp-micros'
when 'timestamp-micros'
Avro::LogicalTypes::TimestampMicros.decode(rand_long)
when 'timestamp-millis'
Avro::LogicalTypes::TimestampMillis.decode(rand_long)
end
end

Expand Down
5 changes: 4 additions & 1 deletion lang/ruby/test/test_io.rb
Expand Up @@ -90,7 +90,10 @@ def test_record_with_logical_type
"name": "Test",
"fields": [{"name": "ts",
"type": {"type": "long",
"logicalType": "timestamp-micros"}}]}
"logicalType": "timestamp-micros"}},
{"name": "ts2",
"type": {"type": "long",
"logicalType": "timestamp-millis"}}]}
EOS
check(record_schema)
end
Expand Down

0 comments on commit 9cba857

Please sign in to comment.