Add comprehensive integration tests for Dremio with SeaweedFS's Iceberg REST Catalog, following the same patterns as existing Spark and Trino tests. Tests include: - Basic catalog connectivity and schema operations - Table creation, insertion, and querying (CRUD) - Deterministic table location specification - Multi-level namespace support Implementation includes: - dremio_catalog_test.go: Core test environment and basic operations - dremio_crud_operations_test.go: Schema and table CRUD testing - dremio_deterministic_location_test.go: Location and namespace testing - Comprehensive README and implementation documentation CI/CD: - Added dremio-iceberg-catalog-tests job to s3-tables-tests.yml - Pre-pulls Dremio image, runs with 25m timeout - Uploads artifacts on failure
6.3 KiB
Dremio Integration Test Implementation
Overview
This implementation adds comprehensive integration testing for Dremio with SeaweedFS's Iceberg REST Catalog, following the same patterns as existing Spark and Trino integration tests.
Files Created
Test Files
-
dremio_catalog_test.go (13.2 KB)
- Core test environment setup and initialization
- TestDremioIcebergCatalog: Basic catalog connectivity and schema operations
- TestDremioTableOperations: Table creation, insertion, and querying
- TestEnvironment struct: Manages SeaweedFS mini instance and Dremio container
- Helper functions for:
- Starting SeaweedFS with all necessary services
- Writing Dremio configuration files
- Starting and managing Dremio Docker containers
- Waiting for service readiness
- Executing Dremio SQL commands
- Creating S3 table buckets
-
dremio_crud_operations_test.go (4.5 KB)
- TestSchemaCRUD: Schema creation, listing, and deletion
- TestTableCRUD: Table creation, listing, insertion, and deletion
- TestDataInsertAndQuery: Complex queries with WHERE, GROUP BY, and aggregations
- setupDremioTest: Common test environment initialization helper
-
dremio_deterministic_location_test.go (3.7 KB)
- TestDeterministicTableLocation: Explicit table location specification
- TestMultiLevelNamespace: Multi-level namespace support (e.g., "analytics.daily")
- Verifies correct S3 path handling for namespaces
-
README.md (3.9 KB)
- Comprehensive documentation
- Prerequisites and setup instructions
- Test file descriptions
- How to run tests locally
- Test scenario explanations
- Troubleshooting guide
- CI/CD integration details
-
IMPLEMENTATION.md (this file)
- Implementation details and design decisions
CI/CD Integration
Updated .github/workflows/s3-tables-tests.yml:
- Added new job:
dremio-iceberg-catalog-tests - Pre-pulls latest Dremio Docker image
- Runs with 30-minute timeout (25 minutes for tests)
- Uploads test artifacts on failure
- Integrated alongside existing Trino, Spark, and other catalog tests
Design Decisions
Architecture
-
Test Environment Pattern
- Follows the Trino integration test pattern (vs Spark's testcontainers approach)
- Uses raw Docker commands for container management
- Allocates random ports to avoid conflicts
- Manages SeaweedFS process directly using exec.Cmd
-
SQL Execution
- Uses Dremio REST API (/api/v3/sql endpoint)
- Executes via docker exec with curl
- Parses output using jq for JSON extraction
- Graceful handling of format variations
-
Configuration
- Dremio config file format supports REST catalog integration
- AWS SigV4 authentication (matching Trino pattern)
- S3 path-style access enabled for compatibility
- Warehouse bucket:
iceberg-tables
-
Service Readiness
- Iceberg REST API: HTTP health check on /v1/config
- Dremio: Curl-based ping check on /api/v2/ping
- Timeout: 120 seconds for Dremio (longer than Trino due to startup time)
Key Features
-
Complete CRUD Testing
- Schema creation, listing, deletion
- Table creation with explicit locations
- Data insertion with bulk operations
- Data querying with WHERE, GROUP BY, aggregations
-
Namespace Support
- Single-level namespaces (basic case)
- Multi-level namespaces with dot-separation
- Deterministic table locations
-
Error Handling
- Graceful cleanup of resources
- Temporary directory management
- Docker container cleanup on test completion
-
Logging
- Comprehensive debug output
- Service startup verification
- SQL command logging
- Port allocation diagnostics
Implementation Notes
Differences from Trino Tests
-
Container Management
- Similar approach: raw Docker commands (not testcontainers)
- Uses
host.docker.internalfor networking (same as Trino)
-
Configuration Format
- Dremio uses JSON-based config (vs Trino .properties files)
- Simpler configuration for single catalog setup
-
SQL Endpoint
- Dremio: REST API with JSON request/response
- Trino: CLI-based execution via docker exec
-
Startup Time
- Dremio: ~120 seconds (longer initialization)
- Trino: ~60 seconds
Potential Enhancements
-
Additional Test Scenarios
- Parquet file format verification
- ORC file format support
- Schema evolution testing
- Partition projection testing
- Time-travel queries (Iceberg-specific)
-
Performance Testing
- Large table operations
- Concurrent access patterns
- Query performance benchmarks
-
Error Scenarios
- Invalid table creation
- Concurrent modifications
- Network failure handling
-
Advanced Features
- Metastore security testing
- Audit log verification
- Snapshot browsing
- Manifest file handling
Testing the Implementation
Local Testing
cd test/s3tables/catalog_dremio
# Run all tests
go test -v -timeout 20m ./...
# Run specific test
go test -v -run TestDremioIcebergCatalog
# Run tests skipping integration tests
go test -short ./...
CI/CD Testing
Tests are automatically triggered on:
- Pull requests
- Changes to test files
- Changes to S3/catalog implementation
Troubleshooting
Common Issues
-
Port Allocation Failures
- Solution: Close other services or reboot
- The tests allocate 9 ports dynamically
-
Dremio Container Timeout
- Dremio has longer startup time than Trino
- Increase timeout if needed: 120 seconds default
-
Iceberg REST API Not Ready
- Verify SeaweedFS started correctly
- Check Iceberg port is listening:
netstat -tlnp | grep :8080
-
SQL Execution Failures
- Check Dremio container logs:
docker logs <container> - Verify S3 credentials in configuration
- Check Dremio container logs:
Related Files
.github/workflows/s3-tables-tests.yml- CI/CD pipelinetest/s3tables/catalog_trino/- Similar Trino tests (reference)test/s3tables/catalog_spark/- Spark tests (reference)test/s3tables/catalog/- Base Iceberg catalog teststest/testutil/- Shared testing utilities
Version Compatibility
- Go: 1.18+
- Docker: Latest stable version
- Dremio: Latest (tested with dremio/dremio:latest)
- SeaweedFS: Current master branch
- Iceberg: Via REST catalog (version-agnostic)