Skip to content

Commit c0d5d81

Browse files
committed
DataFusion 52 migration
1 parent 01c3b1d commit c0d5d81

18 files changed

Lines changed: 39 additions & 42 deletions

File tree

docs/source/user-guide/latest/compatibility.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,14 @@ Cast operations in Comet fall into three levels of support:
105105
<!-- prettier-ignore-end -->
106106

107107
**Notes:**
108-
109108
- **decimal -> string**: There can be formatting differences in some case due to Spark using scientific notation where Comet does not
110109
- **double -> decimal**: There can be rounding differences
111110
- **double -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
112111
- **float -> decimal**: There can be rounding differences
113112
- **float -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
114113
- **string -> date**: Only supports years between 262143 BC and 262142 AD
115114
- **string -> decimal**: Does not support fullwidth unicode digits (e.g \\uFF10)
116-
or strings containing null bytes (e.g \\u0000)
115+
or strings containing null bytes (e.g \\u0000)
117116
- **string -> timestamp**: Not all valid formats are supported
118117
<!--END:CAST_LEGACY_TABLE-->
119118

@@ -140,15 +139,14 @@ Cast operations in Comet fall into three levels of support:
140139
<!-- prettier-ignore-end -->
141140

142141
**Notes:**
143-
144142
- **decimal -> string**: There can be formatting differences in some case due to Spark using scientific notation where Comet does not
145143
- **double -> decimal**: There can be rounding differences
146144
- **double -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
147145
- **float -> decimal**: There can be rounding differences
148146
- **float -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
149147
- **string -> date**: Only supports years between 262143 BC and 262142 AD
150148
- **string -> decimal**: Does not support fullwidth unicode digits (e.g \\uFF10)
151-
or strings containing null bytes (e.g \\u0000)
149+
or strings containing null bytes (e.g \\u0000)
152150
- **string -> timestamp**: Not all valid formats are supported
153151
<!--END:CAST_TRY_TABLE-->
154152

@@ -175,15 +173,14 @@ Cast operations in Comet fall into three levels of support:
175173
<!-- prettier-ignore-end -->
176174

177175
**Notes:**
178-
179176
- **decimal -> string**: There can be formatting differences in some case due to Spark using scientific notation where Comet does not
180177
- **double -> decimal**: There can be rounding differences
181178
- **double -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
182179
- **float -> decimal**: There can be rounding differences
183180
- **float -> string**: There can be differences in precision. For example, the input "1.4E-45" will produce 1.0E-45 instead of 1.4E-45
184181
- **string -> date**: Only supports years between 262143 BC and 262142 AD
185182
- **string -> decimal**: Does not support fullwidth unicode digits (e.g \\uFF10)
186-
or strings containing null bytes (e.g \\u0000)
183+
or strings containing null bytes (e.g \\u0000)
187184
- **string -> timestamp**: ANSI mode not supported
188185
<!--END:CAST_ANSI_TABLE-->
189186

native/core/src/execution/expressions/subquery.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ impl PhysicalExpr for Subquery {
6767
self
6868
}
6969

70-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
71-
unimplemented!()
70+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
71+
Display::fmt(self, f)
7272
}
7373

7474
fn data_type(&self, _: &Schema) -> datafusion::common::Result<DataType> {

native/spark-expr/src/array_funcs/array_insert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ impl PhysicalExpr for ArrayInsert {
9696
self
9797
}
9898

99-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
100-
unimplemented!()
99+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
100+
Display::fmt(self, f)
101101
}
102102

103103
fn data_type(&self, input_schema: &Schema) -> DataFusionResult<DataType> {

native/spark-expr/src/array_funcs/get_array_struct_fields.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ impl PhysicalExpr for GetArrayStructFields {
132132
}
133133
}
134134

135-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
136-
unimplemented!()
135+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
136+
Display::fmt(self, f)
137137
}
138138
}
139139

native/spark-expr/src/array_funcs/list_extract.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ impl PhysicalExpr for ListExtract {
9191
self
9292
}
9393

94-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
95-
unimplemented!()
94+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
95+
Display::fmt(self, f)
9696
}
9797

9898
fn data_type(&self, input_schema: &Schema) -> DataFusionResult<DataType> {

native/spark-expr/src/conditional_funcs/if_expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use arrow::{
2222
use datafusion::common::Result;
2323
use datafusion::logical_expr::ColumnarValue;
2424
use datafusion::physical_expr::{expressions::CaseExpr, PhysicalExpr};
25-
use std::fmt::Formatter;
25+
use std::fmt::{Display, Formatter};
2626
use std::hash::Hash;
2727
use std::{any::Any, sync::Arc};
2828

@@ -88,8 +88,8 @@ impl PhysicalExpr for IfExpr {
8888
self
8989
}
9090

91-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
92-
unimplemented!()
91+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
92+
Display::fmt(self, f)
9393
}
9494

9595
fn data_type(&self, input_schema: &Schema) -> Result<DataType> {

native/spark-expr/src/datetime_funcs/timestamp_trunc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ impl PhysicalExpr for TimestampTruncExpr {
8989
self
9090
}
9191

92-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
93-
unimplemented!()
92+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
93+
Display::fmt(self, f)
9494
}
9595

9696
fn data_type(&self, input_schema: &Schema) -> datafusion::common::Result<DataType> {

native/spark-expr/src/json_funcs/from_json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ impl PhysicalExpr for FromJson {
9090
self
9191
}
9292

93-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
94-
unimplemented!()
93+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
94+
Display::fmt(self, f)
9595
}
9696

9797
fn data_type(&self, _: &Schema) -> Result<DataType> {

native/spark-expr/src/json_funcs/to_json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ impl PhysicalExpr for ToJson {
8383
self
8484
}
8585

86-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
87-
unimplemented!()
86+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
87+
Display::fmt(self, f)
8888
}
8989

9090
fn data_type(&self, _: &Schema) -> Result<DataType> {

native/spark-expr/src/math_funcs/internal/checkoverflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ impl PhysicalExpr for CheckOverflow {
8383
self
8484
}
8585

86-
fn fmt_sql(&self, _: &mut Formatter<'_>) -> std::fmt::Result {
87-
unimplemented!()
86+
fn fmt_sql(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
87+
Display::fmt(self, f)
8888
}
8989

9090
fn data_type(&self, _: &Schema) -> datafusion::common::Result<DataType> {

0 commit comments

Comments
 (0)