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

feat(cubesql): Ungrouped queries support #7056

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions packages/cubejs-api-gateway/openspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ components:
type: "array"
items:
$ref: "#/components/schemas/V1LoadRequestQueryFilterItem"
ungrouped:
type: "boolean"
V1LoadRequest:
type: "object"
properties:
Expand Down
15 changes: 5 additions & 10 deletions packages/cubejs-backend-native/test/sql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import metaFixture from './meta';
import { FakeRowStream } from './response-fake';

const logger = jest.fn(({ event }) => {

Check warning on line 7 in packages/cubejs-backend-native/test/sql.test.ts

View workflow job for this annotation

GitHub Actions / lint

'logger' is assigned a value but never used. Allowed unused vars must match /^_.*/u
if (!event.error.includes('load - strange response, success which contains error')) {
expect(event.apiType).toEqual('sql');
expect(event.protocol).toEqual('mysql');
Expand All @@ -12,13 +12,13 @@
console.log(event);
});

native.setupLogger(
logger,
'trace',
);
// native.setupLogger(
// logger,
// 'trace',
// );

describe('SQLInterface', () => {
jest.setTimeout(10 * 1000);
jest.setTimeout(60 * 1000);

it('SHOW FULL TABLES FROM `db`', async () => {
const load = jest.fn(async ({ request, session, query }) => {
Expand Down Expand Up @@ -266,11 +266,6 @@
expect(result).toEqual([{ 'TimestampNanosecond(1608936528000000000, None)': '2020-12-25T22:48:48.000' }]);
}

// Increment it in case you throw Error
setTimeout(_ => {
expect(logger.mock.calls.length).toEqual(1);
}, 2000);

connection.destroy();
} finally {
await native.shutdownInterface(instance);
Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubeclient/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.1
6.6.0
3 changes: 3 additions & 0 deletions rust/cubesql/cubeclient/src/models/v1_load_request_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub struct V1LoadRequestQuery {
pub offset: Option<i32>,
#[serde(rename = "filters", skip_serializing_if = "Option::is_none")]
pub filters: Option<Vec<crate::models::V1LoadRequestQueryFilterItem>>,
#[serde(rename = "ungrouped", skip_serializing_if = "Option::is_none")]
pub ungrouped: Option<bool>,
}

impl V1LoadRequestQuery {
Expand All @@ -39,6 +41,7 @@ impl V1LoadRequestQuery {
limit: None,
offset: None,
filters: None,
ungrouped: None,
}
}
}
1 change: 1 addition & 0 deletions rust/cubesql/cubesql/src/compile/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ impl QueryBuilder {
} else {
None
},
ungrouped: None,
},
meta: self.meta,
}
Expand Down
1 change: 1 addition & 0 deletions rust/cubesql/cubesql/src/compile/engine/df/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,7 @@ mod tests {
limit: None,
offset: None,
filters: None,
ungrouped: None,
},
wrapped_sql: None,
auth_context: Arc::new(HttpAuthContext {
Expand Down
Loading
Loading