MCPcopy Create free account
hub / github.com/apache/datafusion / get_delete_target

Method get_delete_target

datafusion/sql/src/statement.rs:1601–1624  ·  view source on GitHub ↗
(&self, from: FromTable)

Source from the content-addressed store, hash-verified

1599 }
1600
1601 fn get_delete_target(&self, from: FromTable) -> Result<ObjectName> {
1602 let mut from = match from {
1603 FromTable::WithFromKeyword(v) => v,
1604 FromTable::WithoutKeyword(v) => v,
1605 };
1606
1607 if from.len() != 1 {
1608 return not_impl_err!(
1609 "DELETE FROM only supports single table, got {}: {from:?}",
1610 from.len()
1611 );
1612 }
1613 let table_factor = from.pop().unwrap();
1614 if !table_factor.joins.is_empty() {
1615 return not_impl_err!("DELETE FROM only supports single table, got: joins");
1616 }
1617 let TableFactor::Table { name, .. } = table_factor.relation else {
1618 return not_impl_err!(
1619 "DELETE FROM only supports single table, got: {table_factor:?}"
1620 );
1621 };
1622
1623 Ok(name)
1624 }
1625
1626 /// Generate a logical plan from a "SHOW TABLES" query
1627 fn show_tables_to_plan(&self) -> Result<LogicalPlan> {

Calls 3

lenMethod · 0.45
popMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected