From 9cba8570aa5d9fab9371915b048caff6e05779a1 Mon Sep 17 00:00:00 2001 From: Kengo Seki Date: Mon, 24 Feb 2020 04:55:01 +0900 Subject: [PATCH] AVRO-2755: Add I/O tests for the TimestampMillis logical type to Ruby (#826) --- lang/ruby/test/random_data.rb | 4 +++- lang/ruby/test/test_io.rb | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lang/ruby/test/random_data.rb b/lang/ruby/test/random_data.rb index bb4bb568ff5..6caccf80163 100644 --- a/lang/ruby/test/random_data.rb +++ b/lang/ruby/test/random_data.rb @@ -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 diff --git a/lang/ruby/test/test_io.rb b/lang/ruby/test/test_io.rb index 3fc145dd34a..715805545f6 100644 --- a/lang/ruby/test/test_io.rb +++ b/lang/ruby/test/test_io.rb @@ -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