Skip to content

Commit c2dd55b

Browse files
committed
chore(deps): Update sqlparser to 0.60
Signed-off-by: StandingMan <[email protected]>
1 parent 1f654bb commit c2dd55b

File tree

14 files changed

+90
-123
lines changed

14 files changed

+90
-123
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ recursive = "0.1.1"
181181
regex = "1.12"
182182
rstest = "0.26.1"
183183
serde_json = "1"
184-
sqlparser = { version = "0.59.0", default-features = false, features = ["std", "visitor"] }
184+
sqlparser = { version = "0.60.0", default-features = false, features = ["std", "visitor"] }
185185
strum = "0.27.2"
186186
strum_macros = "0.27.2"
187187
tempfile = "3"

datafusion-examples/examples/relation_planner/match_recognize.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl RelationPlanner for MatchRecognizePlanner {
362362
..
363363
} = relation
364364
else {
365-
return Ok(RelationPlanning::Original(relation));
365+
return Ok(RelationPlanning::Original(Box::new(relation)));
366366
};
367367

368368
// Plan the input table
@@ -401,6 +401,8 @@ impl RelationPlanner for MatchRecognizePlanner {
401401
node: Arc::new(node),
402402
});
403403

404-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
404+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
405+
plan, alias,
406+
))))
405407
}
406408
}

datafusion-examples/examples/relation_planner/pivot_unpivot.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl RelationPlanner for PivotUnpivotPlanner {
339339
alias,
340340
),
341341

342-
other => Ok(RelationPlanning::Original(other)),
342+
other => Ok(RelationPlanning::Original(Box::new(other))),
343343
}
344344
}
345345
}
@@ -459,7 +459,9 @@ fn plan_pivot(
459459
.aggregate(group_by_cols, pivot_exprs)?
460460
.build()?;
461461

462-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
462+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
463+
plan, alias,
464+
))))
463465
}
464466

465467
// ============================================================================
@@ -540,7 +542,9 @@ fn plan_unpivot(
540542
.build()?;
541543
}
542544

543-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
545+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
546+
plan, alias,
547+
))))
544548
}
545549

546550
// ============================================================================

datafusion-examples/examples/relation_planner/table_sample.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ impl RelationPlanner for TableSamplePlanner {
331331
index_hints,
332332
} = relation
333333
else {
334-
return Ok(RelationPlanning::Original(relation));
334+
return Ok(RelationPlanning::Original(Box::new(relation)));
335335
};
336336

337337
// Extract sample spec (handles both before/after alias positions)
@@ -401,7 +401,9 @@ impl RelationPlanner for TableSamplePlanner {
401401

402402
let fraction = bucket_num as f64 / total as f64;
403403
let plan = TableSamplePlanNode::new(input, fraction, seed).into_plan();
404-
return Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)));
404+
return Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
405+
plan, alias,
406+
))));
405407
}
406408

407409
// Handle quantity-based sampling
@@ -422,15 +424,19 @@ impl RelationPlanner for TableSamplePlanner {
422424
let plan = LogicalPlanBuilder::from(input)
423425
.limit(0, Some(rows as usize))?
424426
.build()?;
425-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
427+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
428+
plan, alias,
429+
))))
426430
}
427431

428432
// TABLESAMPLE (N PERCENT) - percentage sampling
429433
Some(TableSampleUnit::Percent) => {
430434
let percent: f64 = parse_literal::<Float64Type>(&quantity_value_expr)?;
431435
let fraction = percent / 100.0;
432436
let plan = TableSamplePlanNode::new(input, fraction, seed).into_plan();
433-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
437+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
438+
plan, alias,
439+
))))
434440
}
435441

436442
// TABLESAMPLE (N) - fraction if <1.0, row limit if >=1.0
@@ -448,7 +454,9 @@ impl RelationPlanner for TableSamplePlanner {
448454
// Interpret as fraction
449455
TableSamplePlanNode::new(input, value, seed).into_plan()
450456
};
451-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
457+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
458+
plan, alias,
459+
))))
452460
}
453461
}
454462
}

datafusion/core/tests/user_defined/relation_planner.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ fn plan_static_values_table(
6868
.project(vec![col("column1").alias(column_name)])?
6969
.build()?;
7070

71-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
71+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
72+
plan, alias,
73+
))))
7274
}
73-
other => Ok(RelationPlanning::Original(other)),
75+
other => Ok(RelationPlanning::Original(Box::new(other))),
7476
}
7577
}
7678

@@ -176,9 +178,11 @@ impl RelationPlanner for SamplingJoinPlanner {
176178
.cross_join(right_sampled)?
177179
.build()?;
178180

179-
Ok(RelationPlanning::Planned(PlannedRelation::new(plan, alias)))
181+
Ok(RelationPlanning::Planned(Box::new(PlannedRelation::new(
182+
plan, alias,
183+
))))
180184
}
181-
other => Ok(RelationPlanning::Original(other)),
185+
other => Ok(RelationPlanning::Original(Box::new(other))),
182186
}
183187
}
184188
}
@@ -195,7 +199,7 @@ impl RelationPlanner for PassThroughPlanner {
195199
_context: &mut dyn RelationPlannerContext,
196200
) -> Result<RelationPlanning> {
197201
// Never handles anything - always delegates
198-
Ok(RelationPlanning::Original(relation))
202+
Ok(RelationPlanning::Original(Box::new(relation)))
199203
}
200204
}
201205

@@ -217,7 +221,7 @@ impl RelationPlanner for PremiumFeaturePlanner {
217221
to unlock advanced array operations."
218222
.to_string(),
219223
)),
220-
other => Ok(RelationPlanning::Original(other)),
224+
other => Ok(RelationPlanning::Original(Box::new(other))),
221225
}
222226
}
223227
}

datafusion/expr/src/expr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use datafusion_functions_window_common::field::WindowUDFFieldArgs;
4242
#[cfg(feature = "sql")]
4343
use sqlparser::ast::{
4444
ExceptSelectItem, ExcludeSelectItem, IlikeSelectItem, RenameSelectItem,
45-
ReplaceSelectElement, display_comma_separated,
45+
ReplaceSelectElement,
4646
};
4747

4848
// Moved in 51.0.0 to datafusion_common
@@ -1403,7 +1403,9 @@ pub struct PlannedReplaceSelectItem {
14031403
impl Display for PlannedReplaceSelectItem {
14041404
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
14051405
write!(f, "REPLACE")?;
1406-
write!(f, " ({})", display_comma_separated(&self.items))?;
1406+
for item in &self.items {
1407+
write!(f, " ({item})")?;
1408+
}
14071409
Ok(())
14081410
}
14091411
}

datafusion/expr/src/planner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ impl PlannedRelation {
369369
#[derive(Debug)]
370370
pub enum RelationPlanning {
371371
/// The relation was successfully planned by an extension planner
372-
Planned(PlannedRelation),
372+
Planned(Box<PlannedRelation>),
373373
/// No extension planner handled the relation, return it for default processing
374-
Original(TableFactor),
374+
Original(Box<TableFactor>),
375375
}
376376

377377
/// Customize planning SQL table factors to [`LogicalPlan`]s.

datafusion/sql/src/planner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
823823
| SQLDataType::HugeInt
824824
| SQLDataType::UHugeInt
825825
| SQLDataType::UBigInt
826-
| SQLDataType::TimestampNtz
826+
| SQLDataType::TimestampNtz{..}
827827
| SQLDataType::NamedTable { .. }
828828
| SQLDataType::TsVector
829829
| SQLDataType::TsQuery

datafusion/sql/src/query.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
170170
name: alias,
171171
// Apply to all fields
172172
columns: vec![],
173+
explicit: false,
173174
},
174175
),
175176
PipeOperator::Union {

0 commit comments

Comments
 (0)