diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5579072effb4..a04ccb3d44f2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,7 +31,7 @@ jobs: strategy: matrix: arch: [amd64] - rust: [stable] + rust: [nightly-2021-07-04] container: image: ${{ matrix.arch }}/rust env: @@ -73,7 +73,7 @@ jobs: strategy: matrix: arch: [amd64] - rust: [stable] + rust: [nightly-2021-07-04] container: image: ${{ matrix.arch }}/rust env: @@ -126,7 +126,7 @@ jobs: strategy: matrix: arch: [amd64] - rust: [nightly-2021-07-04] + rust: [] container: image: ${{ matrix.arch }}/rust env: @@ -174,7 +174,7 @@ jobs: strategy: matrix: os: [windows-latest, macos-latest] - rust: [stable] + rust: [nightly-2021-07-04] steps: - uses: actions/checkout@v2 with: @@ -202,7 +202,7 @@ jobs: strategy: matrix: arch: [amd64] - rust: [stable] + rust: [nightly-2021-07-04] container: image: ${{ matrix.arch }}/rust env: @@ -257,7 +257,7 @@ jobs: strategy: matrix: arch: [amd64] - rust: [stable] + rust: [nightly-2021-07-04] steps: - uses: actions/checkout@v2 with: @@ -341,7 +341,7 @@ jobs: strategy: matrix: arch: [amd64] - rust: [stable] + rust: [nightly-2021-07-04] container: image: ${{ matrix.arch }}/rust env: diff --git a/arrow/src/compute/kernels/comparison.rs b/arrow/src/compute/kernels/comparison.rs index 9d11e3032db6..fc8ad991d89c 100644 --- a/arrow/src/compute/kernels/comparison.rs +++ b/arrow/src/compute/kernels/comparison.rs @@ -262,18 +262,28 @@ fn like_utf8_impl( regex } else { let mut prev_char = None; - let mut re_pattern = pat.replace(|c| { - let res = c == '%' && prev_char != Some('\\'); - prev_char = Some(c); - res - }, ".*").replace("\\%", "%"); + let mut re_pattern = pat + .replace( + |c| { + let res = c == '%' && prev_char != Some('\\'); + prev_char = Some(c); + res + }, + ".*", + ) + .replace("\\%", "%"); let mut prev_char = None; - re_pattern = re_pattern.replace(|c| { - let res = c == '_' && prev_char != Some('\\'); - prev_char = Some(c); - res - }, ".").replace("\\_", "_"); + re_pattern = re_pattern + .replace( + |c| { + let res = c == '_' && prev_char != Some('\\'); + prev_char = Some(c); + res + }, + ".", + ) + .replace("\\_", "_"); let re = RegexBuilder::new(&format!("^{}$", re_pattern)) .case_insensitive(!case_sensitive) .build() @@ -383,18 +393,28 @@ fn like_utf8_scalar_impl( } } else { let mut prev_char = None; - let mut re_pattern = right.replace(|c| { - let res = c == '%' && prev_char != Some('\\'); - prev_char = Some(c); - res - }, ".*").replace("\\%", "%"); + let mut re_pattern = right + .replace( + |c| { + let res = c == '%' && prev_char != Some('\\'); + prev_char = Some(c); + res + }, + ".*", + ) + .replace("\\%", "%"); let mut prev_char = None; - re_pattern = re_pattern.replace(|c| { - let res = c == '_' && prev_char != Some('\\'); - prev_char = Some(c); - res - }, ".").replace("\\_", "_"); + re_pattern = re_pattern + .replace( + |c| { + let res = c == '_' && prev_char != Some('\\'); + prev_char = Some(c); + res + }, + ".", + ) + .replace("\\_", "_"); let re = RegexBuilder::new(&format!("^{}$", re_pattern)) .case_insensitive(!case_sensitive) .build() diff --git a/parquet/src/file/serialized_reader.rs b/parquet/src/file/serialized_reader.rs index 688272c0b3de..f325a86fc9c2 100644 --- a/parquet/src/file/serialized_reader.rs +++ b/parquet/src/file/serialized_reader.rs @@ -138,6 +138,14 @@ impl SerializedFileReader { }) } + /// Creates file reader from a Parquet file, using pre-read metadata. + pub fn new_with_metadata(chunk_reader: R, metadata: ParquetMetaData) -> Self { + Self { + chunk_reader: Arc::new(chunk_reader), + metadata, + } + } + /// Filters row group metadata to only those row groups, /// for which the predicate function returns true pub fn filter_row_groups(