Skip to content

Commit cc1444a

Browse files
committed
Merge remote-tracking branch 'origin/main' into rowselectionempty
2 parents 2d3bcd6 + 2eabb59 commit cc1444a

File tree

24 files changed

+2959
-317
lines changed

24 files changed

+2959
-317
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
steps:
7272
- uses: actions/checkout@v5
7373
- name: Download crate docs
74-
uses: actions/download-artifact@v5
74+
uses: actions/download-artifact@v6
7575
with:
7676
name: crate-docs
7777
path: website/build

arrow-cast/src/cast/run_array.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ pub(crate) fn cast_to_run_end_encoded<K: RunEndIndexType>(
136136

137137
// Partition the array to identify runs of consecutive equal values
138138
let partitions = partition(&[Arc::clone(cast_array)])?;
139-
let mut run_ends = Vec::new();
140-
let mut values_indexes = Vec::new();
139+
let size = partitions.len();
140+
let mut run_ends = Vec::with_capacity(size);
141+
let mut values_indexes = Vec::with_capacity(size);
141142
let mut last_partition_end = 0;
142143
for partition in partitions.ranges() {
143144
values_indexes.push(last_partition_end);

arrow-flight/tests/flight_sql_client_cli.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ use tonic::{Request, Response, Status, Streaming};
4646

4747
const QUERY: &str = "SELECT * FROM table;";
4848

49+
/// Return a Command instance for running the `flight_sql_client` CLI
50+
fn flight_sql_client_cmd() -> Command {
51+
Command::new(assert_cmd::cargo::cargo_bin!("flight_sql_client"))
52+
}
53+
4954
#[tokio::test]
5055
async fn test_simple() {
5156
let test_server = FlightSqlServiceImpl::default();
5257
let fixture = TestFixture::new(test_server.service()).await;
5358
let addr = fixture.addr;
5459

5560
let stdout = tokio::task::spawn_blocking(move || {
56-
Command::cargo_bin("flight_sql_client")
57-
.unwrap()
61+
flight_sql_client_cmd()
5862
.env_clear()
5963
.env("RUST_BACKTRACE", "1")
6064
.env("RUST_LOG", "warn")
@@ -94,8 +98,7 @@ async fn test_get_catalogs() {
9498
let addr = fixture.addr;
9599

96100
let stdout = tokio::task::spawn_blocking(move || {
97-
Command::cargo_bin("flight_sql_client")
98-
.unwrap()
101+
flight_sql_client_cmd()
99102
.env_clear()
100103
.env("RUST_BACKTRACE", "1")
101104
.env("RUST_LOG", "warn")
@@ -133,8 +136,7 @@ async fn test_get_db_schemas() {
133136
let addr = fixture.addr;
134137

135138
let stdout = tokio::task::spawn_blocking(move || {
136-
Command::cargo_bin("flight_sql_client")
137-
.unwrap()
139+
flight_sql_client_cmd()
138140
.env_clear()
139141
.env("RUST_BACKTRACE", "1")
140142
.env("RUST_LOG", "warn")
@@ -173,8 +175,7 @@ async fn test_get_tables() {
173175
let addr = fixture.addr;
174176

175177
let stdout = tokio::task::spawn_blocking(move || {
176-
Command::cargo_bin("flight_sql_client")
177-
.unwrap()
178+
flight_sql_client_cmd()
178179
.env_clear()
179180
.env("RUST_BACKTRACE", "1")
180181
.env("RUST_LOG", "warn")
@@ -212,8 +213,7 @@ async fn test_get_tables_db_filter() {
212213
let addr = fixture.addr;
213214

214215
let stdout = tokio::task::spawn_blocking(move || {
215-
Command::cargo_bin("flight_sql_client")
216-
.unwrap()
216+
flight_sql_client_cmd()
217217
.env_clear()
218218
.env("RUST_BACKTRACE", "1")
219219
.env("RUST_LOG", "warn")
@@ -253,8 +253,7 @@ async fn test_get_tables_types() {
253253
let addr = fixture.addr;
254254

255255
let stdout = tokio::task::spawn_blocking(move || {
256-
Command::cargo_bin("flight_sql_client")
257-
.unwrap()
256+
flight_sql_client_cmd()
258257
.env_clear()
259258
.env("RUST_BACKTRACE", "1")
260259
.env("RUST_LOG", "warn")
@@ -295,8 +294,7 @@ async fn test_do_put_prepared_statement(test_server: FlightSqlServiceImpl) {
295294
let addr = fixture.addr;
296295

297296
let stdout = tokio::task::spawn_blocking(move || {
298-
Command::cargo_bin("flight_sql_client")
299-
.unwrap()
297+
flight_sql_client_cmd()
300298
.env_clear()
301299
.env("RUST_BACKTRACE", "1")
302300
.env("RUST_LOG", "warn")

arrow/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ There are several [examples](https://github.com/apache/arrow-rs/tree/main/arrow/
2929

3030
The API documentation for most recent, unreleased code is available [here](https://arrow.apache.org/rust/arrow/index.html).
3131

32+
## Arrow Implementation Status
33+
34+
Please see the [Implementation Status Page] on the Apache Arrow website for which
35+
Arrow features are supported by this crate.
36+
37+
[Implementation Status Page]: https://arrow.apache.org/docs/status.html
38+
39+
3240
## Rust Version Compatibility
3341

3442
This crate is tested with the latest stable version of Rust. We do not currently test against other, older versions.

parquet-variant-compute/src/type_conversion.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ macro_rules! non_generic_conversion_single_value {
194194
($array:expr, $cast_fn:expr, $index:expr) => {{
195195
let array = $array;
196196
if array.is_null($index) {
197-
Variant::Null
197+
Ok(Variant::Null)
198198
} else {
199199
let cast_value = $cast_fn(array.value($index));
200-
Variant::from(cast_value)
200+
Ok(Variant::from(cast_value))
201201
}
202202
}};
203203
}
@@ -217,6 +217,23 @@ macro_rules! generic_conversion_single_value {
217217
}
218218
pub(crate) use generic_conversion_single_value;
219219

220+
macro_rules! generic_conversion_single_value_with_result {
221+
($t:ty, $method:ident, $cast_fn:expr, $input:expr, $index:expr) => {{
222+
let arr = $input.$method::<$t>();
223+
let v = arr.value($index);
224+
match ($cast_fn)(v) {
225+
Ok(var) => Ok(Variant::from(var)),
226+
Err(e) => Err(ArrowError::CastError(format!(
227+
"Cast failed at index {idx} (array type: {ty}): {e}",
228+
idx = $index,
229+
ty = <$t as ::arrow::datatypes::ArrowPrimitiveType>::DATA_TYPE
230+
))),
231+
}
232+
}};
233+
}
234+
235+
pub(crate) use generic_conversion_single_value_with_result;
236+
220237
/// Convert the value at a specific index in the given array into a `Variant`.
221238
macro_rules! primitive_conversion_single_value {
222239
($t:ty, $input:expr, $index:expr) => {{

0 commit comments

Comments
 (0)