Return a `format`able structure with the a human readable description of this LogicalPlan node per node, not including children. See [crate::LogicalPlan::display] for an example
(&self)
| 127 | /// |
| 128 | /// See [crate::LogicalPlan::display] for an example |
| 129 | pub fn display(&self) -> impl Display + '_ { |
| 130 | struct Wrapper<'a>(&'a DdlStatement); |
| 131 | impl Display for Wrapper<'_> { |
| 132 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
| 133 | match self.0 { |
| 134 | DdlStatement::CreateExternalTable(CreateExternalTable { |
| 135 | name, |
| 136 | constraints, |
| 137 | .. |
| 138 | }) => { |
| 139 | if constraints.is_empty() { |
| 140 | write!(f, "CreateExternalTable: {name:?}") |
| 141 | } else { |
| 142 | write!(f, "CreateExternalTable: {name:?} {constraints}") |
| 143 | } |
| 144 | } |
| 145 | DdlStatement::CreateMemoryTable(CreateMemoryTable { |
| 146 | name, |
| 147 | constraints, |
| 148 | .. |
| 149 | }) => { |
| 150 | if constraints.is_empty() { |
| 151 | write!(f, "CreateMemoryTable: {name:?}") |
| 152 | } else { |
| 153 | write!(f, "CreateMemoryTable: {name:?} {constraints}") |
| 154 | } |
| 155 | } |
| 156 | DdlStatement::CreateView(CreateView { name, .. }) => { |
| 157 | write!(f, "CreateView: {name:?}") |
| 158 | } |
| 159 | DdlStatement::CreateCatalogSchema(CreateCatalogSchema { |
| 160 | schema_name, |
| 161 | .. |
| 162 | }) => { |
| 163 | write!(f, "CreateCatalogSchema: {schema_name:?}") |
| 164 | } |
| 165 | DdlStatement::CreateCatalog(CreateCatalog { |
| 166 | catalog_name, .. |
| 167 | }) => { |
| 168 | write!(f, "CreateCatalog: {catalog_name:?}") |
| 169 | } |
| 170 | DdlStatement::CreateIndex(CreateIndex { name, .. }) => { |
| 171 | write!(f, "CreateIndex: {name:?}") |
| 172 | } |
| 173 | DdlStatement::DropTable(DropTable { |
| 174 | name, if_exists, .. |
| 175 | }) => { |
| 176 | write!(f, "DropTable: {name:?} if not exist:={if_exists}") |
| 177 | } |
| 178 | DdlStatement::DropView(DropView { |
| 179 | name, if_exists, .. |
| 180 | }) => { |
| 181 | write!(f, "DropView: {name:?} if not exist:={if_exists}") |
| 182 | } |
| 183 | DdlStatement::DropCatalogSchema(DropCatalogSchema { |
| 184 | name, |
| 185 | if_exists, |
| 186 | cascade, |