Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkharderdev committed Jul 16, 2022
1 parent 8ae0f26 commit 39a872f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
42 changes: 21 additions & 21 deletions arrow-flight/src/arrow.flight.protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::HandshakeRequest>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::HandshakeResponse>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::HandshakeResponse>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -308,9 +308,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Criteria>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::FlightInfo>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::FlightInfo>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand Down Expand Up @@ -389,9 +389,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Ticket>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -418,9 +418,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::FlightData>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::PutResult>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::PutResult>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -446,9 +446,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::FlightData>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::FlightData>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -475,9 +475,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Action>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::Result>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::Result>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand All @@ -501,9 +501,9 @@ pub mod flight_service_client {
&mut self,
request: impl tonic::IntoRequest<super::Empty>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::ActionType>>,
tonic::Status,
> {
tonic::Response<tonic::codec::Streaming<super::ActionType>>,
tonic::Status,
> {
self.inner
.ready()
.await
Expand Down
2 changes: 1 addition & 1 deletion arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bench = false
ahash = { version = "0.7", default-features = false }
serde = { version = "1.0", default-features = false }
serde_derive = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["preserve_order","std"] }
serde_json = { version = "1.0", default-features = false, features = ["preserve_order"] }
indexmap = { version = "1.9", default-features = false, features = ["std"] }
rand = { version = "0.8", default-features = false, features = ["std", "std_rng"], optional = true }
num = { version = "0.4", default-features = false, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion parquet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ brotli = { version = "3.3", default-features = false, features = [ "std" ] }
flate2 = { version = "1.0", default-features = false, features = [ "rust_backend" ] }
lz4 = { version = "1.23", default-features = false }
zstd = { version = "0.11", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["preserve_order","std"] }
serde_json = { version = "1.0", default-features = false, features = ["preserve_order"] }
arrow = { path = "../arrow", version = "18.0.0", default-features = false, features = ["ipc", "test_utils", "prettyprint"] }

[package.metadata.docs.rs]
Expand Down
7 changes: 3 additions & 4 deletions parquet/src/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,7 @@ pub(crate) mod private {
fn skip(decoder: &mut PlainDecoderDetails, num_values: usize) -> Result<usize> {
let bit_reader = decoder.bit_reader.as_mut().unwrap();
let num_values = std::cmp::min(num_values, decoder.num_values);
let mut buffer = vec![false; num_values];
let values_read = bit_reader.get_batch(&mut buffer[..num_values], 1);
let values_read = bit_reader.skip(num_values, 1);
decoder.num_values -= values_read;
Ok(values_read)
}
Expand Down Expand Up @@ -778,7 +777,7 @@ pub(crate) mod private {
#[inline]
fn skip(decoder: &mut PlainDecoderDetails, num_values: usize) -> Result<usize> {
let data = decoder.data.as_ref().expect("set_data should have been called");
let num_values = std::cmp::min(num_values, decoder.num_values);
let num_values = num_values.min(decoder.num_values);
let bytes_left = data.len() - decoder.start;
let bytes_to_skip = std::mem::size_of::<Self>() * num_values;

Expand Down Expand Up @@ -987,7 +986,7 @@ pub(crate) mod private {
.data
.as_mut()
.expect("set_data should have been called");
let num_values = std::cmp::min(num_values, decoder.num_values);
let num_values = num_values.min(decoder.num_values);

for _ in 0..num_values {
let len: usize =
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/encodings/rle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ mod tests {
"eee", "fff", "ddd", "eee", "fff", "eee", "fff",
"fff",
];
let skipped = decoder.skip(4).expect("skipping two values");
let skipped = decoder.skip(4).expect("skipping four values");
assert_eq!(skipped, 4);
let remainder = decoder.get_batch_with_dict::<&str>(
dict.as_slice(),
Expand Down
9 changes: 0 additions & 9 deletions parquet/src/util/bit_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,15 +642,6 @@ impl BitReader {

let mut values_skipped = 0;

if num_bits > 32 {
// No fast path - read values individually
while values_skipped < num_values {
self.skip_value(num_bits);
values_skipped += 1;
}
return num_values;
}

// First align bit offset to byte offset
if self.bit_offset != 0 {
while values_skipped < num_values && self.bit_offset != 0 {
Expand Down

0 comments on commit 39a872f

Please sign in to comment.