File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -282,15 +282,15 @@ impl ClickhouseConfig {
282282
283283 // Validate that batch_encoding is only compatible with ArrowStream format
284284 if self . format != Format :: ArrowStream {
285+ let format_name = serde_json:: to_value ( & self . format )
286+ . ok ( )
287+ . and_then ( |v| v. as_str ( ) . map ( String :: from) )
288+ . unwrap_or_else ( || self . format . to_string ( ) ) ;
289+
285290 return Err ( format ! (
286291 "'batch_encoding' is only compatible with 'format: arrow_stream'. \
287292 Found 'format: {}'.",
288- match self . format {
289- Format :: JsonEachRow => "json_each_row" ,
290- Format :: JsonAsObject => "json_as_object" ,
291- Format :: JsonAsString => "json_as_string" ,
292- Format :: ArrowStream => "arrow_stream" ,
293- }
293+ format_name
294294 )
295295 . into ( ) ) ;
296296 }
You can’t perform that action at this time.
0 commit comments