tustvold commented on issue #2984:
URL: https://github.com/apache/arrow-rs/issues/2984#issuecomment-1299397502

   I'm not sure what I am doing wrong here
   
   ```
   #[test]
       fn test_timestamp_round_trip() {
           let mut data = Vec::with_capacity(1024);
           let field = Arc::new(
               types::Type::primitive_type_builder("col1", Type::INT64)
                   .with_logical_type(Some(LogicalType::Timestamp {
                       is_adjusted_to_u_t_c: false,
                       unit: TimeUnit::MICROS(MicroSeconds {}),
                   }))
                   .with_repetition(Repetition::REQUIRED)
                   .build()
                   .unwrap(),
           );
           let schema = Arc::new(
               types::Type::group_type_builder("schema")
                   .with_fields(&mut vec![field.clone()])
                   .build()
                   .unwrap(),
           );
   
           let props = Arc::new(WriterProperties::builder().build());
           let mut writer =
               SerializedFileWriter::new(&mut data, schema.clone(), 
props).unwrap();
           let mut row_group_writer = writer.next_row_group().unwrap();
           let mut column_writer = 
row_group_writer.next_column().unwrap().unwrap();
           column_writer
               .typed::<Int64Type>()
               .write_batch(&[1, 2, 3, 4], None, None)
               .unwrap();
           column_writer.close().unwrap();
           row_group_writer.close().unwrap();
           writer.close().unwrap();
   
           let bytes = Bytes::from(data);
           let reader = SerializedFileReader::new(bytes).unwrap();
           assert_eq!(reader.metadata().file_metadata().schema(), 
schema.as_ref())
       }
   ```cccccchdviitcbjieuttjinuietjbtufibvefdvgbbbd


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to