Skip to content

Commit 451e81e

Browse files
authored
Update to arrow 38 (#6115)
* Update to arrow 38 * Further fixes * Update sqllogictest
1 parent 66330bd commit 451e81e

File tree

9 files changed

+141
-115
lines changed

9 files changed

+141
-115
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ repository = "https://github.com/apache/arrow-datafusion"
4646
rust-version = "1.64"
4747

4848
[workspace.dependencies]
49-
arrow = { version = "37.0.0", features = ["prettyprint"] }
50-
arrow-flight = { version = "37.0.0", features = ["flight-sql-experimental"] }
51-
arrow-buffer = { version = "37.0.0", default-features = false }
52-
arrow-schema = { version = "37.0.0", default-features = false }
53-
arrow-array = { version = "37.0.0", default-features = false, features = ["chrono-tz"] }
54-
parquet = { version = "37.0.0", features = ["arrow", "async"] }
49+
arrow = { version = "38.0.0", features = ["prettyprint"] }
50+
arrow-flight = { version = "38.0.0", features = ["flight-sql-experimental"] }
51+
arrow-buffer = { version = "38.0.0", default-features = false }
52+
arrow-schema = { version = "38.0.0", default-features = false }
53+
arrow-array = { version = "38.0.0", default-features = false, features = ["chrono-tz"] }
54+
parquet = { version = "38.0.0", features = ["arrow", "async"] }
5555

5656
[profile.release]
5757
codegen-units = 1

datafusion-cli/Cargo.lock

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

datafusion-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ rust-version = "1.62"
2929
readme = "README.md"
3030

3131
[dependencies]
32-
arrow = "37.0.0"
32+
arrow = "38.0.0"
3333
async-trait = "0.1.41"
3434
clap = { version = "3", features = ["derive", "cargo"] }
3535
datafusion = { path = "../datafusion/core", version = "23.0.0" }

datafusion-examples/examples/flight_sql_server.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ use arrow_flight::sql::{
2626
ActionCreatePreparedStatementResult, Any, CommandGetCatalogs,
2727
CommandGetCrossReference, CommandGetDbSchemas, CommandGetExportedKeys,
2828
CommandGetImportedKeys, CommandGetPrimaryKeys, CommandGetSqlInfo,
29-
CommandGetTableTypes, CommandGetTables, CommandPreparedStatementQuery,
30-
CommandPreparedStatementUpdate, CommandStatementQuery, CommandStatementUpdate,
31-
ProstMessageExt, SqlInfo, TicketStatementQuery,
29+
CommandGetTableTypes, CommandGetTables, CommandGetXdbcTypeInfo,
30+
CommandPreparedStatementQuery, CommandPreparedStatementUpdate, CommandStatementQuery,
31+
CommandStatementUpdate, ProstMessageExt, SqlInfo, TicketStatementQuery,
3232
};
3333
use arrow_flight::{
3434
Action, FlightData, FlightDescriptor, FlightEndpoint, FlightInfo, HandshakeRequest,
@@ -408,6 +408,17 @@ impl FlightSqlService for FlightSqlServiceImpl {
408408
))
409409
}
410410

411+
async fn get_flight_info_xdbc_type_info(
412+
&self,
413+
_query: CommandGetXdbcTypeInfo,
414+
_request: Request<FlightDescriptor>,
415+
) -> Result<Response<FlightInfo>, Status> {
416+
info!("get_flight_info_xdbc_type_info");
417+
Err(Status::unimplemented(
418+
"Implement get_flight_info_xdbc_type_info",
419+
))
420+
}
421+
411422
async fn do_get_statement(
412423
&self,
413424
_ticket: TicketStatementQuery,
@@ -507,6 +518,15 @@ impl FlightSqlService for FlightSqlServiceImpl {
507518
Err(Status::unimplemented("Implement do_get_cross_reference"))
508519
}
509520

521+
async fn do_get_xdbc_type_info(
522+
&self,
523+
_query: CommandGetXdbcTypeInfo,
524+
_request: Request<Ticket>,
525+
) -> Result<Response<<Self as FlightService>::DoGetStream>, Status> {
526+
info!("do_get_xdbc_type_info");
527+
Err(Status::unimplemented("Implement do_get_xdbc_type_info"))
528+
}
529+
510530
async fn do_put_statement_update(
511531
&self,
512532
_ticket: CommandStatementUpdate,

datafusion/common/src/scalar.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,15 +1472,15 @@ fn dict_from_scalar<K: ArrowDictionaryKeyType>(
14721472
// APIs and skipping validation, if it every comes up in
14731473
// performance traces.
14741474
Arc::new(
1475-
DictionaryArray::<K>::try_new(&key_array, &values_array)
1475+
DictionaryArray::<K>::try_new(key_array, values_array)
14761476
// should always be valid by construction above
14771477
.expect("Can not construct dictionary array"),
14781478
)
14791479
}
14801480

14811481
/// Create a dictionary array representing all the values in values
14821482
fn dict_from_values<K: ArrowDictionaryKeyType>(
1483-
values_array: &dyn Array,
1483+
values_array: ArrayRef,
14841484
) -> Result<ArrayRef> {
14851485
// Create a key array with `size` elements of 0..array_len for all
14861486
// non-null value elements
@@ -1508,7 +1508,7 @@ fn dict_from_values<K: ArrowDictionaryKeyType>(
15081508
// Note: this path could be made faster by using the ArrayData
15091509
// APIs and skipping validation, if it every comes up in
15101510
// performance traces.
1511-
let dict_array = DictionaryArray::<K>::try_new(&key_array, values_array)?;
1511+
let dict_array = DictionaryArray::<K>::try_new(key_array, values_array)?;
15121512
Ok(Arc::new(dict_array))
15131513
}
15141514

@@ -2406,14 +2406,14 @@ impl ScalarValue {
24062406
assert_eq!(values.data_type(), value_type.as_ref());
24072407

24082408
match key_type.as_ref() {
2409-
DataType::Int8 => dict_from_values::<Int8Type>(&values)?,
2410-
DataType::Int16 => dict_from_values::<Int16Type>(&values)?,
2411-
DataType::Int32 => dict_from_values::<Int32Type>(&values)?,
2412-
DataType::Int64 => dict_from_values::<Int64Type>(&values)?,
2413-
DataType::UInt8 => dict_from_values::<UInt8Type>(&values)?,
2414-
DataType::UInt16 => dict_from_values::<UInt16Type>(&values)?,
2415-
DataType::UInt32 => dict_from_values::<UInt32Type>(&values)?,
2416-
DataType::UInt64 => dict_from_values::<UInt64Type>(&values)?,
2409+
DataType::Int8 => dict_from_values::<Int8Type>(values)?,
2410+
DataType::Int16 => dict_from_values::<Int16Type>(values)?,
2411+
DataType::Int32 => dict_from_values::<Int32Type>(values)?,
2412+
DataType::Int64 => dict_from_values::<Int64Type>(values)?,
2413+
DataType::UInt8 => dict_from_values::<UInt8Type>(values)?,
2414+
DataType::UInt16 => dict_from_values::<UInt16Type>(values)?,
2415+
DataType::UInt32 => dict_from_values::<UInt32Type>(values)?,
2416+
DataType::UInt64 => dict_from_values::<UInt64Type>(values)?,
24172417
_ => unreachable!("Invalid dictionary keys type: {:?}", key_type),
24182418
}
24192419
}

datafusion/core/src/physical_plan/file_format/json.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use arrow::{datatypes::SchemaRef, json};
3333
use bytes::{Buf, Bytes};
3434

3535
use crate::physical_plan::common::AbortOnDropSingle;
36-
use arrow::json::RawReaderBuilder;
36+
use arrow::json::ReaderBuilder;
3737
use futures::{ready, stream, StreamExt, TryStreamExt};
3838
use object_store::{GetResult, ObjectStore};
3939
use std::any::Any;
@@ -198,13 +198,13 @@ impl FileOpener for JsonOpener {
198198
match store.get(file_meta.location()).await? {
199199
GetResult::File(file, _) => {
200200
let bytes = file_compression_type.convert_read(file)?;
201-
let reader = RawReaderBuilder::new(schema)
201+
let reader = ReaderBuilder::new(schema)
202202
.with_batch_size(batch_size)
203203
.build(BufReader::new(bytes))?;
204204
Ok(futures::stream::iter(reader).boxed())
205205
}
206206
GetResult::Stream(s) => {
207-
let mut decoder = RawReaderBuilder::new(schema)
207+
let mut decoder = ReaderBuilder::new(schema)
208208
.with_batch_size(batch_size)
209209
.build_decoder()?;
210210

datafusion/core/src/physical_plan/sorts/sort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ mod tests {
10891089
#[tokio::test]
10901090
async fn test_sort_fetch_memory_calculation() -> Result<()> {
10911091
// This test mirrors down the size from the example above.
1092-
let avg_batch_size = 6000;
1092+
let avg_batch_size = 5000;
10931093
let partitions = 4;
10941094

10951095
// A tuple of (fetch, expect_spillage)

datafusion/core/tests/sqllogictests/test_files/arrow_typeof.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ select arrow_cast('30 minutes', 'Interval(MonthDayNano)');
303303

304304
## Duration
305305

306-
query error DataFusion error: Error during planning: Cannot automatically convert Interval\(MonthDayNano\) to Duration\(Second\)
306+
query error DataFusion error: This feature is not implemented: Can't create a scalar from array of type "Duration\(Second\)"
307307
---
308308
select arrow_cast(interval '30 minutes', 'Duration(Second)');
309309

0 commit comments

Comments
 (0)