Skip to content

recipes: Using timezones #3927

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

recipes: Using timezones #3927

wants to merge 4 commits into from

Conversation

igorlukanin
Copy link
Member

@igorlukanin igorlukanin commented Jan 13, 2022

@igorlukanin igorlukanin self-assigned this Jan 13, 2022
@igorlukanin igorlukanin requested a review from a team as a code owner January 13, 2022 11:14
@rpaik
Copy link
Contributor

rpaik commented Jan 14, 2022

A minor nit 😄

Thank you, Ray! 🙏

Co-authored-by: Ray Paik <ray@cube.dev>
Copy link
Contributor

@ivan-vdovin ivan-vdovin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2022-01-17 at 20 39 37

@ivan-vdovin
Copy link
Contributor

ivan-vdovin commented Jan 25, 2022

@igorlukanin Can't make it work with demo-db-recipes.cube.dev DB. Could you take a look please?

➜ timezones git:(recipes/timezones) ✗ docker-compose up
Recreating timezones_cube_1 ... done
Recreating timezones_query_1 ... done
Attaching to timezones_cube_1, timezones_query_1
cube_1 | 🔥 Cube Store (0.29.14) is assigned to 3030 port.
cube_1 | 🔓 Authentication checks are disabled in developer mode. Please use NODE_ENV=production to enable it.
cube_1 | 🦅 Dev environment available at http://localhost:4000
cube_1 | 🚀 Cube.js server (0.29.14) is listening on 4000
cube_1 | 2022-01-25 11:38:00,988 INFO [cubestored] pid:19 Cube Store version 0.29.12
cube_1 | 2022-01-25 11:38:00,995 INFO [cubestore::http::status] pid:19 Serving status probes at 0.0.0.0:3031
cube_1 | 2022-01-25 11:38:01,002 INFO [cubestore::metastore] pid:19 Using existing metastore in /cube/conf/.cubestore/data/metastore
cube_1 | 2022-01-25 11:38:02,033 INFO [cubestore::http] pid:19 Http Server is listening on 0.0.0.0:3030
cube_1 | 2022-01-25 11:38:02,033 INFO [cubestore::mysql] pid:19 MySQL port open on 0.0.0.0:13306
cube_1 | Performing query: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1
cube_1 | Performing query completed: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1 (617ms)
cube_1 | Performing query: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1
cube_1 | Executing SQL: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1
cube_1 | --
cube_1 | SELECT FLOOR((UNIX_TIMESTAMP()) / 3600) as refresh_key
cube_1 | --
cube_1 | Performing query completed: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1 (11ms)
cube_1 | Error querying db: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1
cube_1 | --
cube_1 | "SELECT "orders__status" "orders__status", "orders__created_at" "orders__created_at", "orders__created_at_converted" "orders__created_at_converted", "orders__created_at_day" "orders__created_at_day" FROM dev_pre_aggregations.orders_main AS "orders__main" GROUP BY 1, 2, 3, 4 ORDER BY 2 DESC LIMIT 3"
cube_1 | --
cube_1 | {
cube_1 | "params": []
cube_1 | }
cube_1 | error: permission denied for database recipes
cube_1 | at Parser.parseErrorMessage (/cube/node_modules/pg-protocol/src/parser.ts:369:69)
cube_1 | at Parser.handlePacket (/cube/node_modules/pg-protocol/src/parser.ts:188:21)
cube_1 | at Parser.parse (/cube/node_modules/pg-protocol/src/parser.ts:103:30)
cube_1 | at Socket. (/cube/node_modules/pg-protocol/src/index.ts:7:48)
cube_1 | at Socket.emit (events.js:400:28)
cube_1 | at addChunk (internal/streams/readable.js:293:12)
cube_1 | at readableAddChunk (internal/streams/readable.js:267:9)
cube_1 | at Socket.Readable.push (internal/streams/readable.js:206:10)
cube_1 | at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
cube_1 | Orchestrator error: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1 (2249ms)
cube_1 | --
cube_1 | {
cube_1 | "dimensions": [
cube_1 | "Orders.status",
cube_1 | "Orders.createdAt",
cube_1 | "Orders.createdAtConverted"
cube_1 | ],
cube_1 | "timeDimensions": [
cube_1 | {
cube_1 | "dimension": "Orders.createdAt",
cube_1 | "granularity": "day"
cube_1 | }
cube_1 | ],
cube_1 | "order": {
cube_1 | "Orders.createdAt": "desc"
cube_1 | },
cube_1 | "limit": 3,
cube_1 | "timezone": "America/New_York"
cube_1 | }
cube_1 | --
cube_1 | {
cube_1 | "securityContext": {
cube_1 | "iat": 1000000000,
cube_1 | "exp": 5000000000
cube_1 | }
cube_1 | }
cube_1 | error: permission denied for database recipes
query_1 | Orders (excerpt):
query_1 | null
query_1 | Used pre-ggregations:
query_1 | null
timezones_query_1 exited with code 0
Executing SQL: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1
cube_1 | --
cube_1 | SELECT FLOOR((UNIX_TIMESTAMP()) / 3600) as refresh_key
cube_1 | --
cube_1 | Performing query completed: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1 (11ms)
cube_1 | Error querying db: 03c1831c-ad0d-461d-862b-9f6d2f456258-span-1
cube_1 | --
cube_1 | "SELECT "orders__status" "orders__status", "orders__created_at" "orders__created_at", "orders__created_at_converted" "orders__created_at_converted", "orders__created_at_day" "orders__created_at_day" FROM dev_pre_aggregations.orders_main AS "orders__main" GROUP BY 1, 2, 3, 4 ORDER BY 2 DESC LIMIT 3"
cube_1 | --
cube_1 | {
cube_1 | "params": []
cube_1 | }
cube_1 | error: permission denied for database recipes
cube_1 | at Parser.parseErrorMessage (/cube/node_modules/pg-protocol/src/parser.ts:369:69)
cube_1 | at Parser.handlePacket (/cube/node_modules/pg-protocol/src/parser.ts:188:21)
cube_1 | at Parser.parse (/cube/node_moducube_1 | Performing query: scheduler-690dc694-1ff1-4482-8677-96f2ce5641b7

@igorlukanin
Copy link
Member Author

Will be replaced by #8668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants