comphead commented on code in PR #10771:
URL: https://github.com/apache/datafusion/pull/10771#discussion_r1624656349
##########
datafusion/core/tests/parquet/mod.rs:
##########
@@ -442,6 +450,55 @@ fn make_int_batches(start: i8, end: i8) -> RecordBatch {
.unwrap()
}
+/// Return record batch with Time32Second, Time32Millisecond sequences
+fn make_time32_batches(scenario: Scenario, v: Vec<i32>) -> RecordBatch {
+ match scenario {
+ Scenario::Time32Second => {
+ let schema = Arc::new(Schema::new(vec![Field::new(
+ "second",
+ DataType::Time32(TimeUnit::Second),
+ true,
+ )]));
+ let array = Arc::new(Time32SecondArray::from(v)) as ArrayRef;
+ RecordBatch::try_new(schema, vec![array]).unwrap()
+ }
+ Scenario::Time32Millisecond => {
+ let schema = Arc::new(Schema::new(vec![Field::new(
+ "millisecond",
+ DataType::Time32(TimeUnit::Millisecond),
+ true,
+ )]));
+ let array = Arc::new(Time32MillisecondArray::from(v)) as ArrayRef;
+ RecordBatch::try_new(schema, vec![array]).unwrap()
+ }
+ _ => panic!("Unsupported scenario for Time32"),
Review Comment:
```suggestion
s => panic!("Unsupported scenario for Time32: {s}"),
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]