@@ -7,12 +7,15 @@ extern bool inside_main = true;
77
88
99local_result * queryToBuffer (
10- const std::string & queryStr, const std::string & format = " CSV" , const std::string & path = {}, const std::string & udfPath = {})
10+ const std::string & queryStr,
11+ const std::string & output_format = " CSV" ,
12+ const std::string & path = {},
13+ const std::string & udfPath = {})
1114{
1215 std::vector<std::string> argv = {" clickhouse" , " --" , " --multiquery" };
1316
1417 // If format is "Debug" or "debug", then we will add `--verbose` and `--log-level=trace` to argv
15- if (format == " Debug" || format == " debug" )
18+ if (output_format == " Debug" || output_format == " debug" )
1619 {
1720 argv.push_back (" --verbose" );
1821 argv.push_back (" --log-level=trace" );
@@ -22,7 +25,7 @@ local_result * queryToBuffer(
2225 else
2326 {
2427 // Add format string
25- argv.push_back (" --output-format=" + format );
28+ argv.push_back (" --output-format=" + output_format );
2629 }
2730
2831 // If udfPath is not empty, then we will add `--user_scripts_path` and `--user_defined_executable_functions_config` to argv
@@ -52,10 +55,13 @@ local_result * queryToBuffer(
5255
5356// Pybind11 will take over the ownership of the `query_result` object
5457// using smart ptr will cause early free of the object
55- query_result *
56- query (const std::string & queryStr, const std::string & format = " CSV" , const std::string & path = {}, const std::string & udfPath = {})
58+ query_result * query (
59+ const std::string & queryStr,
60+ const std::string & output_format = " CSV" ,
61+ const std::string & path = {},
62+ const std::string & udfPath = {})
5763{
58- return new query_result (queryToBuffer (queryStr, format , path, udfPath));
64+ return new query_result (queryToBuffer (queryStr, output_format , path, udfPath));
5965}
6066
6167// The `query_result` and `memoryview_wrapper` will hold `local_result_wrapper` with shared_ptr
@@ -142,7 +148,7 @@ PYBIND11_MODULE(_chdb, m)
142148 " query" ,
143149 &query,
144150 py::arg (" queryStr" ),
145- py::arg (" format " ) = " CSV" ,
151+ py::arg (" output_format " ) = " CSV" ,
146152 py::kw_only (),
147153 py::arg (" path" ) = " " ,
148154 py::arg (" udf_path" ) = " " ,
0 commit comments