Skip to content

Conversation

@jsaltermedialab
Copy link

No description provided.

@jsaltermedialab jsaltermedialab requested a review from a team as a code owner November 13, 2024 09:36
// console.log(JSON.stringify(dataCube));
// console.log(decorator)
const queryTimeStart = Date.now();
const result = await executeQuery(dataCube, query, essence.timezone, decorator);
Copy link
Author

Choose a reason for hiding this comment

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

i think we can just stub this portion out with whatever BQ jobs we need to get the data, or implement a real data cube API if we wanted

@@ -0,0 +1,286 @@
import { parse } from "path";
Copy link
Author

Choose a reason for hiding this comment

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

this file is mostly AI generated version that yield super broken SQL but demonstrates something hat may look kind of close to the end goal

@jsaltermedialab
Copy link
Author

jsaltermedialab commented Nov 13, 2024

i think the most complex problem to solve is turning
{"op":"apply","operand":{"op":"apply","operand":{"op":"apply","operand":{"op":"apply","operand":{"op":"literal","value":{"attributes":[],"data":[{}]},"type":"DATASET"},"expression":{"op":"filter","operand":{"op":"ref","name":"main"},"expression":{"op":"overlap","operand":{"op":"ref","name":"__time"},"expression":{"op":"literal","value":{"setType":"TIME_RANGE","elements":[{"start":"2019-02-01T00:01:00.000Z","end":"2019-03-01T00:01:00.000Z"}]},"type":"SET"}}},"name":"main"},"expression":{"op":"literal","value":2592000000},"name":"MillisecondsInInterval"},"expression":{"op":"count","operand":{"op":"ref","name":"main"}},"name":"count"},"expression":{"op":"limit","operand":{"op":"sort","operand":{"op":"apply","operand":{"op":"split","operand":{"op":"ref","name":"main"},"name":"terminal","expression":{"op":"ref","name":"terminal"},"dataName":"main"},"expression":{"op":"count","operand":{"op":"ref","name":"main"}},"name":"count"},"expression":{"op":"ref","name":"count"},"direction":"descending"},"value":100},"name":"SPLIT"}

into SQL to run on BQ, and then turning the BQ response into something that looks like

{"attributes":[{"name":"main","type":"DATASET"},{"name":"MillisecondsInInterval","type":"NUMBER"},{"name":"count","type":"NUMBER"},{"name":"SPLIT","type":"DATASET"}],"data":[{"MillisecondsInInterval":2592000000,"count":20,"SPLIT":{"keys":["terminal"],"attributes":[{"name":"terminal","type":"STRING"},{"name":"main","type":"DATASET"},{"name":"count","type":"NUMBER"}],"data":[{"terminal":"Misc. Terminal","count":2},{"terminal":"Terminal 1","count":2},{"terminal":"Terminal 2","count":2},{"terminal":"Terminal 3","count":2},{"terminal":"Terminal 4","count":2},{"terminal":"Terminal 5","count":2},{"terminal":"Terminal 6","count":2},{"terminal":"Terminal 7","count":2},{"terminal":"Terminal 8","count":2},{"terminal":"Tom Bradley International Terminal","count":2}]}}]}

@jsaltermedialab
Copy link
Author

Screenshot 2024-11-13 at 1 40 56 AM

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.

1 participant