Skip to content

Commit e7243d4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into varchar_default_ut8view
2 parents b3bb360 + 7002a00 commit e7243d4

File tree

167 files changed

+2838
-1338
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+2838
-1338
lines changed

Cargo.lock

Lines changed: 14 additions & 25 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ arrow = { workspace = true }
3939
async-trait = { workspace = true }
4040
aws-config = "1.6.2"
4141
aws-credential-types = "1.2.0"
42-
clap = { version = "4.5.37", features = ["derive", "cargo"] }
42+
clap = { version = "4.5.39", features = ["derive", "cargo"] }
4343
datafusion = { workspace = true, features = [
4444
"avro",
4545
"crypto_expressions",
@@ -60,7 +60,7 @@ object_store = { workspace = true, features = ["aws", "gcp", "http"] }
6060
parking_lot = { workspace = true }
6161
parquet = { workspace = true, default-features = false }
6262
regex = { workspace = true }
63-
rustyline = "15.0"
63+
rustyline = "16.0"
6464
tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "sync", "parking_lot", "signal"] }
6565
url = { workspace = true }
6666

datafusion-examples/examples/advanced_udaf.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use arrow::array::{
2525
};
2626
use arrow::datatypes::{ArrowNativeTypeOp, ArrowPrimitiveType, Float64Type, UInt32Type};
2727
use arrow::record_batch::RecordBatch;
28+
use arrow_schema::FieldRef;
2829
use datafusion::common::{cast::as_float64_array, ScalarValue};
2930
use datafusion::error::Result;
3031
use datafusion::logical_expr::{
@@ -92,10 +93,10 @@ impl AggregateUDFImpl for GeoMeanUdaf {
9293
}
9394

9495
/// This is the description of the state. accumulator's state() must match the types here.
95-
fn state_fields(&self, args: StateFieldsArgs) -> Result<Vec<Field>> {
96+
fn state_fields(&self, args: StateFieldsArgs) -> Result<Vec<FieldRef>> {
9697
Ok(vec![
97-
Field::new("prod", args.return_type().clone(), true),
98-
Field::new("n", DataType::UInt32, true),
98+
Field::new("prod", args.return_type().clone(), true).into(),
99+
Field::new("n", DataType::UInt32, true).into(),
99100
])
100101
}
101102

@@ -401,7 +402,7 @@ impl AggregateUDFImpl for SimplifiedGeoMeanUdaf {
401402
unimplemented!("should not be invoked")
402403
}
403404

404-
fn state_fields(&self, _args: StateFieldsArgs) -> Result<Vec<Field>> {
405+
fn state_fields(&self, _args: StateFieldsArgs) -> Result<Vec<FieldRef>> {
405406
unimplemented!("should not be invoked")
406407
}
407408

datafusion-examples/examples/advanced_udwf.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use arrow::{
2323
array::{ArrayRef, AsArray, Float64Array},
2424
datatypes::Float64Type,
2525
};
26+
use arrow_schema::FieldRef;
2627
use datafusion::common::ScalarValue;
2728
use datafusion::error::Result;
2829
use datafusion::functions_aggregate::average::avg_udaf;
@@ -87,8 +88,8 @@ impl WindowUDFImpl for SmoothItUdf {
8788
Ok(Box::new(MyPartitionEvaluator::new()))
8889
}
8990

90-
fn field(&self, field_args: WindowUDFFieldArgs) -> Result<Field> {
91-
Ok(Field::new(field_args.name(), DataType::Float64, true))
91+
fn field(&self, field_args: WindowUDFFieldArgs) -> Result<FieldRef> {
92+
Ok(Field::new(field_args.name(), DataType::Float64, true).into())
9293
}
9394
}
9495

@@ -205,8 +206,8 @@ impl WindowUDFImpl for SimplifySmoothItUdf {
205206
Some(Box::new(simplify))
206207
}
207208

208-
fn field(&self, field_args: WindowUDFFieldArgs) -> Result<Field> {
209-
Ok(Field::new(field_args.name(), DataType::Float64, true))
209+
fn field(&self, field_args: WindowUDFFieldArgs) -> Result<FieldRef> {
210+
Ok(Field::new(field_args.name(), DataType::Float64, true).into())
210211
}
211212
}
212213

datafusion-examples/examples/dataframe.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ async fn main() -> Result<()> {
6464
read_parquet(&ctx).await?;
6565
read_csv(&ctx).await?;
6666
read_memory(&ctx).await?;
67+
read_memory_macro().await?;
6768
write_out(&ctx).await?;
6869
register_aggregate_test_data("t1", &ctx).await?;
6970
register_aggregate_test_data("t2", &ctx).await?;
@@ -174,6 +175,24 @@ async fn read_memory(ctx: &SessionContext) -> Result<()> {
174175
Ok(())
175176
}
176177

178+
/// Use the DataFrame API to:
179+
/// 1. Read in-memory data.
180+
async fn read_memory_macro() -> Result<()> {
181+
// create a DataFrame using macro
182+
let df = dataframe!(
183+
"a" => ["a", "b", "c", "d"],
184+
"b" => [1, 10, 10, 100]
185+
)?;
186+
// print the results
187+
df.show().await?;
188+
189+
// create empty DataFrame using macro
190+
let df_empty = dataframe!()?;
191+
df_empty.show().await?;
192+
193+
Ok(())
194+
}
195+
177196
/// Use the DataFrame API to:
178197
/// 1. Write out a DataFrame to a table
179198
/// 2. Write out a DataFrame to a parquet file

0 commit comments

Comments
 (0)