Skip to content

Commit

Permalink
revert small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zachschuermann committed Feb 28, 2025
1 parent e05fdfa commit 5063f8c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions kernel/src/engine/default/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::arrow::json::ReaderBuilder;
use crate::arrow::record_batch::RecordBatch;
use bytes::{Buf, Bytes};
use futures::stream::{self, BoxStream};
use futures::{StreamExt, TryStreamExt};
use futures::{ready, StreamExt, TryStreamExt};
use object_store::path::Path;
use object_store::{DynObjectStore, GetResultPayload};
use tracing::warn;
Expand Down Expand Up @@ -204,8 +204,7 @@ impl JsonOpener {
let batch_size = self.batch_size;

let path = Path::from_url_path(file_meta.location.path())?;
let get_result = store.get(&path).await?;
match get_result.payload {
match store.get(&path).await?.payload {
GetResultPayload::File(file, _) => {
let reader = ReaderBuilder::new(schema)
.with_batch_size(batch_size)
Expand All @@ -220,10 +219,10 @@ impl JsonOpener {
let mut input = s.map_err(Error::from);
let mut buffered = Bytes::new();

let stream = futures::stream::poll_fn(move |cx| {
let s = futures::stream::poll_fn(move |cx| {
loop {
if buffered.is_empty() {
buffered = match futures::ready!(input.poll_next_unpin(cx)) {
buffered = match ready!(input.poll_next_unpin(cx)) {
Some(Ok(b)) => b,
Some(Err(e)) => return Poll::Ready(Some(Err(e))),
None => break,
Expand All @@ -250,7 +249,7 @@ impl JsonOpener {

Poll::Ready(decoder.flush().map_err(Error::from).transpose())
});
Ok(stream.map_err(Error::from).boxed())
Ok(s.map_err(Error::from).boxed())
}
}
}
Expand Down

0 comments on commit 5063f8c

Please sign in to comment.