Skip to content

Commit f0866ab

Browse files
committed
Merge branch 'bugfix/invalid-timestamp-floor-year-unit' of github.com:peterklingelhofer/cube into peterklingelhofer-bugfix/invalid-timestamp-floor-year-unit
2 parents bb6d655 + 2a84f9a commit f0866ab

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

packages/cubejs-api-gateway/test/graphql-queries/base-snake-case.gql

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ query CubeQuery {
7373
}
7474

7575
query CubeQuery {
76-
cube(where: { orders: { created_at: { inDateRange: "2 weeks ago to now" } } }) {
76+
cube(
77+
where: { orders: { created_at: { inDateRange: "2 weeks ago to now" } } }
78+
) {
7779
orders {
7880
count
7981
created_at {
@@ -130,3 +132,14 @@ query CubeQuery {
130132
}
131133
}
132134
}
135+
136+
query CubeQuery {
137+
cube(where: { orders: { created_at: { inDateRange: "This year" } } }) {
138+
orders(orderBy: { created_at: asc }) {
139+
count
140+
created_at {
141+
year
142+
}
143+
}
144+
}
145+
}

packages/cubejs-api-gateway/test/graphql-queries/base.gql

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ query CubeQuery {
7373
}
7474

7575
query CubeQuery {
76-
cube(where: { orders: { createdAt: { inDateRange: "2 weeks ago to now" } } }) {
76+
cube(
77+
where: { orders: { createdAt: { inDateRange: "2 weeks ago to now" } } }
78+
) {
7779
orders {
7880
count
7981
createdAt {
@@ -130,3 +132,14 @@ query CubeQuery {
130132
}
131133
}
132134
}
135+
136+
query CubeQuery {
137+
cube(where: { orders: { createdAt: { inDateRange: "This year" } } }) {
138+
orders(orderBy: { createdAt: asc }) {
139+
count
140+
createdAt {
141+
year
142+
}
143+
}
144+
}
145+
}

packages/cubejs-questdb-driver/src/QuestQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const GRANULARITY_TO_INTERVAL: Record<string, string> = {
66
hour: 'h',
77
day: 'd',
88
month: 'M',
9-
year: 'Y'
9+
year: 'y'
1010
};
1111

1212
class QuestParamAllocator extends ParamAllocator {

0 commit comments

Comments
 (0)