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

fix: clickhouse table find queries #82

Merged
merged 1 commit into from
May 7, 2024
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
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ services:
- .env
ports:
- "3000:3000"
command: npm run dev
# Uncmment this for development
# Uncomment this for development
# command: npm run dev
# volumes:
# - .:/app
restart: on-failure:5
Expand Down
10 changes: 5 additions & 5 deletions lib/services/query_builder_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class QueryBuilderService implements IQueryBuilderService {
filterOperation: string = "OR"
): string {
// Base query parts
let baseQuery = `COUNT(DISTINCT span_id) AS total_spans FROM '${tableName}'`;
let baseQuery = `COUNT(DISTINCT span_id) AS total_spans FROM ${tableName}`;
let whereConditions: string[] = [];

// Iterate over filters to construct WHERE conditions
Expand Down Expand Up @@ -89,7 +89,7 @@ export class QueryBuilderService implements IQueryBuilderService {
filterOperation: string = "OR"
): string {
// Base query parts
let baseQuery = `COUNT(DISTINCT trace_id) AS total_traces FROM '${tableName}'`;
let baseQuery = `COUNT(DISTINCT trace_id) AS total_traces FROM ${tableName}`;
let whereConditions: string[] = [];

// Iterate over filters to construct WHERE conditions
Expand Down Expand Up @@ -174,7 +174,7 @@ export class QueryBuilderService implements IQueryBuilderService {
filterOperation: string = "OR"
): string {
// Base query parts
let baseQuery = `trace_id, MIN(start_time) AS earliest_start_time FROM '${tableName}'`;
let baseQuery = `trace_id, MIN(start_time) AS earliest_start_time FROM ${tableName}`;
let whereConditions: string[] = [];

// Iterate over filters to construct WHERE conditions
Expand Down Expand Up @@ -216,7 +216,7 @@ export class QueryBuilderService implements IQueryBuilderService {
filterOperation: string = "OR"
): string {
// Base query parts
let baseQuery = `* FROM '${tableName}' WHERE span_id = '${spanId}'`;
let baseQuery = `* FROM ${tableName} WHERE span_id = '${spanId}'`;
let whereConditions: string[] = [];

// Iterate over filters to construct WHERE conditions
Expand Down Expand Up @@ -256,7 +256,7 @@ export class QueryBuilderService implements IQueryBuilderService {
filterOperation: string = "OR"
): string {
// Base query parts
let baseQuery = `* FROM '${tableName}' WHERE trace_id = '${traceId}'`;
let baseQuery = `* FROM ${tableName} WHERE trace_id = '${traceId}'`;
let whereConditions: string[] = [];

// Iterate over filters to construct WHERE conditions
Expand Down