add support for duckdb's lambda syntax

Đang mở
#1,171 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust, sql
Lĩnh vực
backend, databases

Hướng nghiên cứu

Start by locating SQLPage's SQL parsing and preparation entry points, then inspect the parser tests for database-specific syntax. Reproduce the failure with the supplied DuckDB list_filter(lambda ...) query and verify any change against the existing parser tests. Done means SQLPage accepts this valid DuckDB lambda syntax without breaking other SQL parsing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
Introduction

When using the list_filter function, SQLPage throws an error, stating it's unable to parse the SQL statement (while valid in the underlying database).

To Reproduce

List of steps to reproduce the behavior. Include the sql file you are using and the eventual relevant parts of your database schema

-- DDL statement to create the table:
CREATE SCHEMA loipro;

CREATE TABLE loipro."data"(
    row_num BIGINT
    , filepath VARCHAR[]
    , filename VARCHAR
    , msg_dt DATE
    , ChangeTimestamp TIMESTAMP
    , Components STRUCT(ComponentNumber VARCHAR, Quantity VARCHAR, UnitOfMeasure VARCHAR, Scrap VARCHAR, BomPosition VARCHAR, IssueingStorageLoc VARCHAR, OperationNumberMat VARCHAR, ItemCategory VARCHAR, Backflush VARCHAR)[]
    , ChangeDate VARCHAR
    , Operations STRUCT(OperationNumber VARCHAR, MachineCode VARCHAR, SetupGroupCategory VARCHAR, ProcStartDate VARCHAR, ProcStartTime VARCHAR, EndDatOperation VARCHAR, EndTimeOperation VARCHAR, SetupTime VARCHAR, SetupTimeUOM VARCHAR)[]
    , PlantID VARCHAR
    , Unit VARCHAR
    , QuantityPlanned VARCHAR
    , ChangeTime VARCHAR
    , ArticleNumber VARCHAR
    , OrderNumber VARCHAR
    , OrderType VARCHAR
    , ReceivingStorageLoc VARCHAR
    , ProductionVersion VARCHAR
);

Query in SQLPlan causing the issue:

SET orders_wo_material = 
    select count(1)
    from loipro.data
    where ArticleNumber IS NULL
        or Components.list_filter(lambda x: x.ComponentNumber is NULL).length() = Components.length()
;
Actual behavior
[2026-01-04T11:37:10.849Z ERROR sqlpage::webserver::database::execute_queries] Parsing failed: SQLPage couldn't understand the SQL file. Please check for syntax errors on line 28:
        where ArticleNumber IS NULL
            or Components.list_filter(lambda x: x.ComponentNumber is NULL).length() = Components.length()
                                            ⬆️
    ;
    Caused by:
        0: sql parser error: Expected: ), found: x at Line: 28, Column: 42
        1: loipro/index.sql contains a syntax error preventing SQLPage from parsing and preparing its SQL statements.
[2026-01-04T11:37:10.849Z ERROR sqlpage::render] SQL error: Parsing failed: SQLPage couldn't understand the SQL file. Please check for syntax errors on line 28:
        where ArticleNumber IS NULL
            or Components.list_filter(lambda x: x.ComponentNumber is NULL).length() = Components.length()
                                            ⬆️
    ;
    Caused by:
        0: sql parser error: Expected: ), found: x at Line: 28, Column: 42
        1: loipro/index.sql contains a syntax error preventing SQLPage from parsing and preparing its SQL statements.
Screenshots
Image
Expected behavior

Expected a single (numeric) value to be returned and stored in the variable.

Version information
  • OS: macOS 26.2
  • Database: DuckDB v1.4.3 (Andium) d1dc88f950
  • ODBC: unixODBC 2.3.14
  • DuckDB ODBC driver version: 1.4.3.0
  • SQLPage Version : sqlpage 0.41.0
Ngôn ngữ chính
Rust
Star
2.6k
Fork
175
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
43

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sqlpage/SQLPage

Tất cả issue của sqlpage/SQLPage

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.