Skip to content

Commit 719cc97

Browse files
committed
store: fix identation of example SQL
They were treated as doctests
1 parent b6e27a8 commit 719cc97

2 files changed

Lines changed: 46 additions & 46 deletions

File tree

store/postgres/src/relational/rollup.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -566,37 +566,37 @@ impl<'a> RollupSql<'a> {
566566
///
567567
/// The generated query has the following structure:
568568
///
569-
/// with bucket as (
570-
/// {select current bucket query}
571-
/// ), prev as (
572-
/// select
573-
/// bucket.id,
574-
/// bucket.vid,
575-
/// bucket.block$
576-
/// bucket.timestamp,
577-
/// {dimensions},
578-
/// {prev aggregates}
579-
/// from bucket cross join lateral (
580-
/// select * from {agg table} where timestamp < {last rollup timestamp}
581-
/// order by timestamp desc limit 1
582-
/// )
583-
/// ), combined (
584-
/// {select * from bucket and prev}
585-
/// group by
586-
/// id,
587-
/// vid,
588-
/// block$,
589-
/// timestamp,
590-
/// {dimensions}
591-
/// )
569+
/// with bucket as (
570+
/// {select current bucket query}
571+
/// ), prev as (
592572
/// select
593-
/// id,
594-
/// vid,
595-
/// block$,
596-
/// timestamp,
573+
/// bucket.id,
574+
/// bucket.vid,
575+
/// bucket.block$
576+
/// bucket.timestamp,
597577
/// {dimensions},
598-
/// {aggregates}
599-
/// from combined;
578+
/// {prev aggregates}
579+
/// from bucket cross join lateral (
580+
/// select * from {agg table} where timestamp < {last rollup timestamp}
581+
/// order by timestamp desc limit 1
582+
/// )
583+
/// ), combined (
584+
/// {select * from bucket and prev}
585+
/// group by
586+
/// id,
587+
/// vid,
588+
/// block$,
589+
/// timestamp,
590+
/// {dimensions}
591+
/// )
592+
/// select
593+
/// id,
594+
/// vid,
595+
/// block$,
596+
/// timestamp,
597+
/// {dimensions},
598+
/// {aggregates}
599+
/// from combined;
600600
fn select_current_bucket_cumulative(&self, w: &mut dyn fmt::Write) -> fmt::Result {
601601
write!(w, "with bucket as (")?;
602602
self.select_current_bucket(w)?;
@@ -650,17 +650,17 @@ impl<'a> RollupSql<'a> {
650650
///
651651
/// The generated query has the following structure:
652652
///
653-
/// select
654-
/// max(id) as id,
655-
/// max(vid) as vid,
656-
/// max(block$) as block$,
657-
/// max(timestamp) as timestamp,
658-
/// {dimensions},
659-
/// {aggregates}
660-
/// from
661-
/// ({select timeseries entities} where timestamp >= {last rollup timestamp} {--FILTERS;})
662-
/// group by
663-
/// {dimensions};
653+
/// select
654+
/// max(id) as id,
655+
/// max(vid) as vid,
656+
/// max(block$) as block$,
657+
/// max(timestamp) as timestamp,
658+
/// {dimensions},
659+
/// {aggregates}
660+
/// from
661+
/// ({select timeseries entities} where timestamp >= {last rollup timestamp} {--FILTERS;})
662+
/// group by
663+
/// {dimensions};
664664
fn select_current_bucket(&self, w: &mut dyn fmt::Write) -> fmt::Result {
665665
write!(
666666
w,

store/postgres/src/relational_queries.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4425,12 +4425,12 @@ impl<'a> FilterQuery<'a> {
44254425
/// For aggregation entity queries that require the current bucket,
44264426
/// the generated query has the following structure:
44274427
///
4428-
/// select '..' as entity, to_jsonb(e.*) as data
4429-
/// from (
4430-
/// (select {column names} from agg_table c where {filters} limit {limit + skip + 1})
4431-
/// union all
4432-
/// (select {column names} from ({current bucket query from agg source table} + {filters}) c)
4433-
/// ) c order by .. limit .. skip ..
4428+
/// select '..' as entity, to_jsonb(e.*) as data
4429+
/// from (
4430+
/// (select {column names} from agg_table c where {filters} limit {limit + skip + 1})
4431+
/// union all
4432+
/// (select {column names} from ({current bucket query from agg source table} + {filters}) c)
4433+
/// ) c order by .. limit .. skip ..
44344434
fn query_no_window_one_entity<'b>(
44354435
&'b self,
44364436
wh: &'b WholeTable<'a>,

0 commit comments

Comments
 (0)