File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ def to_arrowTable(res):
35
35
print (f'ImportError: { e } ' )
36
36
print ('Please install pyarrow and pandas via "pip install pyarrow pandas"' )
37
37
raise ImportError ('Failed to import pyarrow or pandas' ) from None
38
-
38
+ if len (res .get_memview ()) == 0 :
39
+ return pa .Table .from_batches ([], schema = pa .schema ([]))
39
40
return pa .RecordBatchFileReader (res .get_memview ()).read_all ()
40
41
41
42
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ namespace DB
61
61
namespace ErrorCodes
62
62
{
63
63
extern const int BAD_ARGUMENTS;
64
+ extern const int UNKNOWN_FORMAT;
64
65
extern const int CANNOT_LOAD_CONFIG;
65
66
extern const int FILE_ALREADY_EXISTS;
66
67
}
@@ -557,6 +558,11 @@ void LocalServer::processConfig()
557
558
global_context->setMacros (std::make_unique<Macros>(config (), " macros" , log));
558
559
559
560
format = config ().getString (" output-format" , config ().getString (" format" , is_interactive ? " PrettyCompact" : " TSV" ));
561
+
562
+ // / Check format is supported before the engine runs too far
563
+ if (!FormatFactory::instance ().isOutputFormat (format))
564
+ throw Exception (ErrorCodes::UNKNOWN_FORMAT, " Unknown output format {}" , format);
565
+
560
566
insert_format = " Values" ;
561
567
562
568
// / Setting value from cmd arg overrides one from config
You can’t perform that action at this time.
0 commit comments