Skip to content

Commit

Permalink
Merge branch 'main' into iejoin-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkfish committed Aug 6, 2024
2 parents 935ee2b + aef7bf2 commit f71fee6
Show file tree
Hide file tree
Showing 625 changed files with 13,421 additions and 1,890 deletions.
3 changes: 3 additions & 0 deletions .github/config/in_tree_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ duckdb_extension_load(json)
duckdb_extension_load(parquet)
duckdb_extension_load(tpcds)
duckdb_extension_load(tpch)

# Test extension for the upcoming C CAPI extensions
duckdb_extension_load(demo_capi DONT_LINK)
13 changes: 3 additions & 10 deletions .github/workflows/LinuxRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,9 @@ jobs:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

steps:
- name: Handrolled checkout
shell: bash
env:
REPO_NAME: ${{ github.repository }}
REPO_REF: ${{ inputs.git_ref }}
run: |
git config --global --add safe.directory $(pwd)
git clone https://github.com/$REPO_NAME .
git fetch
git checkout $REPO_REF
- uses: actions/checkout@v3
with:
ref: ${{ inputs.git_ref }}

- uses: ./.github/actions/manylinux_2014_setup
with:
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/Main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,28 +212,3 @@ jobs:
- name: Test
shell: bash
run: valgrind ./build/debug/test/unittest test/sql/tpch/tpch_sf001.test_slow

docs:
name: Website Docs
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-20.04
needs: linux-debug
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Clone Website
shell: bash
run: git clone https://github.com/duckdb/duckdb-web

- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Package
shell: bash
run: |
cd duckdb-web
python3 scripts/generate_docs.py ..
2 changes: 1 addition & 1 deletion .github/workflows/NightlyTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DUCKDB_WASM_VERSION: "66a481954b89a046cb7c48c448163ea5e9179199"
DUCKDB_WASM_VERSION: "cf2048bd6d669ffa05c56d7d453e09e99de8b87e"
CCACHE_SAVE: ${{ github.repository != 'duckdb/duckdb' }}
BASE_BRANCH: ${{ github.base_ref || (endsWith(github.ref, '_feature') && 'feature' || 'main') }}

Expand Down
47 changes: 40 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -787,19 +787,21 @@ if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TID
endif()
endif()

function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERSION PARAMETERS)
function(build_loadable_extension_directory NAME ABI_TYPE OUTPUT_DIRECTORY EXTENSION_VERSION CAPI_VERSION PARAMETERS)
set(TARGET_NAME ${NAME}_loadable_extension)
if (LOCAL_EXTENSION_REPO)
add_dependencies(duckdb_local_extension_repo ${NAME}_loadable_extension)
endif()
# all parameters after output_directory
set(FILES "${ARGV}")
# remove name, output_directory, extension_version, parameters
list(REMOVE_AT FILES 0 1 2 3)
# remove name, abi_type, output_directory, extension_version, capi_version, parameters
list(REMOVE_AT FILES 0 1 2 3 4 5)

# parse parameters
string(FIND "${PARAMETERS}" "-no-warnings" IGNORE_WARNINGS)

string(TOUPPER ${NAME} EXTENSION_NAME_UPPERCASE)

if(EMSCRIPTEN)
add_library(${TARGET_NAME} STATIC ${FILES})
else()
Expand All @@ -823,6 +825,8 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS
# dynamic loader will look up the missing symbols when the extension is dlopen-ed.
if(WASM_LOADABLE_EXTENSIONS)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sSIDE_MODULE=1 -DWASM_LOADABLE_EXTENSIONS")
elseif(${ABI_TYPE} STREQUAL "C_STRUCT")
# TODO strip all symbols except the capi init
elseif (EXTENSION_STATIC_BUILD)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
if (APPLE)
Expand Down Expand Up @@ -870,17 +874,29 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY EXTENSION_VERS
# Compile the library into the actual wasm file
string(TOUPPER ${NAME} EXTENSION_NAME_UPPERCASE)
string(REPLACE ";" " " TO_BE_LINKED "${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_LINKED_LIBS}")
if (${ABI_TYPE} STREQUAL "CPP")
set(EXPORTED_FUNCTIONS "_${NAME}_init,_${NAME}_version")
elseif (${ABI_TYPE} STREQUAL "C_STRUCT")
set(EXPORTED_FUNCTIONS "_${NAME}_init_c_api")
endif()
add_custom_command(
TARGET ${TARGET_NAME}
POST_BUILD
COMMAND emcc $<TARGET_FILE:${TARGET_NAME}> -o $<TARGET_FILE:${TARGET_NAME}>.wasm -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="_${NAME}_init,_${NAME}_version" ${WASM_THREAD_FLAGS} ${TO_BE_LINKED}
COMMAND emcc $<TARGET_FILE:${TARGET_NAME}> -o $<TARGET_FILE:${TARGET_NAME}>.wasm -O3 -sSIDE_MODULE=2 -sEXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS}" ${WASM_THREAD_FLAGS} ${TO_BE_LINKED}
)
endif()

if (${ABI_TYPE} STREQUAL "CPP")
set(FOOTER_VERSION_VALUE ${DUCKDB_NORMALIZED_VERSION})
elseif (${ABI_TYPE} STREQUAL "C_STRUCT")
set(FOOTER_VERSION_VALUE ${CAPI_VERSION})
endif()

add_custom_command(
TARGET ${TARGET_NAME}
POST_BUILD
COMMAND
${CMAKE_COMMAND} -DEXTENSION=$<TARGET_FILE:${TARGET_NAME}>${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DDUCKDB_VERSION="${DUCKDB_NORMALIZED_VERSION}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake
${CMAKE_COMMAND} -DABI_TYPE=${ABI_TYPE} -DEXTENSION=$<TARGET_FILE:${TARGET_NAME}>${EXTENSION_POSTFIX} -DPLATFORM_FILE=${DuckDB_BINARY_DIR}/duckdb_platform_out -DVERSION_FIELD="${FOOTER_VERSION_VALUE}" -DEXTENSION_VERSION="${EXTENSION_VERSION}" -DNULL_FILE=${DUCKDB_MODULE_BASE_DIR}/scripts/null.txt -P ${DUCKDB_MODULE_BASE_DIR}/scripts/append_metadata.cmake
)
add_dependencies(${TARGET_NAME} duckdb_platform)
if (NOT EXTENSION_CONFIG_BUILD AND NOT ${EXTENSION_TESTS_ONLY} AND NOT CLANG_TIDY)
Expand All @@ -894,7 +910,16 @@ function(build_loadable_extension NAME PARAMETERS)
list(REMOVE_AT FILES 0 1)
string(TOUPPER ${NAME} EXTENSION_NAME_UPPERCASE)

build_loadable_extension_directory(${NAME} "extension/${NAME}" "${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION}" "${PARAMETERS}" ${FILES})
build_loadable_extension_directory(${NAME} "CPP" "extension/${NAME}" "${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION}" "" "${PARAMETERS}" ${FILES})
endfunction()

function(build_loadable_extension_capi NAME CAPI_VERSION PARAMETERS)
# all parameters after name
set(FILES "${ARGV}")
list(REMOVE_AT FILES 0 1)
string(TOUPPER ${NAME} EXTENSION_NAME_UPPERCASE)

build_loadable_extension_directory(${NAME} "C_STRUCT" "extension/${NAME}" "${DUCKDB_EXTENSION_${EXTENSION_NAME_UPPERCASE}_EXT_VERSION}" "${CAPI_VERSION}" "${PARAMETERS}" ${FILES})
endfunction()

function(build_static_extension NAME PARAMETERS)
Expand Down Expand Up @@ -1001,6 +1026,14 @@ endmacro()
function(duckdb_extension_generate_version OUTPUT_VAR WORKING_DIR)
find_package(Git)
if(Git_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
WORKING_DIRECTORY ${WORKING_DIR}
OUTPUT_VARIABLE IS_IN_GIT_DIR
ERROR_QUIET
)
endif()
if (IS_IN_GIT_DIR)
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
WORKING_DIRECTORY ${WORKING_DIR}
Expand Down Expand Up @@ -1075,7 +1108,7 @@ function(duckdb_extension_load NAME)
elseif (NOT "${duckdb_extension_load_SOURCE_DIR}" STREQUAL "")
# Version detection
if ("${duckdb_extension_load_EXTENSION_VERSION}" STREQUAL "")
duckdb_extension_generate_version(EXT_VERSION ${CMAKE_CURRENT_LIST_DIR})
duckdb_extension_generate_version(EXT_VERSION ${duckdb_extension_load_SOURCE_DIR})
else()
set(EXT_VERSION ${duckdb_extension_load_EXTENSION_VERSION})
endif()
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This project and everyone participating in it is governed by a [Code of Conduct]

* Use tabs for indentation, spaces for alignment.
* Lines should not exceed 120 columns.
* To make sure the formatting is consistent, please use version 10.0.1, installable through `python3 -m pip install clang-format==10.0.1.1`
* To make sure the formatting is consistent, please use version 11.0.1, installable through `python3 -m pip install clang-format==11.0.1` or `pipx install clang-format==11.0.1`.
* `clang_format` and `black` enforce these rules automatically, use `make format-fix` to run the formatter.
* The project also comes with an [`.editorconfig` file](https://editorconfig.org/) that corresponds to these rules.

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ tidy-check-diff:
cd build/tidy && \
cmake -DCLANG_TIDY=1 -DDISABLE_UNITY=1 -DBUILD_EXTENSIONS=parquet -DBUILD_PYTHON_PKG=TRUE -DBUILD_SHELL=0 ../.. && \
cd ../../ && \
git diff origin/main . ':(exclude)test' ':(exclude)benchmark' ':(exclude)third_party' ':(exclude)src/common/adbc' ':(exclude)src/main/capi' | python3 scripts/clang-tidy-diff.py -path build/tidy -quiet ${TIDY_THREAD_PARAMETER} ${TIDY_BINARY_PARAMETER} ${TIDY_PERFORM_CHECKS} -p1
git diff origin/main . ':(exclude)tools' ':(exclude)extension' ':(exclude)test' ':(exclude)benchmark' ':(exclude)third_party' ':(exclude)src/common/adbc' ':(exclude)src/main/capi' | python3 scripts/clang-tidy-diff.py -path build/tidy -quiet ${TIDY_THREAD_PARAMETER} ${TIDY_BINARY_PARAMETER} ${TIDY_PERFORM_CHECKS} -p1

tidy-fix:
mkdir -p ./build/tidy && \
Expand Down Expand Up @@ -457,6 +457,7 @@ coverage-check:
./scripts/coverage_check.sh

generate-files:
python3 scripts/generate_c_api.py
python3 scripts/generate_functions.py
python3 scripts/generate_serialization.py
python3 scripts/generate_enum_util.py
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions data/csv/auto/normalize_names_1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
A,B,C
123,TEST1,text1
345,TEST1,text2

4 changes: 4 additions & 0 deletions data/csv/auto/normalize_names_2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select,insert,join
123,TEST1,text1
345,TEST1,text2

4 changes: 4 additions & 0 deletions data/csv/auto/normalize_names_3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0_a,1_b,9_c
123,TEST1,text1
345,TEST1,text2

4 changes: 4 additions & 0 deletions data/csv/auto/normalize_names_4.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
állo,teÔst,☀
123,TEST1,text1
345,TEST1,text2

3 changes: 3 additions & 0 deletions data/csv/auto/normalize_names_5.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# a ,b , c
123,TEST1,text1
345,TEST1,text2
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Aₐₓ #,ᴴᵉᴸᴸᵒ ᵂᵒᴿᴸᵈ , Qty (m²)
123,TEST2,text1
345,TEST2,text2
123,TEST1,text1
345,TEST1,text2
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions data/csv/error/mid_null.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a;b;c
1;2;3
;;;;;d
1;2;3
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f71fee6

Please sign in to comment.