Open
Description
We have two version of this extension:
Working Example
main
: the main branch contains a version based on a table function.
It invokes wvlet functions correctly, converts input to SQL and returns results:
D select * from wvlet('from [[1]] as numbers(a)');
-- wvlet version=0.0.0+1-d1d99f7b, src=01JEVTWDECV00NJH6Z93KYQE8J.wv:1
select * from (values (1)) as numbers(a)
┌───────┐
│ a │
│ int32 │
├───────┤
│ 1 │
└───────┘
string query = input[i].GetString();
std::string json = "[\"-q\", \"" + query + "\"]";
const char* sql_result = wvlet_compile_query(json.c_str());
Failing Example
query-planner
: this branch contains a query planner version.
Same library, same functions. In this version, invoking wvlet causes a segfault when trying to convert to SQL, before even attempting to return data into DuckDB:
D from [[1]] as numbers(a);
segfault
The code is essentially the same, and the passed types are correct.
std::string json = "[\"-q\", \"" + query + "\"]";
wvlet_compile_main(json.c_str());
const char* sql_result = wvlet_compile_query(json.c_str());
if (!sql_result || strlen(sql_result) == 0) {
throw std::runtime_error("Failed to compile wvlet script");
}
Metadata
Metadata
Assignees
Labels
No labels