@@ -29,11 +29,10 @@ use datafusion_common::{
29
29
} ;
30
30
use datafusion_expr:: {
31
31
col,
32
- dml:: CopyTo ,
33
32
logical_plan:: { LogicalPlan , Prepare } ,
34
33
test:: function_stub:: sum_udaf,
35
- ColumnarValue , CreateExternalTable , CreateIndex , DdlStatement , ScalarUDF ,
36
- ScalarUDFImpl , Signature , Statement , Volatility ,
34
+ ColumnarValue , CreateIndex , DdlStatement , ScalarUDF , ScalarUDFImpl , Signature ,
35
+ Statement , Volatility ,
37
36
} ;
38
37
use datafusion_functions:: { string, unicode} ;
39
38
use datafusion_sql:: {
@@ -161,70 +160,6 @@ fn parse_ident_normalization() {
161
160
}
162
161
}
163
162
164
- #[ test]
165
- fn test_parse_options_value_normalization ( ) {
166
- let test_data = [
167
- (
168
- "CREATE EXTERNAL TABLE test OPTIONS ('location' 'LoCaTiOn') STORED AS PARQUET LOCATION 'fake_location'" ,
169
- "CreateExternalTable: Bare { table: \" test\" }" ,
170
- HashMap :: from ( [ ( "format.location" , "LoCaTiOn" ) ] ) ,
171
- false ,
172
- ) ,
173
- (
174
- "CREATE EXTERNAL TABLE test OPTIONS ('location' 'LoCaTiOn') STORED AS PARQUET LOCATION 'fake_location'" ,
175
- "CreateExternalTable: Bare { table: \" test\" }" ,
176
- HashMap :: from ( [ ( "format.location" , "location" ) ] ) ,
177
- true ,
178
- ) ,
179
- (
180
- "COPY test TO 'fake_location' STORED AS PARQUET OPTIONS ('location' 'LoCaTiOn')" ,
181
- "CopyTo: format=csv output_url=fake_location options: (format.location LoCaTiOn)\n TableScan: test" ,
182
- HashMap :: from ( [ ( "format.location" , "LoCaTiOn" ) ] ) ,
183
- false ,
184
- ) ,
185
- (
186
- "COPY test TO 'fake_location' STORED AS PARQUET OPTIONS ('location' 'LoCaTiOn')" ,
187
- "CopyTo: format=csv output_url=fake_location options: (format.location location)\n TableScan: test" ,
188
- HashMap :: from ( [ ( "format.location" , "location" ) ] ) ,
189
- true ,
190
- ) ,
191
- ] ;
192
-
193
- for ( sql, expected_plan, expected_options, enable_options_value_normalization) in
194
- test_data
195
- {
196
- let plan = logical_plan_with_options (
197
- sql,
198
- ParserOptions {
199
- parse_float_as_decimal : false ,
200
- enable_ident_normalization : false ,
201
- support_varchar_with_length : false ,
202
- enable_options_value_normalization,
203
- } ,
204
- ) ;
205
- if let Ok ( plan) = plan {
206
- assert_eq ! ( expected_plan, format!( "{plan}" ) ) ;
207
-
208
- match plan {
209
- LogicalPlan :: Ddl ( DdlStatement :: CreateExternalTable (
210
- CreateExternalTable { options, .. } ,
211
- ) )
212
- | LogicalPlan :: Copy ( CopyTo { options, .. } ) => {
213
- expected_options. iter ( ) . for_each ( |( k, v) | {
214
- assert_eq ! ( Some ( & v. to_string( ) ) , options. get( * k) ) ;
215
- } ) ;
216
- }
217
- _ => panic ! (
218
- "Expected Ddl(CreateExternalTable) or Copy(CopyTo) but got {:?}" ,
219
- plan
220
- ) ,
221
- }
222
- } else {
223
- assert_eq ! ( expected_plan, plan. unwrap_err( ) . strip_backtrace( ) ) ;
224
- }
225
- }
226
- }
227
-
228
163
#[ test]
229
164
fn select_no_relation ( ) {
230
165
quick_test (
0 commit comments