Skip to content

Commit bf12b00

Browse files
authored
Fix multi-statement measure view batches (#39)
* Fix multi-statement measure view batches * Handle dollar-quoted batch statements * Expand aggregate batch statements independently * Guard measure rewrites to create views * Clean dropped measure views in batches * Rewrite measure batches in statement order * Support temporary measure view batches * Skip dollar literals in aggregate extraction * Clean temporary measure registrations * Reject standalone temporary measure views * Support DuckDB main base table names * Snapshot measure catalog during batch rewrites * Wrap batch select aggregate rewrites * Handle batch semantic rewrites and drop rollback * Track temporary measure use in batches * Restore shadowed measures after temp drops * Guard temporary measure batch edges * Restore snapshots for skipped measure rewrites * Keep temporary measure guards through batches * Handle batch drop modifiers and semantic views * Defer false measure drop cleanup * Relax next parser error expectations * Handle temp CTE reads and restore casing * Use parser failures in rollback tests * Handle temporary view edge cases * Restore views after rollback test failures * Clean replaced temporary snapshots * Remove duplicate base table helper * Handle qualified drops with temp measure views * Handle qualified reads of shadowed measure views * Skip dollar literals in AT shorthand rewrite * Handle deferred temp measure replacement drops * Make temp replacement regression parser-compatible * Avoid lexical temp read false positives * Relax parser-mode regression expectations * Skip EXTRACT from lexical table reads * Detect temp measure reads in derived subqueries
1 parent 6b7c34d commit bf12b00

7 files changed

Lines changed: 2464 additions & 98 deletions

File tree

include/yardstick_ffi.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ bool yardstick_has_curly_brace(const char* sql);
327327
bool yardstick_has_at_syntax(const char* sql);
328328

329329
char* yardstick_expand_curly_braces(const char* sql);
330+
char* yardstick_extract_view_name(const char* sql);
331+
char* yardstick_extract_drop_view_name(const char* sql);
332+
void* yardstick_snapshot_measure_view(const char* view_name);
333+
void* yardstick_empty_measure_view_snapshot(void);
334+
void yardstick_restore_measure_view_snapshot(const char* view_name, void* snapshot);
335+
void yardstick_free_measure_view_snapshot(void* snapshot);
330336
struct YardstickCreateViewResult yardstick_process_create_view(const char* sql);
331337
struct YardstickAggregateResult yardstick_expand_aggregate(const char* sql);
332338
struct YardstickMeasureAggResult yardstick_get_measure_aggregation(const char* column_name);

0 commit comments

Comments
 (0)