Skip to content

Commit

Permalink
Add RecordBatchOptions for Expand
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Apr 16, 2024
1 parent 0460f85 commit 36b5c3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/execution/datafusion/operators/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

use arrow_array::RecordBatch;
use arrow_array::{RecordBatch, RecordBatchOptions};
use arrow_schema::SchemaRef;
use datafusion::{
execution::TaskContext,
Expand Down Expand Up @@ -169,7 +169,9 @@ impl ExpandStream {
Ok::<(), DataFusionError>(())
})?;

RecordBatch::try_new(self.schema.clone(), columns).map_err(|e| e.into())
let options = RecordBatchOptions::new().with_row_count(Some(batch.num_rows()));
RecordBatch::try_new_with_options(self.schema.clone(), columns, &options)
.map_err(|e| e.into())
}
}

Expand Down

0 comments on commit 36b5c3d

Please sign in to comment.