Skip to content

Commit

Permalink
fix: clickhouse table find queries (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
darshit-s3 committed May 7, 2024
1 parent 096ee2e commit 9766d40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 9766d40

Please sign in to comment.