Apache Doris
repository·master·Indexed 12 days ago
https://github.com/apache/dorisAn open-source MPP (Massively Parallel Processing) database designed for real-time analytics, lakehouse querying, and hybrid search, including vector and text data.
What's inside Apache Doris
- The CLOUD P0 CI Pipeline is a specialized testing workflow that deploys Apache Doris in cloud mode using S3 storage on a single machine. Its primary purpose is to execute and validate P0 test cases within this cloud-native configuration.
Overview of Apache Doris
masterApache Doris is an open-source, real-time analytics and search database built on Massively Parallel Processing (MPP) architecture. It is designed to provide fast SQL analytics, lakehouse query acceleration, and hybrid search capabilities across structured, text, and vector data. It can be used for customer-facing analytics, data warehousing, observability, and AI workloads.Overview of Doris FE SQL Parser
masterThe
fe-sql-parseris a standalone ANTLR4-based syntax parser for Apache Doris SQL. It generates an ANTLR parse tree (CST) for any Doris-dialect SQL string.Important Note: This parser performs no semantic analysis. It does not resolve identifiers, validate tables or columns, or check data types. It is strictly a syntax parser.
Overview of the fe-foundation module
masterThe
fe-foundationmodule is a zero-dependency, lightweight shared library designed for the Apache Doris Frontend (FE) ecosystem. It sits at the bottom of the dependency hierarchy to provide essential, general-purpose utilities that can be safely used by both core Doris modules and external SPI (Service Provider Interface) plugins without pulling in heavy transitive dependencies like Guava, Hadoop, or Gson.Key Characteristics:
- Zero third-party dependencies: It uses only pure JDK utilities.
- No business logic coupling: It contains no references to Doris-specific components like catalogs, optimizers, or planners.
- Stability: It provides a stable API intended for long-term use across the ecosystem.
Overview of Iceberg and Paimon Schema Evolution and Time Travel Test Suites
masterThis documentation outlines the regression testing coverage for Apache Doris when interacting with external Iceberg and Paimon tables. It specifically focuses on the intersection of Schema Evolution (changes to table structure), Partition Evolution (changes to how data is partitioned), and Time Travel (accessing historical snapshots, tags, or branches).
Key areas of coverage include:
- Schema Operations: Renaming, promotion, dropping, and re-adding fields, as well as metadata atomicity (comments, defaults, nullability).
- Partition Evolution: Adding, dropping, or replacing partition specs and how they interact with runtime filters and scanners.
- Historical References: Using snapshots, tags, and branches to access data at specific points in time.
- Delete Mechanisms: Handling Equality Deletes, Position Deletes, and Deletion Vectors (DV) across schema and partition changes.
- Catalog Types: Support for REST, Filesystem, and JDBC catalogs.
Iceberg Write P0 Coverage Matrix Overview
masterThis document defines the P0 (Priority 0) testing coverage for writing data from Apache Doris to Apache Iceberg tables. The coverage ensures correctness, compatibility, and failure atomicity across various scenarios including schema evolution, partition evolution, and row-level DML operations.
Coverage Scope
The matrix validates the interaction between:
- Schema Changes: Adding, renaming, dropping, or promoting types.
- Partition Evolution: Changes to partition specs and transforms.
- Data Models: Support for Duplicate, Unique (MOW/MOR), and Aggregate models.
- DML Operations:
INSERT,OVERWRITE,DELETE,UPDATE, andMERGE. - Iceberg Features: Snapshots, tags, and branches.
- Data Types: Primitive types, complex types (ARRAY, MAP, STRUCT), and NULL semantics.
Validation Principles
- Positive Suites: Results are compared row-by-row against Spark for the same table logic after the final write. For suites involving transform metadata, physical partition values are also compared.
- Historical References: Validation includes checking the isolation of snapshots, tags, and branches.
- Failure Atomicity: Ensures that if an operation fails (e.g., due to type mismatch or constraint violation), the snapshot, files, and data remain unchanged.
What the Doris Bitmap Reader Go demo does
masterThis is a Golang demonstration specifically designed for the Doris bitmap reader. It provides a functional example of how to use Go code to read any bitmap stored within your Apache Doris instance.Understand the purpose of default certificates in conf/mysql_ssl_default_certificate
masterThe directory
conf/mysql_ssl_default_certificatecontains default certificates generated for testing or initial setup.Important Security Warning: These certificates are generated by default and cannot be used in a production environment.
Specifically, the certificates located in
./client_certificateare used to verify the identity of the client. For production-grade security, you must replace these with certificates issued by a trusted Certificate Authority (CA).Understand the Spring Boot + MyBatis + Doris Integration Demo
masterThis demo project demonstrates how to integrate Apache Doris with a Spring Boot application using MyBatis and JDBC to access Doris data and expose it via RESTful APIs.
Key components of the architecture include:
- Data Source Management: Uses
datasourcefor dynamic switching between multiple data sources. - Data Access: Uses
mapper(MyBatis interfaces) anddomain(Entity Java beans) to interact with Doris tables. - API Layer: Uses
controllerto provide RESTful endpoints. - Configuration: Managed via
application.yml(Spring Boot),application-druid.yml(Database connections), and MyBatis XML files for data access mapping.
- Data Source Management: Uses
Understand the Doris UI project structure
masterThe UI project follows a standard web application directory structure:
public/: Contains static resources.src/: The main development directory.assets/: Static resources and images (managed via webpack).components/: Common reusable components.pages/: Subpages, which may contain their own subcomponents.utils/: Public utility methods.
webpack.config.js: The Webpack configuration file.
The technology stack uses
react,react-router-dom,ant-design, andrxjs.Understand the fe-connector plugin framework
masterThe
fe-connectorframework allows Apache Doris FE to serve metadata, scans, and writes for external data sources without the core engine needing internal knowledge of those sources.Core Design Principles:
- Isolation: Connectors must never import
fe-coreinternals. All interaction must occur through the SPI (org.apache.doris.connector.*) or shared neutral types. - Property Ownership:
fe-coredoes not parse connector properties. Metadata-connection properties are parsed within the connector (typically via a metastore layer), while storage properties are handled byfe-filesystem. - Agnosticism: Shared planning code remains source-agnostic. Per-source behavior is accessed via the SPI, and optional features are enabled via
ConnectorCapability(opt-in mechanism).
- Isolation: Connectors must never import
How statistics are analyzed and loaded
masterAnalysis Flow
When an analysis job is created via
DdlExecutor, theAnalysisManagervalidates partitions and creates tasks for each column (and Materialized View indexes).- Synchronous tasks are executed immediately.
- Asynchronous tasks are persisted to the
StatisticsRepository, scheduled viaAnalysisTaskScheduler, and executed byAnalysisTaskExecutorin a thread pool. The tasks collect data from the BE (Backend) nodes, refresh theStatisticsCache, and update the job status upon completion.
Loading Flow
When the
StatsCalculatorrequests statistics:- It checks the
StatisticsCache. - If cached, the stats are returned immediately.
- If not cached, the cache returns
UNKNOWNand submits an asynchronous load task. - The load task executes a statistic query via
StatisticsUtil. If successful, the results are deserialized and cached as normal statistics. If an exception occurs,UNKNOWNis cached for that column to prevent repeated failed attempts.