Skip to content

[Feature Request]: Support OFFSET without LIMIT for Power BI DirectQuery folding #26769

Closed

Description

@iamlinjunhong

Problem

Power Query's ODBC SQL generator requires a dialect to accept all three forms before a connector can advertise LimitClauseKind.LimitOffset:

LIMIT n
LIMIT n OFFSET m
OFFSET m

MatrixOne supports the first two forms, but the offset-only form fails. This prevents the MatrixOne Power BI connector from safely folding Table.Skip/offset-only DirectQuery operations.

Reproduction

Tested on MatrixOne main commit d0057b3503611022cdf9a6e24c98065d209eb8e4 (8.0.30-MatrixOne-v):

CREATE DATABASE IF NOT EXISTS pbi_offset;
CREATE TABLE IF NOT EXISTS pbi_offset.t (id INT);
INSERT INTO pbi_offset.t VALUES (1), (2), (3);
SELECT id FROM pbi_offset.t ORDER BY id OFFSET 1;

Actual result:

ERROR 1064 (HY000): SQL parser error ... syntax error ... near " OFFSET 1"

The parameterized form needed by ODBC also needs to work:

SELECT id FROM pbi_offset.t ORDER BY id OFFSET ?

Expected behavior

The offset-only query returns rows 2, 3, and the prepared form accepts an integer parameter.

Power BI impact

Microsoft's ODBC connector guidance says LimitClauseKind.LimitOffset requires offset without limit. Until MatrixOne supports this syntax, matrixone-odbc must conservatively advertise LimitClauseKind.Limit, which reduces query folding for skip/pagination operations in DirectQuery.

Reference: https://github.com/microsoft/DataConnectors/blob/master/samples/ODBC/SqlODBC/SqlODBC.pq

Suggested coverage

  • parser and execution tests for literal OFFSET n without LIMIT
  • prepared-statement test for OFFSET ?
  • ORDER BY plus offset-only result correctness

Activity

  1. added
    kind/compatibility
    on Aug 7, 2026
  2. iamlinjunhong commented on Aug 7, 2026

    @iamlinjunhong
    ContributorAuthor

    The MatrixOne ODBC connector now has a compatibility PR at matrixorigin/matrixone-odbc#7. It conservatively advertises Power Query LimitClauseKind.Limit and keeps OFFSET-without-LIMIT as an executable XFAIL. Once this issue is fixed, the test will turn into a normal pass and the connector can safely restore LimitOffset folding.

  3. added
    severity/s0
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/compatibilitykind/featureseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions