generated from duckdb/extension-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into combined-log
- Loading branch information
Showing
18 changed files
with
784 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
duckdb/.clang-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
duckdb/.clang-tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ duckdb_unittest_tempdir/ | |
testext | ||
test/python/__pycache__/ | ||
.Rhistory | ||
__pycache__ | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
httpx==0.28.1 | ||
pytest==8.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
#pragma once | ||
|
||
#include "duckdb.hpp" | ||
#include "duckdb/common/file_system.hpp" | ||
|
||
namespace duckdb { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
#include <cstdint> | ||
|
||
namespace duckdb { | ||
|
||
struct ReqStats { | ||
float elapsed_sec; | ||
uint64_t read_bytes; | ||
uint64_t read_rows; | ||
}; | ||
|
||
} // namespace duckdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
|
||
#include "duckdb/main/query_result.hpp" | ||
#include "yyjson.hpp" | ||
|
||
namespace duckdb { | ||
using namespace duckdb_yyjson; // NOLINT(*-build-using-namespace) | ||
|
||
class ResultSerializer { | ||
public: | ||
explicit ResultSerializer(const bool _set_invalid_values_to_null = false) | ||
: set_invalid_values_to_null(_set_invalid_values_to_null) { | ||
doc = yyjson_mut_doc_new(nullptr); | ||
} | ||
|
||
virtual ~ResultSerializer() { | ||
yyjson_mut_doc_free(doc); | ||
} | ||
|
||
std::string YY_ToString() { | ||
auto data = yyjson_mut_write(doc, 0, nullptr); | ||
if (!data) { | ||
throw SerializationException("Could not render yyjson document"); | ||
} | ||
std::string json_output(data); | ||
free(data); | ||
return json_output; | ||
} | ||
|
||
protected: | ||
void SerializeInternal(QueryResult &query_result, yyjson_mut_val *append_root, bool values_as_array); | ||
|
||
void SerializeChunk(const DataChunk &chunk, vector<string> &names, vector<LogicalType> &types, | ||
yyjson_mut_val *append_root, bool values_as_array); | ||
|
||
yyjson_mut_val *SerializeRowAsArray(const DataChunk &chunk, idx_t row_idx, vector<LogicalType> &types); | ||
|
||
yyjson_mut_val *SerializeRowAsObject(const DataChunk &chunk, idx_t row_idx, vector<string> &names, | ||
vector<LogicalType> &types); | ||
|
||
void SerializeValue(yyjson_mut_val *parent, const Value &value, optional_ptr<string> name, const LogicalType &type); | ||
|
||
yyjson_mut_doc *doc; | ||
bool set_invalid_values_to_null; | ||
}; | ||
} // namespace duckdb |
Oops, something went wrong.