Skip to content

Commit 90ef03d

Browse files
author
silezhou
committed
Merge commit '079ddb04b7c36006f571d7253ffd752f8d5a44ff'
2 parents a25ccb3 + 079ddb0 commit 90ef03d

File tree

7 files changed

+808
-632
lines changed

7 files changed

+808
-632
lines changed

datafusion-testing

Submodule datafusion-testing updated 257 files

datafusion/physical-plan/src/coalesce_batches.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,18 @@ impl DisplayAs for CoalesceBatchesExec {
123123
Ok(())
124124
}
125125
DisplayFormatType::TreeRender => {
126-
// TODO: collect info
127-
write!(f, "")
126+
writeln!(f, "target_batch_size={}", self.target_batch_size)?;
127+
if let Some(fetch) = self.fetch {
128+
write!(f, "limit={fetch}")?;
129+
};
130+
Ok(())
131+
}
132+
DisplayFormatType::TreeRender => {
133+
writeln!(f, "target_batch_size={}", self.target_batch_size)?;
134+
if let Some(fetch) = self.fetch {
135+
write!(f, "limit={fetch}")?;
136+
};
137+
Ok(())
128138
}
129139
}
130140
}

datafusion/physical-plan/src/memory.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,17 @@ impl DisplayAs for LazyMemoryExec {
193193
)
194194
}
195195
DisplayFormatType::TreeRender => {
196-
// TODO: collect info
197-
write!(f, "")
196+
//TODO: remove batch_size, add one line per generator
197+
writeln!(
198+
f,
199+
"batch_generators={}",
200+
self.batch_generators
201+
.iter()
202+
.map(|g| g.read().to_string())
203+
.collect::<Vec<String>>()
204+
.join(", ")
205+
)?;
206+
Ok(())
198207
}
199208
}
200209
}

datafusion/sql/src/planner.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,18 +564,18 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
564564
Ok(DataType::UInt32)
565565
}
566566
SQLDataType::Varchar(length) => {
567-
match (length, self.options.support_varchar_with_length) {
568-
(Some(_), false) => plan_err!("does not support Varchar with length, please set `support_varchar_with_length` to be true"),
569-
_ => {
567+
match (length, self.options.support_varchar_with_length) {
568+
(Some(_), false) => plan_err!("does not support Varchar with length, please set `support_varchar_with_length` to be true"),
569+
_ => {
570570
if self.options.map_varchar_to_utf8view {
571571
Ok(DataType::Utf8View)
572572
} else {
573573
Ok(DataType::Utf8)
574574
}
575575
}
576-
}
577-
}
578-
SQLDataType::BigIntUnsigned(_) | SQLDataType::Int8Unsigned(_) => Ok(DataType::UInt64),
576+
}
577+
}
578+
SQLDataType::UnsignedBigInt(_) | SQLDataType::UnsignedInt8(_) => Ok(DataType::UInt64),
579579
SQLDataType::Float(_) => Ok(DataType::Float32),
580580
SQLDataType::Real | SQLDataType::Float4 => Ok(DataType::Float32),
581581
SQLDataType::Double(ExactNumberInfo::None) | SQLDataType::DoublePrecision | SQLDataType::Float8 => Ok(DataType::Float64),

datafusion/sql/src/select.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use crate::utils::{
2929
use datafusion_common::error::DataFusionErrorBuilder;
3030
use datafusion_common::tree_node::{TreeNode, TreeNodeRecursion};
3131
use datafusion_common::{not_impl_err, plan_err, Column, Result};
32+
use datafusion_common::{not_impl_err, plan_err, Column, Result};
3233
use datafusion_common::{RecursionUnnestOption, UnnestOptions};
3334
use datafusion_expr::expr::{Alias, PlannedReplaceSelectItem, WildcardOptions};
3435
use datafusion_expr::expr_rewriter::{
@@ -37,6 +38,8 @@ use datafusion_expr::expr_rewriter::{
3738
use datafusion_expr::utils::{
3839
expand_qualified_wildcard, expand_wildcard, expr_as_column_expr, expr_to_columns,
3940
find_aggregate_exprs, find_window_exprs,
41+
expand_qualified_wildcard, expand_wildcard, expr_as_column_expr, expr_to_columns,
42+
find_aggregate_exprs, find_window_exprs,
4043
};
4144
use datafusion_expr::{
4245
Aggregate, Expr, Filter, GroupingSet, LogicalPlan, LogicalPlanBuilder,
@@ -99,18 +102,6 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
99102
debug_assert!(!matches!(expr, Expr::Wildcard { .. }));
100103
}
101104

102-
// TOOD: remove this after Expr::Wildcard is removed
103-
#[allow(deprecated)]
104-
for expr in &select_exprs {
105-
debug_assert!(!matches!(expr, Expr::Wildcard { .. }));
106-
}
107-
108-
// TOOD: remove this after Expr::Wildcard is removed
109-
#[allow(deprecated)]
110-
for expr in &select_exprs {
111-
debug_assert!(!matches!(expr, Expr::Wildcard { .. }));
112-
}
113-
114105
let order_by =
115106
to_order_by_exprs_with_select(query_order_by, Some(select_exprs.clone()))?;
116107

datafusion/sql/tests/cases/plan_to_sql.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use datafusion_expr::test::function_stub::{
2121
count_udaf, max_udaf, min_udaf, sum, sum_udaf,
2222
};
2323
use datafusion_expr::{
24+
cast, col, lit, table_scan, wildcard, EmptyRelation, Expr, Extension, LogicalPlan,
2425
cast, col, lit, table_scan, wildcard, EmptyRelation, Expr, Extension, LogicalPlan,
2526
LogicalPlanBuilder, Union, UserDefinedLogicalNode, UserDefinedLogicalNodeCore,
2627
};
@@ -38,6 +39,7 @@ use datafusion_sql::unparser::{expr_to_sql, plan_to_sql, Unparser};
3839
use sqlparser::ast::Statement;
3940
use std::hash::Hash;
4041
use std::ops::Add;
42+
use std::ops::Add;
4143
use std::sync::Arc;
4244
use std::{fmt, vec};
4345

0 commit comments

Comments
 (0)