Skip to content

Commit 6764aba

Browse files
authored
Merge pull request #2328 from PsiACE/bump-arrow2
[deps] bump arrow2 & try arrow-format
2 parents b51f768 + 2c4e913 commit 6764aba

26 files changed

+138
-150
lines changed

Cargo.lock

Lines changed: 27 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/arrow/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ edition = "2021"
88

99
[features]
1010
default = ["arrow-default", "parquet-default"]
11-
arrow-default = ["arrow/compute", "arrow/regex", "arrow/merge_sort", "arrow/io_csv", "arrow/io_parquet", "arrow/io_json"]
12-
parquet-default = ["parquet2/stream"]
11+
arrow-default = ["arrow/compute", "arrow/regex", "arrow/merge_sort", "arrow/io_csv", "arrow/io_parquet", "arrow/io_json", "arrow/io_flight"]
12+
parquet-default = ["parquet2/stream", "parquet2/lz4"]
1313
simd = ["arrow/simd"]
1414

1515
[dependencies] # In alphabetical order
1616
# Workspace dependencies
1717

1818
# Github dependencies
19-
arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", default-features = false, rev = "3f3d76c" }
20-
arrow-flight = { git="https://github.com/datafuse-extras/arrow2", rev = "3f3d76c" }
21-
parquet2 = { version = "0.5", optional = false, default_features = false, features = ["stream", "lz4"] }
19+
arrow = { package = "arrow2", git="https://github.com/datafuse-extras/arrow2", default-features = false, rev = "bd8f02b" }
20+
arrow-format = { version = "0.2.1", features = ["flight-data", "flight-service"]}
21+
parquet2 = { version = "0.6", default_features = false }
2222
# Crates.io dependencies
2323

2424
[dev-dependencies]

common/arrow/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
// limitations under the License.
1414

1515
pub use arrow;
16-
pub use arrow_flight;
16+
pub use arrow_format;
1717
pub use parquet2 as parquet;

common/datavalues/src/arrays/arithmetic.rs

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,9 @@ where T: DFPrimitiveType
9898
type Output = Result<DFPrimitiveArray<T>>;
9999

100100
fn add(self, rhs: Self) -> Self::Output {
101-
arithmetic_helper(
102-
self,
103-
rhs,
104-
basic::add::add,
105-
basic::add::add_scalar,
106-
|lhs, rhs| lhs + rhs,
107-
)
101+
arithmetic_helper(self, rhs, basic::add, basic::add_scalar, |lhs, rhs| {
102+
lhs + rhs
103+
})
108104
}
109105
}
110106

@@ -121,13 +117,9 @@ where
121117
type Output = Result<DFPrimitiveArray<T>>;
122118

123119
fn sub(self, rhs: Self) -> Self::Output {
124-
arithmetic_helper(
125-
self,
126-
rhs,
127-
basic::sub::sub,
128-
basic::sub::sub_scalar,
129-
|lhs, rhs| lhs - rhs,
130-
)
120+
arithmetic_helper(self, rhs, basic::sub, basic::sub_scalar, |lhs, rhs| {
121+
lhs - rhs
122+
})
131123
}
132124
}
133125

@@ -145,13 +137,9 @@ where
145137
type Output = Result<DFPrimitiveArray<T>>;
146138

147139
fn mul(self, rhs: Self) -> Self::Output {
148-
arithmetic_helper(
149-
self,
150-
rhs,
151-
basic::mul::mul,
152-
basic::mul::mul_scalar,
153-
|lhs, rhs| lhs * rhs,
154-
)
140+
arithmetic_helper(self, rhs, basic::mul, basic::mul_scalar, |lhs, rhs| {
141+
lhs * rhs
142+
})
155143
}
156144
}
157145

@@ -170,13 +158,9 @@ where
170158
type Output = Result<DFPrimitiveArray<T>>;
171159

172160
fn div(self, rhs: Self) -> Self::Output {
173-
arithmetic_helper(
174-
self,
175-
rhs,
176-
basic::div::div,
177-
basic::div::div_scalar,
178-
|lhs, rhs| lhs / rhs,
179-
)
161+
arithmetic_helper(self, rhs, basic::div, basic::div_scalar, |lhs, rhs| {
162+
lhs / rhs
163+
})
180164
}
181165
}
182166

@@ -244,13 +228,10 @@ where
244228
}
245229

246230
_ => {
247-
let array = arithmetic_helper(
248-
self,
249-
rhs,
250-
basic::rem::rem,
251-
basic::rem::rem_scalar,
252-
|lhs, rhs| lhs % rhs,
253-
)?;
231+
let array =
232+
arithmetic_helper(self, rhs, basic::rem, basic::rem_scalar, |lhs, rhs| {
233+
lhs % rhs
234+
})?;
254235
Ok(array.into_series())
255236
}
256237
}
@@ -388,14 +369,14 @@ where
388369
fn pow_f32(&self, exp: f32) -> DFFloat32Array {
389370
let arr = self.cast_with_type(&DataType::Float32).expect("f32 array");
390371
let arr = arr.f32().unwrap();
391-
DFFloat32Array::new(basic::pow::powf_scalar(&arr.array, exp))
372+
DFFloat32Array::new(basic::powf_scalar(&arr.array, exp))
392373
}
393374

394375
fn pow_f64(&self, exp: f64) -> DFFloat64Array {
395376
let arr = self.cast_with_type(&DataType::Float64).expect("f64 array");
396377
let arr = arr.f64().unwrap();
397378

398-
DFFloat64Array::new(basic::pow::powf_scalar(&arr.array, exp))
379+
DFFloat64Array::new(basic::powf_scalar(&arr.array, exp))
399380
}
400381
}
401382

common/datavalues/src/arrays/ops/agg.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ where
8383
+ NumCast
8484
+ Zero
8585
+ Into<DataValue>
86-
+ AsPrimitive<T::LargestType>,
86+
+ AsPrimitive<T::LargestType>
87+
+ std::iter::Sum,
8788

8889
T::LargestType: Into<DataValue> + AddAssign + Default,
8990

common/meta/embedded/src/meta_api_impl.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use std::sync::Arc;
1717

1818
use async_trait::async_trait;
1919
use common_arrow::arrow::datatypes::Schema;
20+
use common_arrow::arrow::io::flight::serialize_schema;
2021
use common_arrow::arrow::io::ipc::write::common::IpcWriteOptions;
21-
use common_arrow::arrow_flight::utils::flight_data_from_arrow_schema;
22-
use common_arrow::arrow_flight::FlightData;
22+
use common_arrow::arrow_format::flight::data::FlightData;
2323
use common_exception::ErrorCode;
2424
use common_exception::Result;
2525
use common_meta_api::MetaApi;
@@ -118,7 +118,7 @@ impl MetaApi for MetaEmbedded {
118118
tracing::info!("create table: {:}: {:?}", &db_name, &table_name);
119119

120120
let options = IpcWriteOptions::default();
121-
let flight_data = flight_data_from_arrow_schema(&plan.schema.to_arrow(), &options);
121+
let flight_data = serialize_schema(&plan.schema.to_arrow(), &options);
122122

123123
let table = Table {
124124
table_id: 0,

common/meta/flight/src/flight_action.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::convert::TryInto;
1616
use std::io::Cursor;
1717
use std::sync::Arc;
1818

19-
use common_arrow::arrow_flight::Action;
19+
use common_arrow::arrow_format::flight::data::Action;
2020
use common_exception::ErrorCode;
2121
use common_meta_types::CreateDatabaseReply;
2222
use common_meta_types::CreateTableReply;

common/meta/flight/src/flight_client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
use std::convert::TryInto;
1616
use std::time::Duration;
1717

18-
use common_arrow::arrow_flight::flight_service_client::FlightServiceClient;
19-
use common_arrow::arrow_flight::Action;
20-
use common_arrow::arrow_flight::BasicAuth;
21-
use common_arrow::arrow_flight::HandshakeRequest;
18+
use common_arrow::arrow_format::flight::data::Action;
19+
use common_arrow::arrow_format::flight::data::BasicAuth;
20+
use common_arrow::arrow_format::flight::data::HandshakeRequest;
21+
use common_arrow::arrow_format::flight::service::flight_service_client::FlightServiceClient;
2222
use common_exception::ErrorCode;
2323
use common_exception::Result;
2424
use common_flight_rpc::ConnectionFactory;

common/meta/flight/src/tests/flight_server.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ use std::pin::Pin;
1616
use std::thread::sleep;
1717
use std::time::Duration;
1818

19-
use common_arrow::arrow_flight::flight_service_server::FlightService;
20-
use common_arrow::arrow_flight::flight_service_server::FlightServiceServer;
21-
use common_arrow::arrow_flight::Action;
22-
use common_arrow::arrow_flight::ActionType;
23-
use common_arrow::arrow_flight::Criteria;
24-
use common_arrow::arrow_flight::Empty;
25-
use common_arrow::arrow_flight::FlightData;
26-
use common_arrow::arrow_flight::FlightDescriptor;
27-
use common_arrow::arrow_flight::FlightInfo;
28-
use common_arrow::arrow_flight::HandshakeRequest;
29-
use common_arrow::arrow_flight::HandshakeResponse;
30-
use common_arrow::arrow_flight::PutResult;
31-
use common_arrow::arrow_flight::SchemaResult;
32-
use common_arrow::arrow_flight::Ticket;
19+
use common_arrow::arrow_format::flight::data::Action;
20+
use common_arrow::arrow_format::flight::data::ActionType;
21+
use common_arrow::arrow_format::flight::data::Criteria;
22+
use common_arrow::arrow_format::flight::data::Empty;
23+
use common_arrow::arrow_format::flight::data::FlightData;
24+
use common_arrow::arrow_format::flight::data::FlightDescriptor;
25+
use common_arrow::arrow_format::flight::data::FlightInfo;
26+
use common_arrow::arrow_format::flight::data::HandshakeRequest;
27+
use common_arrow::arrow_format::flight::data::HandshakeResponse;
28+
use common_arrow::arrow_format::flight::data::PutResult;
29+
use common_arrow::arrow_format::flight::data::SchemaResult;
30+
use common_arrow::arrow_format::flight::data::Ticket;
31+
use common_arrow::arrow_format::flight::service::flight_service_server::FlightService;
32+
use common_arrow::arrow_format::flight::service::flight_service_server::FlightServiceServer;
3333
use common_base::tokio;
3434
use futures::Stream;
3535
use rand::Rng;
@@ -108,7 +108,7 @@ impl FlightService for FlightServiceForTestImpl {
108108

109109
type DoActionStream = Pin<
110110
Box<
111-
dyn Stream<Item = Result<common_arrow::arrow_flight::Result, Status>>
111+
dyn Stream<Item = Result<common_arrow::arrow_format::flight::data::Result, Status>>
112112
+ Send
113113
+ Sync
114114
+ 'static,

common/meta/raft-store/src/state_machine/sm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use async_raft::raft::Entry;
2323
use async_raft::raft::EntryPayload;
2424
use async_raft::raft::MembershipConfig;
2525
use common_arrow::arrow::datatypes::Schema;
26-
use common_arrow::arrow_flight::FlightData;
26+
use common_arrow::arrow_format::flight::data::FlightData;
2727
use common_exception::prelude::ErrorCode;
2828
use common_exception::ToErrorCode;
2929
use common_meta_sled_store::get_sled_db;

0 commit comments

Comments
 (0)