@@ -197,52 +197,3 @@ fn interval_dt_to_duration_ms(dt: &IntervalDayTime) -> Result<i64> {
197197 )
198198 }
199199}
200-
201- #[ cfg( test) ]
202- mod tests {
203- use super :: * ;
204-
205- use crate :: expressions:: { cast, col} ;
206-
207- use arrow:: datatypes:: { Field , Schema } ;
208-
209- fn int32_schema ( ) -> SchemaRef {
210- Arc :: new ( Schema :: new ( vec ! [ Field :: new( "id" , DataType :: Int32 , false ) ] ) )
211- }
212-
213- #[ test]
214- fn test_check_support_rejects_unsupported_cast_target ( ) -> Result < ( ) > {
215- let schema = int32_schema ( ) ;
216- let id = col ( "id" , schema. as_ref ( ) ) ?;
217-
218- // Casting an interval-friendly column to a type interval arithmetic does
219- // not understand must not be analyzed: string ordering and numeric
220- // ordering are not interchangeable, so endpoint-wise casting can produce
221- // a reversed interval.
222- let to_utf8 = cast ( Arc :: clone ( & id) , schema. as_ref ( ) , DataType :: Utf8 ) ?;
223- assert ! ( !check_support( & to_utf8, & schema) ) ;
224-
225- // The same holds when the unsupported type only appears in the middle of
226- // a cast chain whose outermost type is supported.
227- let round_trip = cast ( to_utf8, schema. as_ref ( ) , DataType :: Int32 ) ?;
228- assert ! ( !check_support( & round_trip, & schema) ) ;
229-
230- Ok ( ( ) )
231- }
232-
233- #[ test]
234- fn test_check_support_allows_supported_cast_target ( ) -> Result < ( ) > {
235- let schema = int32_schema ( ) ;
236- let id = col ( "id" , schema. as_ref ( ) ) ?;
237-
238- assert ! ( check_support( & id, & schema) ) ;
239-
240- let to_int64 = cast ( Arc :: clone ( & id) , schema. as_ref ( ) , DataType :: Int64 ) ?;
241- assert ! ( check_support( & to_int64, & schema) ) ;
242-
243- let to_float64 = cast ( to_int64, schema. as_ref ( ) , DataType :: Float64 ) ?;
244- assert ! ( check_support( & to_float64, & schema) ) ;
245-
246- Ok ( ( ) )
247- }
248- }
0 commit comments