ByteBaker commented on code in PR #18252:
URL: https://github.com/apache/datafusion/pull/18252#discussion_r2462389137
##########
datafusion-examples/examples/ffi/ffi_example_table_provider/src/lib.rs:
##########
@@ -29,7 +29,19 @@ fn create_record_batch(start_value: i32, num_values: usize)
-> RecordBatch {
let a_vals: Vec<i32> = (start_value..end_value).collect();
let b_vals: Vec<f64> = a_vals.iter().map(|v| *v as f64).collect();
- record_batch!(("a", Int32, a_vals), ("b", Float64, b_vals)).unwrap()
+ let schema = Arc::new(Schema::new(vec![
+ Field::new("a", DataType::Int32, true),
+ Field::new("b", DataType::Float64, true),
+ ]));
+
+ RecordBatch::try_new(
+ schema,
+ vec![
+ Arc::new(Int32Array::from(a_vals)),
+ Arc::new(Float64Array::from(b_vals)),
+ ],
+ )
+ .unwrap()
Review Comment:
Unfortunately, yes. And since I'm the one who wrote the other macro, I
didn't think of such use cases.
On the flip side, the purpose of this PR is to sync datafusion w/ upstream.
As we merge it now and proceed further, the task of fixing the macro could be
taken up.
--
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]