Skip to content

Commit e033a36

Browse files
committed
fix: Add missing distinct field to all Projection initializations
- Added distinct: false to all Projection struct creations across codebase - Fixes compilation errors from RETURN DISTINCT feature implementation - Files updated: analyzer (7 files), logical_plan (3 files), optimizer (2 files), render_plan - Build now succeeds: cargo build --release completes successfully
1 parent 980d0f4 commit e033a36

24 files changed

+1141
-156
lines changed

.dockerignore

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,66 @@
11
# Rust/Cargo build artifacts
22
target/
33
**/target/
4+
Cargo.lock
45

56
# Cargo-Chef recipe (caching layers)
67
recipe.json
78

89
# Docker build files
910
Dockerfile
11+
Dockerfile.test
1012
.dockerignore
13+
docker-compose*.yaml
1114

1215
# Git metadata
1316
.git
1417
.gitignore
18+
.gitattributes
1519

1620
# CI/CD configs
1721
.github/
1822

1923
# Environment files (secrets, creds)
2024
.env
25+
.env.*
2126

2227
# IDE/editor settings
2328
.vscode/
2429
.idea/
2530
*.swp
31+
*.swo
32+
*~
2633

2734
# OS files
2835
.DS_Store
36+
Thumbs.db
2937

30-
# Local ClickHouse data
38+
# Development/test data
3139
clickhouse_data/
32-
3340
test_data/
41+
neo4j_data/
42+
neo4j_logs/
43+
44+
# Documentation (not needed in runtime image)
45+
docs/
46+
archive/
47+
notes/
48+
*.md
49+
!README.md
50+
51+
# Scripts (development only)
52+
scripts/
53+
*.py
54+
*.sh
55+
*.bat
56+
*.ps1
57+
58+
# Test files
59+
tests/
60+
benchmarks/
61+
examples/
62+
63+
# Backup files
64+
*.backup
65+
*.bak
66+
*.tmp

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21+
- name: Setup Rust
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
toolchain: 1.85
25+
2126
- name: Code format check
2227
run: cargo fmt -- --check
2328

CHANGELOG.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
1-
## [0.5.1] - 2025-11-21
1+
## [0.5.1] - 2025-11-20
22

33
### 🚀 Features
44

5-
- Add SQL Generation API (v0.5.1)
6-
- Implement RETURN DISTINCT for de-duplication
7-
- Add role-based connection pool for ClickHouse RBAC
5+
- **RETURN DISTINCT**: Add support for `RETURN DISTINCT` to de-duplicate query results
6+
- Eliminates duplicate results in multi-path graph traversals
7+
- Fully integrated: parser, AST, logical plan, SQL generation
8+
- Generates `SELECT DISTINCT` in ClickHouse SQL
9+
- **Role-Based Connection Pool**: Implement per-role connection pooling for ClickHouse RBAC
10+
- Maintains separate connection pools per role for performance
11+
- Eliminates `SET ROLE` execution overhead on every query
12+
- Prevents race conditions with concurrent role usage
13+
- Uses ClickHouse HTTP `role` parameter for proper role context
14+
- Works without role (uses default connection pool)
815

916
### 🐛 Bug Fixes
1017

18+
- Fix WHERE filter application in complex graph patterns (addresses user-reported duplicate results)
1119
- Eliminate flaky cache LRU eviction test with millisecond timestamps
1220

13-
### 📚 Documentation
14-
15-
- Fix getting-started guide issues
16-
- Update STATUS.md with fixed flaky test achievement (423/423 passing)
17-
- Add /query/sql endpoint and RETURN DISTINCT documentation
18-
- Add /query/sql endpoint and RETURN DISTINCT to wiki
19-
2021
### 🧪 Testing
2122

22-
- Add role-based connection pool integration tests
23+
- Add comprehensive role-based connection pool integration tests
24+
- Verify RETURN DISTINCT de-duplication behavior
25+
- SQL generation endpoint correctly returns `["SET ROLE role", "SELECT ..."]` array
2326

24-
### ⚙️ Miscellaneous Tasks
27+
### 📊 Test Coverage
28+
29+
- **423/423 integration tests passing** (100%)
30+
- Role-based query tests: 4/6 passing (2 require ClickHouse roles setup)
2531

26-
- Update CHANGELOG.md [skip ci]
27-
- Release v0.5.1
2832
## [0.5.0] - 2025-11-19
2933

3034
### 🚀 Features

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 68 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,84 @@
1+
# ============================================================================
2+
# Stage 1: Planner - Generate dependency recipe for caching
3+
# ============================================================================
14
FROM lukemathwalker/cargo-chef:latest-rust-1-bullseye AS chef
25
WORKDIR /app
36

47
FROM chef AS planner
58
COPY . .
69
RUN cargo chef prepare --recipe-path recipe.json
710

11+
# ============================================================================
12+
# Stage 2: Builder - Build the application
13+
# ============================================================================
814
FROM chef AS builder
15+
16+
# Copy dependency recipe
917
COPY --from=planner /app/recipe.json recipe.json
18+
1019
# Build dependencies - this is the caching Docker layer!
20+
# This layer is only rebuilt when dependencies change
1121
RUN cargo chef cook --release --recipe-path recipe.json
12-
# Build application
22+
23+
# Copy source code
1324
COPY . .
14-
RUN cargo build --release --bin clickgraph \
15-
&& cargo build --release -p clickgraph-client --bin clickgraph-client
1625

17-
# We do not need the Rust toolchain to run the binary!
26+
# Build the application binaries
27+
RUN cargo build --release --bin clickgraph && \
28+
cargo build --release -p clickgraph-client --bin clickgraph-client
29+
30+
# Strip debug symbols to reduce binary size
31+
RUN strip /app/target/release/clickgraph && \
32+
strip /app/target/release/clickgraph-client
33+
34+
# ============================================================================
35+
# Stage 3: Runtime - Minimal production image
36+
# ============================================================================
1837
FROM debian:bullseye-slim AS runtime
38+
39+
# Install runtime dependencies only
1940
RUN apt-get update && \
20-
apt-get install -y libssl1.1 ca-certificates && \
21-
rm -rf /var/lib/apt/lists/*
41+
apt-get install -y --no-install-recommends \
42+
ca-certificates \
43+
libssl1.1 \
44+
wget \
45+
&& rm -rf /var/lib/apt/lists/*
46+
47+
# Create non-root user for security
48+
RUN useradd -m -u 1000 -s /bin/bash clickgraph
49+
50+
# Set working directory
2251
WORKDIR /app
23-
# Copy binaries
24-
COPY --from=builder /app/target/release/clickgraph /usr/local/bin/
25-
COPY --from=builder /app/target/release/clickgraph-client /usr/local/bin/
26-
ENTRYPOINT ["/usr/local/bin/clickgraph"]
52+
53+
# Copy binaries from builder
54+
COPY --from=builder /app/target/release/clickgraph /usr/local/bin/clickgraph
55+
COPY --from=builder /app/target/release/clickgraph-client /usr/local/bin/clickgraph-client
56+
57+
# Set proper permissions
58+
RUN chown -R clickgraph:clickgraph /app && \
59+
chmod +x /usr/local/bin/clickgraph /usr/local/bin/clickgraph-client
60+
61+
# Switch to non-root user
62+
USER clickgraph
63+
64+
# Expose ports
65+
EXPOSE 8080 7687
66+
67+
# Health check using wget (smaller than curl)
68+
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
69+
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
70+
71+
# Default environment variables (can be overridden)
72+
ENV CLICKGRAPH_HOST=0.0.0.0 \
73+
CLICKGRAPH_PORT=8080 \
74+
CLICKGRAPH_BOLT_HOST=0.0.0.0 \
75+
CLICKGRAPH_BOLT_PORT=7687 \
76+
CLICKGRAPH_BOLT_ENABLED=true \
77+
CLICKGRAPH_MAX_CTE_DEPTH=100 \
78+
RUST_LOG=info
79+
80+
# Set entrypoint
81+
ENTRYPOINT ["/usr/local/bin/clickgraph"]
82+
83+
# Default command (can be overridden)
84+
CMD []

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Multi-stage build for testing
2-
FROM rust:1.82 as builder
2+
FROM rust:1.85 as builder
33

44
WORKDIR /build
55
COPY . .

0 commit comments

Comments
 (0)