Jefffrey commented on code in PR #18252:
URL: https://github.com/apache/datafusion/pull/18252#discussion_r2462414728
##########
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:
It might be better to keep the old macros in this case and only migrate the
uses which can be replaced with upstream version; that way we can track where
in the codebase to replace the old macros
--
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]