diff --git a/.github/workflows/MainDistributionPipeline.yml b/.github/workflows/MainDistributionPipeline.yml index 9c03355..c130c02 100644 --- a/.github/workflows/MainDistributionPipeline.yml +++ b/.github/workflows/MainDistributionPipeline.yml @@ -4,72 +4,26 @@ name: Main Extension Distribution Pipeline on: push: - paths-ignore: - - "*/**.md" - - "*/**.yml" pull_request: workflow_dispatch: - release: - types: [published] concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' && github.sha || '' }} cancel-in-progress: true jobs: -# Temporarily disabled because main is broken # duckdb-next-build: -# name: Build extension binaries (next) +# name: Build extension binaries # uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main # with: -# duckdb_version: 1.1.2 -# ci_tools_version: 1.1.2 +# duckdb_version: main +# ci_tools_version: main # extension_name: chsql - # We have to build v1.2.0 based due to go-duckdb restrictions - duckdb-1-2-0-build: - name: Build extension binaries - uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.2.1 - with: - duckdb_version: v1.2.0 - ci_tools_version: v1.2.0 - extension_name: chsql duckdb-stable-build: name: Build extension binaries - uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@v1.2.1 + uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main with: - duckdb_version: v1.2.1 - ci_tools_version: v1.2.1 + duckdb_version: v1.3.0 + ci_tools_version: v1.3.0 extension_name: chsql - - release-all-artifacts: - name: Process Extension Artifacts - needs: [duckdb-1-2-0-build, duckdb-stable-build] - if: github.event_name == 'release' && github.event.action == 'published' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Download all artifacts - uses: actions/download-artifact@v4 - with: - path: downloaded-artifacts - - - name: List downloaded artifacts - run: | - mkdir to-upload; \ - echo "Artifacts downloaded:" \ - ls -la downloaded-artifacts; \ - for l in `ls downloaded-artifacts`; do \ - VER=`echo $l | cut -d '-' -f 2`; \ - ARCH=`echo $l| cut -d '-' -f 4`; \ - EXT=`ls downloaded-artifacts/$l | cut -b 7-`; \ - mv downloaded-artifacts/$l/chsql.$EXT to-upload/chsql.$VER.$ARCH.$EXT; \ - done; \ - echo "Artifacts to be uploaded:" \ - ls -la to-upload - - - name: Upload Release Assets - uses: softprops/action-gh-release@v1 - with: - files: to-upload/* \ No newline at end of file diff --git a/chsql/CMakeLists.txt b/chsql/CMakeLists.txt index a3375c5..919a25a 100644 --- a/chsql/CMakeLists.txt +++ b/chsql/CMakeLists.txt @@ -19,15 +19,14 @@ include_directories( ../duckdb/third_party/thrift ../duckdb/third_party/snappy ../duckdb/third_party/zstd/include - ../duckdb/third_party/mbedtls ../duckdb/third_party/mbedtls/include ../duckdb/third_party/brotli/include) set(EXTENSION_SOURCES src/chsql_extension.cpp src/duck_flock.cpp src/chsql_system.cpp src/parquet_types.cpp) build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES}) build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES}) # Link OpenSSL in both the static library as the loadable extension -target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto) -target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto) +target_link_libraries(${EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto duckdb_mbedtls) +target_link_libraries(${LOADABLE_EXTENSION_NAME} OpenSSL::SSL OpenSSL::Crypto duckdb_mbedtls) install( TARGETS ${EXTENSION_NAME} EXPORT "${DUCKDB_EXPORT_SET}" diff --git a/chsql/extension_config.cmake b/chsql/extension_config.cmake index 4ec1a10..7ae21d2 100644 --- a/chsql/extension_config.cmake +++ b/chsql/extension_config.cmake @@ -8,7 +8,7 @@ include_directories( ../duckdb/third_party/thrift ../duckdb/third_party/snappy ../duckdb/third_party/zstd/include - ../duckdb/third_party/mbedtls +# ../duckdb/third_party/mbedtls ../duckdb/third_party/mbedtls/include ../duckdb/third_party/brotli/include) diff --git a/chsql/src/duck_flock.cpp b/chsql/src/duck_flock.cpp index 79a821d..b93eaaa 100644 --- a/chsql/src/duck_flock.cpp +++ b/chsql/src/duck_flock.cpp @@ -104,7 +104,7 @@ namespace duckdb { try { if (res->TryFetch(data_chunk, error_data)) { - if (data_chunk && !data_chunk->size() == 0) { + if (data_chunk && data_chunk->size() != 0) { output.Append(*data_chunk); return; } diff --git a/chsql/src/parquet_ordered_scan.cpp b/chsql/src/parquet_ordered_scan.cpp index e41117b..81dd069 100644 --- a/chsql/src/parquet_ordered_scan.cpp +++ b/chsql/src/parquet_ordered_scan.cpp @@ -2,7 +2,7 @@ #include "duckdb/common/exception.hpp" #include #include "chsql_extension.hpp" -#include +#include #include "chsql_parquet_types.h" namespace duckdb { @@ -35,11 +35,10 @@ namespace duckdb { haveAbsentColumns = true; continue; } - columnMap.push_back(schema_column - reader->metadata->metadata->schema.begin() - 1); - reader->reader_data.column_ids.push_back( - schema_column - reader->metadata->metadata->schema.begin() - 1); - reader->reader_data.column_mapping.push_back( - it - returnCols.begin()); + columnMap.push_back(static_cast(schema_column - reader->metadata->metadata->schema.begin() - 1)); + reader->column_ids.push_back( + MultiFileLocalColumnId(static_cast(schema_column - reader->metadata->metadata->schema.begin() - 1))); + reader->column_indexes.emplace_back(static_cast(it - returnCols.begin())); } auto order_by_column_it = find_if( reader->metadata->metadata->schema.begin(), @@ -55,7 +54,7 @@ namespace duckdb { } void Scan(ClientContext& ctx) { chunk->Reset(); - reader->Scan(*scanState, *chunk); + reader->Scan(ctx, *scanState, *chunk); if (!haveAbsentColumns || chunk->size() == 0) { return; } @@ -180,7 +179,7 @@ namespace duckdb { ParquetOptions po; po.binary_as_string = true; set->reader = make_uniq(context, file, po, nullptr); - res.push_back(move(set)); + res.push_back(std::move(set)); } } @@ -189,16 +188,16 @@ namespace duckdb { Connection conn(*context.db); auto res = make_uniq(); auto files = ListValue::GetChildren(input.inputs[0]); - vector fileNames; + vector fileInfoList; for (auto & file : files) { - fileNames.push_back(file.ToString()); + fileInfoList.emplace_back(file.ToString()); } - GlobMultiFileList fileList(context, fileNames, FileGlobOptions::ALLOW_EMPTY); - string filename; + GlobMultiFileList fileList(context, fileInfoList, FileGlobOptions::ALLOW_EMPTY); + OpenFileInfo file_info; MultiFileListScanData it; fileList.InitializeScan(it); - while (fileList.Scan(it, filename)) { - res->files.push_back(filename); + while (fileList.Scan(it, file_info)) { + res->files.push_back(file_info.path); } if (res->files.empty()) { throw InvalidInputException("No files matched the provided pattern."); diff --git a/duckdb b/duckdb index 7c0f857..71c5c07 160000 --- a/duckdb +++ b/duckdb @@ -1 +1 @@ -Subproject commit 7c0f8574bda9af7aa5b23166d7860d68ae3b9481 +Subproject commit 71c5c07cdd295e9409c0505885033ae9eb6b5ddd diff --git a/extension-ci-tools b/extension-ci-tools index 58970c5..71d2002 160000 --- a/extension-ci-tools +++ b/extension-ci-tools @@ -1 +1 @@ -Subproject commit 58970c538d35919db875096460c05806056f4de0 +Subproject commit 71d20029c5314dfc34f3bbdab808b9bce03b8003