Skip to content

Commit ea856bb

Browse files
authored
Merge pull request #5854 from influxdata/sql-window-functions
SQL window functions
2 parents 13bec42 + 86c4c35 commit ea856bb

File tree

11 files changed

+1739
-0
lines changed

11 files changed

+1739
-0
lines changed

assets/styles/layouts/_article.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
&.blue {color: $b-dodger;}
245245
&.green {color: $gr-viridian;}
246246
&.magenta {color: $p-comet;}
247+
&.pink {color: $br-new-magenta;}
247248
}
248249

249250
h2,

assets/styles/layouts/article/_html-diagrams.scss

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,244 @@ table tr.point{
904904
}
905905
}
906906

907+
//////////////////////// SQL WINDOW FRAME UNITS EXAMPLES ///////////////////////
908+
909+
table.window-frame-units {
910+
&.groups {
911+
.group {
912+
position: relative;
913+
outline-style: solid;
914+
outline-width: 3px;
915+
outline-offset: -5px;
916+
border-radius: 10px;
917+
918+
&::before {
919+
content: "Row Group";
920+
display: block;
921+
padding: .25rem .5rem;
922+
position: absolute;
923+
top: 3px;
924+
left: 3px;
925+
border-radius: 4px;
926+
color: #fff;
927+
font-size: .8rem;
928+
font-weight: bold;
929+
text-transform: uppercase;
930+
letter-spacing: .02em;
931+
box-shadow: 4px 4px 4px $article-bg;
932+
}
933+
934+
td:nth-child(2), td:nth-child(3) {
935+
font-weight: bold;
936+
text-decoration: underline;
937+
text-decoration-thickness: 2px;
938+
text-underline-offset: 5px;
939+
}
940+
941+
&:nth-of-type(1) {
942+
&::before {background: $br-new-magenta;}
943+
outline-color: $br-new-magenta;
944+
td:nth-child(2), td:nth-child(3) {
945+
text-decoration-color: $br-new-magenta;
946+
}
947+
}
948+
&:nth-of-type(2) {
949+
&::before {background: $br-new-purple;}
950+
outline-color: $br-new-purple;
951+
td:nth-child(2), td:nth-child(3) {
952+
text-decoration-color: $br-new-purple;
953+
}
954+
}
955+
&:nth-of-type(3) {
956+
&::before {background: $b-dodger;}
957+
outline-color: $b-dodger;
958+
td:nth-child(2), td:nth-child(3) {
959+
text-decoration-color: $b-dodger;
960+
}
961+
}
962+
&:nth-of-type(4) {
963+
&::before {background: $b-sapphire;}
964+
outline-color: $b-sapphire;
965+
td:nth-child(2), td:nth-child(3) {
966+
text-decoration-color: $b-sapphire;
967+
}
968+
}
969+
}
970+
}
971+
972+
&.groups-with-frame {
973+
.frame, tr.current-row {
974+
position: relative;
975+
outline-style: solid;
976+
outline-width: 3px;
977+
outline-offset: -5px;
978+
border-radius: 10px;
979+
980+
&::after {
981+
display: block;
982+
padding: .25rem .5rem;
983+
position: absolute;
984+
top: 3px;
985+
left: 3px;
986+
border-radius: 4px;
987+
color: #fff;
988+
font-size: .8rem;
989+
font-weight: bold;
990+
text-transform: uppercase;
991+
letter-spacing: .02em;
992+
box-shadow: 4px 4px 4px $article-bg;
993+
}
994+
995+
tr:nth-child(n + 1):nth-child(-n + 3) {
996+
td {text-decoration-color: $br-new-magenta;}
997+
}
998+
tr:nth-child(n + 4):nth-child(-n + 6) {
999+
td {text-decoration-color: $br-magenta;}
1000+
}
1001+
tr:nth-child(n + 7):nth-child(-n + 8) {
1002+
td {text-decoration-color: $b-dodger;}
1003+
}
1004+
1005+
td:nth-child(n + 2):nth-child(-n + 3) {
1006+
font-weight: bold;
1007+
text-decoration: underline;
1008+
text-decoration-thickness: 2px;
1009+
text-underline-offset: 5px;
1010+
}
1011+
}
1012+
tr.current-row {
1013+
outline-color: $br-new-magenta;
1014+
&::after {
1015+
content: "Current Row";
1016+
background: $br-new-magenta;
1017+
}
1018+
td {text-decoration-color: $b-dodger !important;}
1019+
}
1020+
1021+
.frame {
1022+
outline-color: $br-new-purple;
1023+
&::after {
1024+
content: "Frame";
1025+
background: $br-new-purple;
1026+
}
1027+
}
1028+
.group {
1029+
position: relative;
1030+
outline-color: $b-sapphire;
1031+
td:nth-child(2), td:nth-child(3) {
1032+
font-weight: bold;
1033+
text-decoration: underline;
1034+
text-decoration-thickness: 2px;
1035+
text-underline-offset: 5px;
1036+
text-decoration-color: $b-sapphire;
1037+
}
1038+
}
1039+
}
1040+
1041+
&.range-interval {
1042+
.frame, tr.current-row {
1043+
position: relative;
1044+
outline-style: solid;
1045+
outline-width: 3px;
1046+
outline-offset: -5px;
1047+
border-radius: 10px;
1048+
1049+
td:first-child {
1050+
font-weight: bold;
1051+
text-decoration: underline;
1052+
text-decoration-thickness: 2px;
1053+
text-underline-offset: 5px;
1054+
text-decoration-color: $br-new-purple;
1055+
}
1056+
&::after {
1057+
display: block;
1058+
padding: .25rem .5rem;
1059+
position: absolute;
1060+
top: 3px;
1061+
right: 3px;
1062+
border-radius: 4px;
1063+
color: #fff;
1064+
font-size: .8rem;
1065+
font-weight: bold;
1066+
text-transform: uppercase;
1067+
letter-spacing: .02em;
1068+
box-shadow: -4px 4px 4px $article-bg;
1069+
}
1070+
}
1071+
tr.current-row {
1072+
outline-color: $br-new-magenta;
1073+
td:first-child {text-decoration-color: $br-new-magenta;}
1074+
&::after {
1075+
content: "Current Row";
1076+
background: $br-new-magenta;
1077+
box-shadow: -4px 4px 4px $article-table-row-alt;
1078+
}
1079+
}
1080+
1081+
.frame {
1082+
outline-color: $br-new-purple;
1083+
&::after {
1084+
content: "Frame";
1085+
background: $br-new-purple;
1086+
}
1087+
}
1088+
}
1089+
1090+
&.range-numeric, &.rows {
1091+
.frame, tr.current-row {
1092+
position: relative;
1093+
outline-style: solid;
1094+
outline-width: 3px;
1095+
outline-offset: -5px;
1096+
border-radius: 10px;
1097+
1098+
&::after {
1099+
display: block;
1100+
padding: .25rem .5rem;
1101+
position: absolute;
1102+
top: 3px;
1103+
left: 3px;
1104+
border-radius: 4px;
1105+
color: #fff;
1106+
font-size: .8rem;
1107+
font-weight: bold;
1108+
text-transform: uppercase;
1109+
letter-spacing: .02em;
1110+
box-shadow: 4px 4px 4px $article-bg;
1111+
}
1112+
}
1113+
tr.current-row {
1114+
outline-color: $br-new-magenta;
1115+
&::after {
1116+
content: "Current Row";
1117+
background: $br-new-magenta;
1118+
}
1119+
}
1120+
1121+
.frame {
1122+
outline-color: $br-new-purple;
1123+
&::after {
1124+
content: "Frame";
1125+
background: $br-new-purple;
1126+
}
1127+
}
1128+
}
1129+
&.range-numeric {
1130+
.frame {
1131+
td:nth-child(3) {
1132+
font-weight: bold;
1133+
text-decoration: underline;
1134+
text-decoration-thickness: 2px;
1135+
text-underline-offset: 5px;
1136+
text-decoration-color: $br-new-purple;
1137+
}
1138+
tr.current-row {
1139+
td:nth-child(3) {text-decoration-color: $br-new-magenta;}
1140+
}
1141+
}
1142+
}
1143+
}
1144+
9071145
////////////////////////////////////////////////////////////////////////////////
9081146
///////////////////////////////// MEDIA QUERIES ////////////////////////////////
9091147
////////////////////////////////////////////////////////////////////////////////
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: SQL window functions
3+
list_title: Window functions
4+
description: >
5+
SQL window functions perform an operation across a set of rows related to the
6+
current row.
7+
menu:
8+
influxdb3_cloud_dedicated:
9+
name: Window
10+
parent: sql-functions
11+
weight: 309
12+
13+
source: /shared/sql-reference/functions/window.md
14+
---
15+
16+
<!--
17+
The content for this page is at content/shared/sql-reference/functions/window.md
18+
-->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: SQL window functions
3+
list_title: Window functions
4+
description: >
5+
SQL window functions perform an operation across a set of rows related to the
6+
current row.
7+
menu:
8+
influxdb3_cloud_serverless:
9+
name: Window
10+
parent: sql-functions
11+
weight: 309
12+
13+
source: /shared/sql-reference/functions/window.md
14+
---
15+
16+
<!--
17+
The content for this page is at content/shared/sql-reference/functions/window.md
18+
-->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: SQL window functions
3+
list_title: Window functions
4+
description: >
5+
SQL window functions perform an operation across a set of rows related to the
6+
current row.
7+
menu:
8+
influxdb3_clustered:
9+
name: Window
10+
parent: sql-functions
11+
weight: 309
12+
13+
source: /shared/sql-reference/functions/window.md
14+
---
15+
16+
<!--
17+
The content for this page is at content/shared/sql-reference/functions/window.md
18+
-->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: SQL window functions
3+
list_title: Window functions
4+
description: >
5+
SQL window functions perform an operation across a set of rows related to the
6+
current row.
7+
menu:
8+
influxdb3_core:
9+
name: Window
10+
parent: sql-functions
11+
weight: 309
12+
13+
source: /shared/sql-reference/functions/window.md
14+
---
15+
16+
<!--
17+
The content for this page is at content/shared/sql-reference/functions/window.md
18+
-->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: SQL window functions
3+
list_title: Window functions
4+
description: >
5+
SQL window functions perform an operation across a set of rows related to the
6+
current row.
7+
menu:
8+
influxdb3_enterprise:
9+
name: Window
10+
parent: sql-functions
11+
weight: 309
12+
13+
source: /shared/sql-reference/functions/window.md
14+
---
15+
16+
<!--
17+
The content for this page is at content/shared/sql-reference/functions/window.md
18+
-->

0 commit comments

Comments
 (0)