Skip to content

Commit 5fdec0c

Browse files
committed
retract the new From
1 parent 79c4162 commit 5fdec0c

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

datafusion-examples/examples/flight/flight_sql_server.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,7 @@ impl FlightSqlService for FlightSqlServiceImpl {
395395
let plan_uuid = Uuid::new_v4().hyphenated().to_string();
396396
self.statements.insert(plan_uuid.clone(), plan.clone());
397397

398-
let plan_schema = plan.schema();
399-
400-
let arrow_schema = plan_schema.as_ref().into();
398+
let arrow_schema = plan.schema().as_arrow();
401399
let message = SchemaAsIpc::new(arrow_schema, &IpcWriteOptions::default())
402400
.try_into()
403401
.map_err(|e| status!("Unable to serialize schema", e))?;

datafusion/common/src/dfschema.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub type DFSchemaRef = Arc<DFSchema>;
101101
/// let df_schema = DFSchema::from_unqualified_fields(vec![
102102
/// Field::new("c1", arrow::datatypes::DataType::Int32, false),
103103
/// ].into(),HashMap::new()).unwrap();
104-
/// let schema = Schema::from(df_schema);
104+
/// let schema: &Schema = df_schema.as_arrow();
105105
/// assert_eq!(schema.fields().len(), 1);
106106
/// ```
107107
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -594,7 +594,7 @@ impl DFSchema {
594594
&self,
595595
arrow_schema: &Schema,
596596
) -> Result<()> {
597-
let self_arrow_schema: &Schema = self.into();
597+
let self_arrow_schema = self.as_arrow();
598598
self_arrow_schema
599599
.fields()
600600
.iter()
@@ -1067,13 +1067,6 @@ fn format_simple_data_type(data_type: &DataType) -> String {
10671067
}
10681068
}
10691069

1070-
impl<'a> From<&'a DFSchema> for &'a Schema {
1071-
/// Convert DFSchema reference into a Schema
1072-
fn from(df_schema: &'a DFSchema) -> Self {
1073-
df_schema.as_arrow()
1074-
}
1075-
}
1076-
10771070
/// Allow DFSchema to be converted into an Arrow `&Schema`
10781071
impl AsRef<Schema> for DFSchema {
10791072
fn as_ref(&self) -> &Schema {

datafusion/expr/src/logical_plan/display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'n> TreeNodeVisitor<'n> for IndentVisitor<'_, '_> {
7272
write!(self.f, "{:indent$}", "", indent = self.indent * 2)?;
7373
write!(self.f, "{}", plan.display())?;
7474
if self.with_schema {
75-
write!(self.f, " {}", display_schema(plan.schema().as_ref().into()))?;
75+
write!(self.f, " {}", display_schema(plan.schema().as_arrow()))?;
7676
}
7777

7878
self.indent += 1;
@@ -192,7 +192,7 @@ impl<'n> TreeNodeVisitor<'n> for GraphvizVisitor<'_, '_> {
192192
format!(
193193
r"{}\nSchema: {}",
194194
plan.display(),
195-
display_schema(plan.schema().as_ref().into())
195+
display_schema(plan.schema().as_arrow())
196196
)
197197
} else {
198198
format!("{}", plan.display())

datafusion/physical-expr/src/planner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub fn create_physical_expr(
111111
input_dfschema: &DFSchema,
112112
execution_props: &ExecutionProps,
113113
) -> Result<Arc<dyn PhysicalExpr>> {
114-
let input_schema: &Schema = input_dfschema.into();
114+
let input_schema = input_dfschema.as_arrow();
115115

116116
match e {
117117
Expr::Alias(Alias { expr, metadata, .. }) => {

0 commit comments

Comments
 (0)