E525 feat: add pivot sql to compile sql endpoint by almeidabbm · Pull Request #19743 · lightdash/lightdash · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@almeidabbm
Copy link
Contributor
@almeidabbm almeidabbm commented Jan 27, 2026

Closes: #XXXX

Description:

Added support for pivot queries in the explore API. The /api/v1/projects/{projectUuid}/explores/compileQuery endpoint now accepts a pivotConfiguration parameter and returns a pivotQuery in the response when pivot configuration is provided.

This change allows the backend to generate SQL for pivot tables without requiring a full warehouse connection during the compilation phase, making the process more efficient.

Copy link
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
github-actions bot commented Jan 27, 2026

Your preview environment pr-19743 has been deployed with errors.

Preview environment endpoints are available at:

@github-actions
Copy link
github-actions bot commented Jan 27, 2026

Preview Environment

🌐 URL: https://lightdash-preview-pr-19743.lightdash.okteto.dev

📋 Logs: View in GCP Console

🔧 SSH: ./scripts/okteto-ssh.sh 19743

Copy link
Contributor
@magnew magnew left a comment

Choose a reason for hiding this comment

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

This is a cool solution to this problem.

Left a question

continueOnError: true, // Return SQL even with compilation errors for debugging
});

await sshTunnel.disconnect();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we not need this anymore for some reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep yep, because now we don't use the full warehouse client, we're using the warehouseSqlBuilder instead which doesn't connect to the warehouse.

This was something I believe @owlas introduced a while ago so that we didn't keep opening connection to warehouses when not needed

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, I remember that. I guess this was jsut left over.

@almeidabbm almeidabbm force-pushed the 01-27-fix_take_metricsasrows_when_calculating_column_limit branch from 274896c to 8f73fe0 Compare January 28, 2026 10:02
@almeidabbm almeidabbm force-pushed the 01-27-feat_add_pivot_sql_to_compile_sql_endpoint branch from b89f63e to 03aa6da Compare January 28, 2026 10:02
@almeidabbm almeidabbm force-pushed the 01-27-fix_take_metricsasrows_when_calculating_column_limit branch from 8f73fe0 to 42f766f Compare January 28, 2026 16:03
@almeidabbm almeidabbm force-pushed the 01-27-feat_add_pivot_sql_to_compile_sql_endpoint branch from 03aa6da to 089d065 Compare January 28, 2026 16:03
@almeidabbm almeidabbm force-pushed the 01-27-feat_add_pivot_sql_to_compile_sql_endpoint branch from 089d065 to 4c971f7 Compare January 28, 2026 17:50
@almeidabbm almeidabbm force-pushed the 01-27-fix_take_metricsasrows_when_calculating_column_limit branch from 42f766f to 048a563 Compare January 28, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0