ClickHouse/src/TableFunctions/CMakeLists.txt
Ubuntu a85cf758b0 Fuzz JSON table function
Create a table function `fuzzJSON`

An example query:
```
CREATE NAMED COLLECTION json_fuzzer AS json_str={};

SELECT *
FROM fuzzJSON(json_fuzzer, json_str = '{"students" : ["Alice", "Bob"]}', random_seed = 666, max_output_length = 128, probability = 0.9)
LIMIT 3

Query id: 7f802052-efb0-41b4-87fa-03b7dd290e9d

┌─json──────────────────────────────────────────────────────────────────────────────────┐
│ {"ade0yX":[9200406572736542991, true, "sm"]}                                          │
│ {"students":["Alice", "eSN3WO#a6NYTBe0$#OWwyIQ"], "cVoP2BuQugQ":17384271928263249403} │
│ {"students":["Alice", "Bob", "T+-k4+PJGkL%XRRaF2BoeN@&A"]}                            │
└───────────────────────────────────────────────────────────────────────────────────────┘
```

Next step:
* Generate invalid string

Fixes #35962

add Object('json')

use named collection
2023-11-28 01:58:24 +00:00

39 lines
1.3 KiB
CMake

include("${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake")
add_headers_and_sources(clickhouse_table_functions .)
if (TARGET ch_contrib::hivemetastore)
add_headers_and_sources(clickhouse_table_functions Hive)
endif ()
extract_into_parent_list(clickhouse_table_functions_sources dbms_sources
ITableFunction.cpp
TableFunctionView.cpp
TableFunctionFactory.cpp
)
extract_into_parent_list(clickhouse_table_functions_headers dbms_headers
ITableFunction.h
TableFunctionView.h
TableFunctionFactory.h
)
add_library(clickhouse_table_functions ${clickhouse_table_functions_headers} ${clickhouse_table_functions_sources})
target_link_libraries(clickhouse_table_functions PRIVATE clickhouse_parsers clickhouse_storages_system dbms)
if (TARGET ch_contrib::hivemetastore)
target_link_libraries(clickhouse_table_functions PRIVATE ch_contrib::hivemetastore ch_contrib::hdfs ch_contrib::parquet)
endif ()
if (TARGET ch_contrib::azure_sdk)
target_link_libraries(clickhouse_table_functions PRIVATE ch_contrib::azure_sdk)
endif ()
if (TARGET ch_contrib::simdjson)
target_link_libraries(clickhouse_table_functions PRIVATE ch_contrib::simdjson)
endif ()
if (TARGET ch_contrib::rapidjson)
target_link_libraries(clickhouse_table_functions PRIVATE ch_contrib::rapidjson)
endif ()