Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl MultipliedMeasuresQueryPlanner {
schema,
filter: logical_filter,
offset: self.query_properties.offset(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch there. I noticed the offset is still present here and wanted to share some thoughts (though I'm still familiarizing myself with the codebase, so please correct me if I'm missing something).

From what I understand, there might be a few considerations regarding offset in subqueries:

  1. Database compatibility: Different databases have varying requirements for offset usage:
    MSSQL requires an ORDER BY clause when using OFFSET
    MySQL requires OFFSET to be paired with a LIMIT clause
  2. Pagination concerns: I'm wondering if pagination logic should be restricted to the outer query only? My understanding is that applying pagination to inner queries could potentially lead to data inconsistencies, especially when the API request includes result pagination.

Would it make sense to remove the offset from this subquery as well? I'd appreciate your thoughts on this, as you likely have more context about the intended behavior here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@UsmanYasin Thank you so much for catching that! The offset really isn’t needed here — that was my mistake, and I’ve removed it.
More broadly, I think this part could use a small refactor to prevent both limit and offset from being set at all in this context. I’ve been thinking about that, and as I find time, I plan to gradually refactor things to (hopefully) improve the architecture and overall clarity.

limit: self.query_properties.row_limit(),
limit: None,
ungrouped: self.query_properties.ungrouped(),
dimension_subqueries: subquery_dimension_queries,
source: SimpleQuerySource::LogicalJoin(source),
Expand Down
Loading