Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(sql): speed up parallel sample by with fill #5143

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests, still todo - fix set operations
  • Loading branch information
nwoolmer committed Jan 7, 2025
commit b3c763a620a069eff535ad3724d92df1f1b1e178
20 changes: 10 additions & 10 deletions core/src/test/java/io/questdb/test/griffin/ExplainPlanTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6787,11 +6787,11 @@ public void testSampleByFillNull() throws Exception {
assertPlanNoLeakCheck(
"select first(i) from a sample by 1h fill(null) align to calendar",
"SelectedRecord\n" +
" Sort\n" +
" keys: [ts]\n" +
" Fill Range\n" +
" stride: '1h'\n" +
" values: [null]\n" +
" Fill Range\n" +
" stride: '1h'\n" +
" values: [null]\n" +
" Radix sort light\n" +
" keys: [ts]\n" +
" Async Group By workers: 1\n" +
" keys: [ts]\n" +
" values: [first(i)]\n" +
Expand Down Expand Up @@ -6915,11 +6915,11 @@ public void testSampleByFillValueNotKeyed() throws Exception {
assertPlanNoLeakCheck(
"select first(i) from a sample by 1h fill(1) align to calendar",
"SelectedRecord\n" +
" Sort\n" +
" keys: [ts]\n" +
" Fill Range\n" +
" stride: '1h'\n" +
" values: [1]\n" +
" Fill Range\n" +
" stride: '1h'\n" +
" values: [1]\n" +
" Radix sort light\n" +
" keys: [ts]\n" +
" Async Group By workers: 1\n" +
" keys: [ts]\n" +
" values: [first(i)]\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public void testOrderByTimestampColumnDescMixedValues() throws Exception {
" end as timestamp) as a" +
" from long_sequence(25)" +
")",
null,
"a###DESC",
true,
true
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void testAlignToCalendarTimeZoneWithSomethingUnexpected() throws Exceptio
@Test
public void testAlignToCalendarWithTimeZoneAndLimit() throws SqlException {
assertQuery(
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp) stride 1h) order by timestamp limit 1)",
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp)) stride 1h order by timestamp limit 1)",
"select a, sum(a) from x sample by 1h align to calendar time zone 'UTC' limit 1;",
model()
);
Expand All @@ -173,7 +173,7 @@ public void testAlignToCalendarWithTimeZoneAndLimit() throws SqlException {
@Test
public void testAlignToCalendarWithTimeZoneAndOrderBy() throws SqlException {
assertQuery(
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp) stride 1h) order by a desc)",
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp)) stride 1h order by a desc)",
"select a, sum(a) from x sample by 1h align to calendar time zone 'UTC' order by a desc;",
model()
);
Expand All @@ -182,7 +182,7 @@ public void testAlignToCalendarWithTimeZoneAndOrderBy() throws SqlException {
@Test
public void testAlignToCalendarWithTimeZoneEndingWithSemicolon() throws SqlException {
assertQuery(
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp) stride 1h) order by timestamp)",
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp)) stride 1h order by timestamp)",
"select a, sum(a) from x sample by 1h align to calendar time zone 'UTC';",
model()
);
Expand All @@ -191,7 +191,7 @@ public void testAlignToCalendarWithTimeZoneEndingWithSemicolon() throws SqlExcep
@Test
public void testAlignToCalendarWithoutTimezoneNorOffsetAndLimit() throws SqlException {
assertQuery(
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp) stride 1h) order by timestamp limit 1)",
"select-choose a, sum from (select-group-by [a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp] a, sum(a) sum, timestamp_floor('1h',timestamp) timestamp from (select [a, timestamp] from x timestamp (timestamp)) stride 1h order by timestamp limit 1)",
"select a, sum(a) from x sample by 1h align to calendar limit 1;",
model()
);
Expand All @@ -210,7 +210,7 @@ public void testAlignToSomethingInvalid() throws Exception {
@Test
public void testCalendar() throws SqlException {
assertQuery(
"select-choose b, sum, k1, k from (select-group-by [b, sum(a) sum, k k1, k, timestamp_floor('3h',timestamp) timestamp] b, sum(a) sum, k k1, k, timestamp_floor('3h',timestamp) timestamp from (select [b, a, k, timestamp] from x y timestamp (timestamp) stride 3h) y order by timestamp)",
"select-choose b, sum, k1, k from (select-group-by [b, sum(a) sum, k k1, k, timestamp_floor('3h',timestamp) timestamp] b, sum(a) sum, k k1, k, timestamp_floor('3h',timestamp) timestamp from (select [b, a, k, timestamp] from x y timestamp (timestamp)) y stride 3h order by timestamp)",
"select b, sum(a), k k1, k from x y sample by 3h align to calendar",
model()
);
Expand Down
Loading
Loading