Repository navigation
Conversation
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR build on #3246 by adding support for deriving
client.table(view)in the<perspective-viewer>UI,ViewerConfigandWorkspaceConfig.Derived tables in
perspective-viewerrestoreWorkspace()/saveWorkspace()have a new a top-levelderived_tablesmap. Each entry is thetableits sourceViewreads plus that view's config. Entries may chain through other derived tables and are built parent-first. The key follows thepanelsupdate rule: absent keeps, a value replaces,{}deletes all.save()/restore(): thetablefield is now aTableRef, either a hosted table name or an inline derived-table definition recursing through its owntablefield.restore()reuses a structurally identical derived table or creates one under a generated name.view_derivationsfeature. The "New" menu lists derived tables with reader counts and a delete action.row_numberwindow aggregateperspective-serverwindow aggregaterow_number: 1-based, dense position of the row in its partition'sorder_byorder (already supported in DuckDB and Postgres Virtual Servers).GetFeaturesfor every source type, so the window editor offers it after any column. ClickHouse virtual servers (TS and Python) now declare it too.Internal
PSP_FAST=1: release build at-O1, no LTO, nowasm-opt. Cargo[profile.fast]andbundle --fast.pnpm run setupreplaces the debug/fast confirms with one three-way "Build mode?" prompt so the two cannot coexist. I may try this with CI next.Fixes
expressionscolumns in derived tables are calculated on the aggregates (note thegroup_rollup_mode)filter(or in this case another expression column with abooleanresult for demo)row_number()window column aggregate.Example
Expression column on aggregates
{ "plugin": "Datagrid", "table": { "table": "superstore", "group_by": ["State"], "group_rollup_mode": "flat", "columns": ["Sales", "Profit"], "aggregates": { "Profit": ["weighted mean", ["Row ID"]], "Sales": ["weighted mean", ["Postal Code"]] } }, "title": "Superstore", "group_by": ["State"], "expressions": { "\"Sales\" - \"Profit\"": "\"Sales\" - \"Profit\"" }, "columns": ["Sales", "Profit", "\"Sales\" - \"Profit\""] }Top 3 most recent orders
{ "plugin": "Datagrid", "table": "superstore", "sort": [["Order Date", "desc"]], "filter": [["New Column 1", "<=", 3]], "windows": { "New Column 1": { "column": "Row ID", "aggregate": "row_number", "order_by": ["Order Date", "desc"] } }, "columns": ["Sales", "Customer Name", "Order Date"] }