add support for duckdb's lambda syntax

オープン
#1,171 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, sql
領域
backend, databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
Rust
スター
2.6k
フォーク
175
平均マージ
14時間 16分
マージ済み PR(30日)
43

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sqlpage/SQLPage のほかの issue

sqlpage/SQLPage の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。