Skip to content
CAI
Software that uses CAICheck a score

apache/shardingsphere

69.4

Adequate · 6 August 2026

341.8k

lines of production code

Java

primary language

3

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a comprehensive database middleware and agent framework that provides database connectivity, protocol handling, and runtime instrumentation capabilities. It supports a wide array of database dialects including MySQL, Oracle, PostgreSQL, and others, while offering features like read-write splitting, sharding, encryption, and data masking. Additionally, it includes a Java agent for collecting metrics, tracing, and logging via OpenTelemetry and Prometheus, alongside a SQL parser and execution engine for distributed database operations.

How it got here

2016–2023 — Agent and Kernel Architecture Refactoring

173 changes.

This period focused on establishing a robust, plugin-based architecture for the ShardingSphere Agent, introducing a standardized lifecycle management system and YAML configuration support. Simultaneously, the core kernel underwent significant refactoring to support new features like global clock coordination, SQL federation, and enhanced transaction management, while also improving the proxy and standalone mode implementations.

2024–2025 — Database connector and protocol expansion

166 changes.

The period focused on expanding database connectivity by implementing full connector and protocol support for Firebird, Hive, MariaDB, and SQL Server, alongside significant refactoring of the database connector core to standardize metadata loading and JDBC URL parsing. Concurrently, the codebase introduced new DistSQL handlers and RAL statements for managing data pipelines, CDC streaming, and migration jobs, while also establishing a more modular architecture for SQL binding, routing, and rewriting across multiple database dialects.

2026 — MCP integration and test coverage

36 changes.

This period focused on establishing the Model Context Protocol (MCP) integration, introducing core APIs, bootstrap mechanisms, and feature-specific handlers for encryption, masking, broadcast, readwrite-splitting, and sharding. Concurrently, the codebase saw a significant expansion of unit and end-to-end test coverage for these new features, alongside improvements to identifier case policies and Firebird exception mapping.

Features

Add Atomikos XA transaction manager provider

The Atomikos XA transaction manager provider is now available, introducing \AtomikosTransactionManagerProvider\ and \AtomikosXARecoverableResource\ to manage XA resources via the Atomikos JTA implementation. This includes the necessary service loader configuration and default transaction properties to enable distributed XA transactions with Atomikos.

kernel/transaction/type/xa/provider/atomikos · high confidence

Add BuildInfoExporter for exposing build metadata metrics

A new BuildInfoExporter has been added to the metrics core module, implementing the MetricsExporter interface to expose build information (name and version) as a gauge metric. This change introduces a dedicated exporter that registers and cleans up build-related metrics, ensuring that build metadata is consistently exported for monitoring and observability.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl · medium confidence

Add CDC DistSQL parser for streaming rules

Introduces a new parser for CDC DistSQL commands, enabling users to manage streaming rules via SQL. The change adds ANTLR4 grammar files (Alphabet, BaseRule, Keyword, Literals, RALStatement, Symbol, CDCDistSQLStatement) and Java classes (Lexer, Parser, Visitor, Facade) to parse and execute commands such as SHOW, ALTER, and DROP for streaming configurations, including parameters like worker threads, batch size, sharding size, and rate limiters.

kernel/data-pipeline/scenario/cdc/distsql/parser · high confidence

Add CDC client implementation for data pipeline scenarios

Introduced a new CDC (Change Data Capture) client module within the data pipeline, providing a Netty-based TCP client for connecting to CDC servers. The implementation includes a main \CDCClient\ class that manages connection lifecycle, authentication (login), and streaming operations (start, restart, stop, and drop). It utilizes a \ClientConnectionContext\ to track connection status and streaming IDs, and employs a \ResponseFuture\ mechanism with configurable timeout to handle asynchronous server responses. The module also adds configuration classes, parameter objects for login and streaming, and utility classes for request IDs and Protobuf conversion. A bootstrap example and unit tests for the configuration and request handler are also included.

kernel/data-pipeline/scenario/cdc/client · high confidence

Add DistSQL handlers for global clock rule configuration

Users can now manage the global clock rule via DistSQL. This change introduces the ShowGlobalClockRuleExecutor and AlterGlobalClockRuleExecutor, enabling users to query and modify global clock rule settings (such as type, provider, and enabled status) using the new SHOW and ALTER GLOBAL CLOCK RULE commands.

kernel/global-clock/distsql/handler · high confidence

Add DistSQL handlers for migration job and consistency check status queries

Users can now query the status of migration jobs and consistency checks via DistSQL. New executors have been added to handle queries for migration lists, job statuses, rule configurations, and source storage units, as well as consistency check statuses. Additionally, update executors have been introduced to manage the lifecycle of migration and consistency check jobs, including starting, stopping, checking, committing, rolling back, and dropping these jobs.

kernel/data-pipeline/scenario/migration/distsql/handler · high confidence

Add DistSQL handlers for querying and altering the transaction rule

Users can now use the new DistSQL commands to view and modify the global transaction rule configuration. The system introduces a new \ShowTransactionRuleExecutor\ and \AlterTransactionRuleExecutor\ to handle \SHOW TRANSACTION RULE\ and \ALTER ...\ statements respectively. The \ALTER\ command validates the transaction type and ensures the required transaction manager provider is available before applying changes. Test cases and fixtures have been added to verify these operations.

kernel/transaction/distsql/handler · high confidence

Add DistSQL handlers for showing and altering the SQL parser rule

Users can now use the \SHOW SQL\_PARSER\_RULE\ and \ALTER SQL\_PARSER\_RULE\ DistSQL commands to view and modify the SQL parser rule configuration, including cache settings for parse trees and SQL statements. This change introduces the \ShowSQLParserRuleExecutor\ and \AlterSQLParserRuleExecutor\ in the distsql handler module, along with their corresponding test cases and service provider configurations.

kernel/sql-parser/distsql/handler · high confidence

Add DistSQL handlers for single table management

Introduces new DistSQL executors and converters to support single table operations, including loading, unloading, and setting default storage units for single tables. Users can now use commands to manage single table configurations, view loaded and unloaded single tables, and query the default storage unit. The change adds specific handlers for these operations, enabling more granular control over single table rules and their associated storage units.

kernel/single/distsql/handler · high confidence

Add DistSQL handlers for streaming CDC jobs

New executors have been added to support managing and monitoring streaming Change Data Capture (CDC) jobs via DistSQL. This includes \ShowStreamingListExecutor\ and \ShowStreamingJobStatusExecutor\ to query job states and progress, \ShowStreamingRuleExecutor\ to display configuration rules, and \DropStreamingExecutor\ to remove streaming jobs. These components are registered via SPI service files to enable the corresponding SQL commands.

kernel/data-pipeline/scenario/cdc/distsql/handler · high confidence

Add DistSQL parser for SQL parser rule management

The distsql/parser module now includes a complete parser for DistSQL statements used to manage SQL parser rules. This adds support for the \SHOW SQL\_PARSER RULE\ and \ALTER SQL\_PARSER RULE\ commands, allowing users to view and configure parser cache settings (parse tree cache and SQL statement cache) via DistSQL. The implementation includes the ANTLR grammar, lexer, parser, visitor, and facade classes required to process these statements.

kernel/sql-federation/distsql/parser, kernel/sql-parser/distsql/parser · high confidence

Add DistSQL parser for data migration scenarios

Introduces a new DistSQL parser for data migration, including ANTLR4 grammar files (Alphabet, BaseRule, Keyword, Literals, RALStatement, RQLStatement, Symbol, and the main MigrationDistSQLStatement grammar) and the corresponding Java implementation classes (Lexer, Parser, StatementVisitor, and Facade). This enables the system to parse and process migration-related DistSQL statements.

kernel/data-pipeline/scenario/migration/distsql/parser · high confidence

Add DistSQL parser for single-table operations

Introduces a new DistSQL parser module for single-table management, enabling users to execute commands to load, unload, and query single tables. The change adds ANTLR grammar files and Java classes to parse statements such as \LOAD/UN single TABLE\, \SHOW single TABLES\, and \SET default single table storage unit\, providing the underlying parsing logic for these new capabilities.

kernel/single/distsql/parser · high confidence

Add DistSQL statements for SQL federation rule management

The \kernel/sql-federation/distsql/statement\ area introduces new DistSQL statement classes to support SQL federation configuration. This includes \ShowSQLFederationRuleStatement\ for querying federation rules, \AlterSQLFederationRuleStatement\ for updating federation settings (such as enabling SQL federation and configuring execution plan cache options), and \CacheOptionSegment\ to define cache parameters. These changes enable users to manage SQL federation rules via DistSQL commands.

kernel/sql-federation/distsql/statement · high confidence

Add DistSQL statements for SQL translator rules

Users can now manage SQL translator rules via DistSQL. This change introduces new statement classes, including ShowSQLTranslatorRuleStatement and AlterSQLTranslatorRuleStatement, which extend the existing ShowGlobalRulesStatement and GlobalRuleDefinitionStatement respectively. This enables querying and modifying SQL translator rule configurations through the DistSQL interface.

kernel/sql-translator/distsql/statement · high confidence

Add DistSQL statements for managing the Global Clock rule

New DistSQL statement classes are introduced to support querying and altering the Global Clock rule: \ShowGlobalClockRuleStatement\ extends \ShowGlobalRulesStatement\ to enable retrieving the current configuration, while \AlterGlobalClockRuleStatement\ extends \GlobalRuleDefinitionStatement\ to allow modifying its type, provider, enabled status, and properties.

kernel/global-clock/distsql/statement · high confidence

Add DistSQL statements for single table management

Users can now manage single tables via DistSQL. New statements allow loading and unloading single tables, setting and showing the default storage unit for single tables, and listing all single tables or unloaded single tables within a database.

kernel/single/distsql/statement · high confidence

Add DistSQL support for SQL Federation rule configuration

Users can now view and modify SQL Federation rule settings through DistSQL. The new \ShowSQLFederationRuleExecutor\ allows querying the current state of the SQL Federation rule, including whether SQL Federation is enabled, if all queries should use it, and the execution plan cache configuration. The \AlterSQLFederationRuleExecutor\ enables updating these settings, with validation ensuring that cache parameters like \initialCapacity\ and \maximumSize\ are strictly positive. These changes are supported by new test cases and service provider files that register the executors.

kernel/sql-federation/distsql/handler · high confidence

Add DistSQL support for SQL Translator rule

Users can now manage the SQL Translator rule via DistSQL. This change introduces the \ShowSQLTranslatorRuleExecutor\ and \AlterSQLTranslatorRuleExecutor\ classes, which enable querying the current SQL Translator rule configuration and modifying its properties (such as \useOriginalSQLWhenTranslatingFailed\) through DistSQL commands. The implementation includes the necessary SPI service files to register these executors and provides test coverage for the new functionality.

kernel/sql-translator/distsql/handler · high confidence

Add DistSQL support for SQL translator rule management

The system now supports managing SQL translator rules via DistSQL. Users can execute \SHOW SQL\_READER RULE\ and \ALTER SQL\_READER RULE\ commands to view or configure translator settings, including specifying the algorithm type and associated properties. This change introduces the necessary parser components (ANTLR4 grammar files, Java parser classes, and a service provider configuration) to enable these new DistSQL statements.

kernel/sql-translator/distsql/parser · high confidence

Add DistSQL support for querying and altering transmission rules

Users can now use the new \ShowTransmissionRuleQueryResult\ and \AlterTransmissionRuleExecutor\ to view and modify pipeline transmission configurations (read, write, and stream channel settings) via DistSQL. The \ShowTransmissionRuleQueryResult\ retrieves the current process configuration for a given job type, while the \AlterTransmissionRuleExecutor\ allows updating these settings, including validation of the stream channel type. Tests are added to verify the correct parsing, persistence, and error handling for these operations.

kernel/data-pipeline/distsql/handler · high confidence

Add Espresso inline expression parser for SQL expression evaluation

Users can now use the new 'ESPRESSO' expression type to evaluate inline SQL expressions via the GraalVM Truffle/Espresso engine. This new parser, located in the \infra/expr/type/espresso\ module, supports complex template patterns, array/range syntax, and placeholder replacement, enabling more flexible dynamic SQL generation.

infra/expr/type/espresso · high confidence

Add Firebird batch command packet handling

The Firebird protocol implementation now includes support for batch command packets, including new packet classes for batch create, execute, message, cancel, release, and sync operations, along with a batch registry to manage batch statement state. This enables the proxy to process batched SQL operations for Firebird databases.

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/command · high confidence

Add Firebird dialect support for connection parsing, metadata loading, and system tables

This change introduces the complete implementation for the Firebird database connector within the ShardingSphere framework. It adds a \FirebirdConnectionPropertiesParser\ to handle JDBC URL parsing, and a \FirebirdMetaDataLoader\ that loads table metadata, including specific handling for BLOB columns and non-fixed length column sizes. The update also defines \FirebirdDatabaseMetaData\ to specify database-specific behaviors such as identifier case policies, schema options, and transaction options. Additionally, system database metadata and YAML schema definitions for Firebird's monitoring tables (e.g., \mon$attachments\, \mon$call\_stack\) are added to enable proper system table introspection.

database/connector/dialect/firebird/src/main · high confidence

Add Firebird error handling via new status vector class

A new FirebirdStatusVector class has been added to the Firebird protocol dialect, enabling the system to parse and format SQL exceptions into a structured error response. This change improves how Firebird database errors are captured and communicated to the user by extracting and formatting the error code and message from the underlying SQLException.

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/err · high confidence

Add Firebird exception mapping support

Users connecting to Firebird databases will now see standardized, vendor-specific error messages for common issues like unavailable databases and failed logins, rather than generic exceptions. This change introduces a new exception mapping layer for Firebird, including a dialect-specific mapper, vendor error codes, and SQL state definitions, ensuring that Firebird-specific error codes and SQL states are correctly translated into user-friendly SQL exceptions.

database/exception/dialect/firebird · high confidence

Add Firebird protocol codec engine and payload handling

The Firebird database protocol codec is now implemented in the ShardingSphere proxy. This change introduces the \FirebirdPacketCodecEngine\ and \FirebirdPacketPayload\ classes, which handle the encoding and decoding of Firebird wire protocol packets. This enables the proxy to correctly parse and construct Firebird-specific network messages, including support for BLOB data types and batch operations, allowing ShardingSphere to act as a proxy for Firebird databases.

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/codec · high confidence

Add Firebird protocol constants and parameter buffer types

Added new Java classes in the Firebird dialect's constant package to support the Firebird database protocol. This includes enums for architecture types (FirebirdArchType), authentication methods (FirebirdAuthenticationMethod), user data types (FirebirdUserDataType), and value formats (FirebirdValueFormat). Additionally, the change introduces classes for handling parameter buffers (FirebirdParameterBuffer, FirebirdParameterBufferType) and specific database/transaction parameter buffer types (FirebirdDatabaseParameterBufferType, FirebirdTransactionParameterBufferType), alongside protocol versioning and connection management constants (FirebirdConstant, FirebirdProtocol, FirebirdProtocolVersion, FirebirdConnectionProtocolVersion).

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/constant · high confidence

Add Firebird protocol packet classes for batch, fetch, and SQL responses

The Firebird database dialect now includes new packet classes—FirebirdBatchCompletionStateResponse, FirebirdFetchResponsePacket, FirebirdGenericResponsePacket, and FirebirdSQLResponsePacket—to support batch completion states, row fetching, generic responses, and SQL responses. These changes enable the proxy to correctly serialize and deserialize Firebird-specific protocol messages, improving support for batch operations and data retrieval in Firebird.

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/generic · high confidence

Add Groovy-based inline expression parser

The GroovyInlineExpressionParser is introduced to handle inline expressions using the Groovy scripting engine. This new parser supports dynamic expression evaluation, including variable substitution, array/range expansion, and complex nested expressions. The implementation includes a thread-safe cache for compiled scripts and handles placeholder replacement, enabling more flexible and powerful inline expression capabilities for users.

infra/expr/type/groovy · high confidence

Add Hive dialect support for database connectivity and metadata loading

The Hive dialect implementation is introduced, enabling ShardingSphere to connect to and query metadata from Apache Hive. This includes a new \HiveDatabaseType\ to recognize \jdbc:hive2:\ URLs, a \HiveConnectionPropertiesParser\ to parse connection details, and a \HiveMetaDataLoader\ that retrieves table and column information via the \INformation\_schema\ or direct queries. The dialect also defines \HiveDatabaseMetaData\ to enforce lower-case identifier normalization, backtick quoting, and low nulls ordering, while \HiveSystemDatabase\ and \HiveFunctionOption\ configure system schemas and function handling. Service files register these components for automatic discovery.

database/connector/dialect/hive/src/main · high confidence

Add Hybrid Logical Clock (HLC) provider implementation

A new HLCProvider interface is introduced to support Hybrid Logical Clocks as a global clock type. This adds a specific clocking strategy to the system, allowing users to utilize HLC for time synchronization in distributed scenarios.

kernel/global-clock/type/hlc · high confidence

Add Interval inline expression parser for date/time range generation

The system now supports generating inline expressions for date and time intervals. A new \IntervalInlineExpressionParser\ has been added to the \infra/expr/type/interval\ module, implementing the \InlineExpressionParser\ SPI. This parser processes properties defining prefixes, suffix patterns, step amounts, and units to generate sequences of date/time strings. The change includes the implementation class, its SPI registration, and comprehensive unit tests covering various temporal types (LocalDate, LocalDateTime, YearMonth, etc.) and specific chronologies like Japanese dates.

infra/expr/type/interval · high confidence

Add JDBC metrics exporters for metadata and state

New exporters have been added to the metrics plugin to expose ShardingSphere-JDBC metadata and state information. JDBCMetaDataInfoExporter now publishes a gauge metric for each database's storage unit count, while JDBCStateExporter exposes the current state of each JDBC instance (0 for OK, 1 for circuit break).

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl/jdbc · high confidence

Add MCP Registry metadata validation and tooling

The MCP registry module now includes a new command-line tool (MCPRegistryMetadataCommand) that validates server.json metadata against the official Model Context Protocol registry schema, enforcing requirements such as OCI package structure, transport types (stdio and streamable-http), version matching, and Dockerfile metadata (labels and arguments). A dedicated validator (MCPDockerfileMetadataValidator) ensures Dockerfiles contain the required ARG and LABEL fields. These changes provide automated checks for publishing MCP server metadata, ensuring consistency and correctness before distribution.

mcp/registry · high confidence

Add MCP bootstrap and YAML configuration support

The MCP module now includes a bootstrap entry point and a complete YAML-based configuration system. Users can now start the MCP runtime via the \MCPBootstrap\ main class, which loads a YAML configuration file (defaulting to \conf/mcp-http.yaml\) to define transport type (HTTP or STDIO), HTTP transport settings (bind host, port, endpoint path, session attribution headers), and runtime database connections. The configuration is validated at startup to ensure correct structure and values.

mcp/bootstrap · high confidence

Add MCP integration for data masking features

Introduced Model Context Protocol (MCP) support for the data masking feature, enabling AI assistants to plan and apply masking rules. This includes a new \MCPHandlerProvider\ service file, a YAML descriptor defining resources for mask algorithms and rules, and a prompt template that guides the model to use the \database\_gateway\_plan\_mask\_rule\ and \database\_gateway\_apply\_workflow\ tools for generating and reviewing DistSQL artifacts.

mcp/features/mask · high confidence

Add MCP support for readwrite-splitting rule and status planning

The readwrite-splitting feature now includes the necessary service provider files and MCP descriptors to enable AI-assisted planning for readwrite-splitting rules and storage-unit status changes. Users can now use the \plan\_readwrite\_splitting\_rule\ and \plan\_readwrite\_splitting\_status\ prompts to generate DistSQL workflows, with the system validating current state and requiring Cluster-mode Proxy for status changes.

mcp/features/readwrite-splitting · high confidence

Add MCP support for readwrite-splitting rule and status workflows

The readwrite-splitting feature now exposes MCP capabilities for managing and inspecting readwrite-splitting rules and their status. Users can now plan rule configurations (including write/read storage units, query strategies, and load balancer settings) and plan status changes for specific storage units. Additionally, the feature provides resource handlers to list all rules, retrieve individual rule details, check overall status, and query load-balance algorithm plugins, all accessible via the defined resource URIs and tool names.

mcp/features/readwrite-splitting/src/main/java/org/apache/shardingsphere/mcp/feature/readwritesplitting · high confidence

Add MCP workflow support for encrypt rules

Users can now configure and manage encryption rules via the Model Context Protocol (MCP). This change introduces a new \encrypt\ feature that exposes encrypt algorithms and rules as MCP resources, provides completion suggestions for algorithm types, and enables workflow planning for encrypt rules through the \database\_gateway\_plan\_encrypt\_rule\ tool. The implementation includes handlers for listing algorithms and rules, a completion handler for algorithm suggestions, and a tool handler that plans encrypt rule workflows, supporting primary, assisted-query, and like-query algorithm roles with masked property previews.

mcp/features/encrypt/src/main/java/org/apache/shardingsphere/mcp/feature/encrypt · high confidence

Add MySQL binlog incremental ingestion support

The MySQL dialect module now includes comprehensive support for incremental data ingestion via MySQL binlog. This includes new classes for handling binlog events (such as row changes, queries, and transactions), managing binlog positions, and processing unsigned numeric types and binary strings from the binlog stream. Additionally, a database variable checker is provided to validate required MySQL server settings (like \LOG\_BIN\ and \BINLOG\_FORMAT\), and a JDBC query properties extension configures the MySQL connector with specific performance and compatibility settings.

kernel/data-pipeline/dialect/mysql · high confidence

Add MySQL-specific admin and query executors for the proxy backend

The MySQL dialect module now includes a comprehensive set of new executors to handle MySQL-specific administrative and system-level queries. This includes executors for managing system variables (MySQLSetVariableAdminExecutor), querying system variables (MySQLSystemVariableQueryExecutor), and handling database administration tasks such as killing processes (MySQLKillProcessCreator), switching databases (MySQLUseDatabaseExecutor), and managing charset variables. Additionally, the update provides specialized query result engines (MySQLDialectSaneQueryResultEngine) and admin executor creators (MySQLAdminExecutorCreator) that route and process MySQL-compatible commands like SHOW, SELECT on information\_schema, and connection/user metadata queries (ShowConnectionIdExecutor, ShowCurrentDatabaseExecutor, ShowCurrentUserExecutor, ShowVersionExecutor, NoResourceShowExecutor).

proxy/backend/dialect/mysql · high confidence

Add Narayana XA transaction manager provider and recovery helper

The Narayana XA transaction manager provider now includes a new \DataSourceXAResourceRecoveryHelper\ class and its corresponding unit tests, enabling automatic recovery of XA resources from the database during transaction recovery. The \NarayanaXATransactionManagerProvider\ registers and unregisters these recovery helpers with the Narayana transaction manager, and the service loader configuration ensures the provider is automatically discovered. This change adds the necessary components for XA transaction recovery support in the Narayana provider.

kernel/transaction/type/xa/provider/narayana · high confidence

Add OpenTelemetry tracing implementation for JDBC, SQL parsing, and root spans

The OpenTelemetry tracing plugin now provides concrete advice implementations for JDBC execution, SQL parsing, and root span creation. These new classes (OpenTelemetryJDBCExecutorCallbackAdvice, OpenTelemetrySQLParserEngineAdvice, and OpenTelemetryRootSpanAdvice) implement the core tracing logic, capturing span context, attributes (component, database type, host, port, SQL statement), and lifecycle events (success/error) using the OpenTelemetry API.

agent/plugins/tracing/type/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/advice · high confidence

Add Oracle SQL Federation connection configuration

Users can now configure SQL Federation for Oracle databases. This change introduces the Oracle-specific connection configuration builder, which sets the Calcite lexer to ORACLE, the SQL conformance to ORACLE\_12, and includes the Oracle SQL library. The implementation is registered via the Java SPI mechanism, enabling the system to correctly parse and validate Oracle SQL federation queries.

kernel/sql-federation/dialect/oracle · high confidence

Add Redis-based TSO provider for global clock

Users can now configure a Redis-based Time Service Oracle (TSO) provider for global clock functionality. This change introduces a new \RedisTSOProvider\ implementation that manages a Jedis connection pool and stores the current sequence number (CSN) in Redis. Configuration is handled via properties such as \host\, \port\, \password\, \timeoutInterval\, \maxIdle\, and \maxTotal\. The provider is registered via the \META-INF/services\ mechanism, enabling automatic discovery of the Redis TSO provider.

kernel/global-clock/type/tso/provider/redis, mode/type/standalone/repository/provider/jdbc · high confidence

Add RootSpanContext for managing root span state

A new RootSpanContext class has been added to the tracing core module. This class provides static methods to get and set the root span using a thread-local storage mechanism, enabling the tracing system to maintain the state of the root span across different execution contexts.

agent/plugins/tracing/core/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/core · high confidence

Add SQL Server binding support for the DENY USER statement

The SQL Server dialect now includes a dedicated bind engine and statement context provider for the DENY USER statement. This change introduces the SQLServerSQLBindEngine and SQLServerDenyUserStatementBinder, which handle the binding process for this specific SQL Server command, enabling the framework to correctly parse and bind this statement type for SQL Server databases.

infra/binder/dialect/sqlserver · high confidence

Add SQL Server dialect implementation for database connector

Introduces the SQL Server dialect implementation for the database connector, including the SQLServerDatabaseType, SQLServerConnectionPropertiesParser, SQLServerMetaDataLoader, SQLServerDatabaseMetaData, SQLServerSystemDatabase, and SQLServerFunctionOption classes, along with their corresponding ServiceLoader registration files. This enables ShardingSphere to connect to, parse connection strings for, and load metadata from SQL Server databases.

database/connector/dialect/sqlserver/src/main · high confidence

Add SQL Server support for SQL Federation connection configuration

Users can now use SQL Server as a target for SQL Federation. A new \SQLServerSQLFederationConnectionConfigBuilder\ has been added to configure Calcite connection properties specific to SQL Server, including Lex, Conformance (SQL Server 2008), and case sensitivity settings. This enables the SQL Federation feature to generate and execute queries against SQL Server databases with the correct dialect-specific configuration.

kernel/sql-federation/dialect/sqlserver · high confidence

Add SQL translator rule configuration and builder

Users can now configure the SQL translator rule via YAML, specifying the translator type, properties, and whether to use the original SQL when translation fails. The change introduces the SQLTranslatorRule, its configuration, builder, and YAML swapper, along with corresponding service registrations and tests.

kernel/sql-translator/core · high confidence

Add Seata AT integration for distributed transactions

The Seata AT integration module has been introduced to the codebase, providing a new \SeataATShardingSphereTransactionManager\ that implements the \ShardingSphereDistributedTransactionManager\ SPI. This addition enables support for Seata's Automatic Transaction (AT) mode, allowing users to manage distributed transactions across multiple microservices. The implementation includes a SQL execution hook to manage transaction contexts and XID propagation, along with the necessary exception classes and test fixtures to verify the integration.

kernel/transaction/type/base/seata-at · high confidence

Add ShowAuthorityRuleStatement for displaying authority rules

A new statement class, ShowAuthorityRuleStatement, has been added to the DistSQL statement package. This class extends ShowGlobalRulesStatement and enables users to query and display authority-related rules through the distributed SQL interface.

kernel/authority/distsql/statement · high confidence

Add SingleRuleConfiguration API for single-table rule setup

The SingleRuleConfiguration class has been added to the kernel/single/api module, providing a configuration object for single-table rules that holds a list of tables and a default data source. This change introduces the API contract for configuring single-table behavior, supported by new unit tests in SingleRuleConfigurationTest that verify default data source retrieval and logic table name extraction.

kernel/single/api · high confidence

Add Snowflake and UUID key generation algorithms

Users can now generate distributed primary keys using the Snowflake algorithm, which produces 64-bit unique IDs based on a UTC timestamp offset from November 1, 2016, or the UUID algorithm, which generates 32-character hexadecimal strings. The Snowflake implementation includes configurable vibration offsets and time-difference tolerances, while both algorithms are registered via SPI for immediate use.

infra/algorithm/type/key-generator/type/snowflake · high confidence

Add TSO provider interface for global clock

A new TSOProvider interface has been added to the global clock module, extending GlobalClockProvider to support Time Service Orchestration (TSO) as a global clock type.

kernel/global-clock/type/tso/spi · high confidence

Add URL-based configuration loading for etcd and ZooKeeper cluster modes

Users can now configure cluster mode using URL-style connection strings for both etcd and ZooKeeper. New ShardingSphereModeConfigurationURLLoader implementations for each technology parse server lists and required namespace properties to build the corresponding ClusterPersistRepositoryConfiguration. This enables declarative, URL-based setup of distributed cluster configurations without requiring explicit Java object instantiation.

infra/url/type/etcd, infra/url/type/zookeeper · high confidence

Add Weight-based Load Balancing Algorithm

A new weight-based load balancing algorithm is now available for routing traffic to database nodes with different capacities. The \WeightLoadBalanceAlgorithm\ allows users to assign specific weights to each target, enabling more granular control over traffic distribution compared to default strategies. The implementation includes initialization, validation, and selection logic, supported by corresponding unit tests.

infra/algorithm/type/load-balancer/type/weight · high confidence

Add YAML configuration entities for agent plugins

The agent core now supports YAML-based configuration for plugins. New entity classes have been introduced to map YAML settings for plugin categories (logging, metrics, and tracing) and individual plugin properties (host, port, password, and generic properties). This enables users to configure agent plugins via YAML files.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/yaml/entity · high confidence

Add ZooKeeper cluster repository implementation

Introduces a new ZooKeeper-based implementation of the cluster persist repository, including the main \ZookeeperRepository\ class, a \ZookeeperExceptionHandler\ for error management, a \SessionConnectionReconnectListener\ to handle session loss and reconnection, and a \ZookeeperDistributedLock\ for distributed locking. The change also adds configuration properties for retry intervals, timeouts, and authorization, along with corresponding unit tests for all components.

(repo-wide) · high confidence

Add absolute path and classpath URL loaders for configuration files

Users can now load configuration files using absolute file paths or from the classpath. This change introduces two new URL loaders: \AbsolutePathLocalFileURLLoader\ for reading configuration files from the local filesystem using absolute paths, and \ClassPathLocalFileURLLoader\ for reading configuration files from the classpath. Both implementations provide a \load\ method to read and return the content of the specified configuration files, enabling more flexible configuration sourcing in ShardingSphere.

infra/url/type/absolutepath, infra/url/type/classpath · high confidence

Add authority DistSQL parser for SHOW AUTHORITY RULE

The DistSQL parser now supports the \SHOW AUTHORITY RULE\ command. This change introduces a new parser implementation (\AuthorityDistSQLParserFacade\) that handles the \showAuthorityRule\ grammar rule, allowing the system to parse and process authority-related SQL statements.

kernel/authority/distsql/parser · high confidence

Add broadcast rule workflow and resource handlers

The broadcast feature now exposes a complete workflow for managing broadcast rules. Users can plan create or drop operations for broadcast rules via the \database\_gateway\_plan\_broadcast\_rule\ tool, which accepts target tables and generates DistSQL artifacts. Additionally, new resource handlers allow querying all broadcast rules, specific table rules, and the total count of broadcast rules for a given database.

mcp/features/broadcast/src/main/java/org/apache/shardingsphere/mcp/feature/broadcast · high confidence

Add consistency check job scenario

The data pipeline now includes a new consistency check job scenario, enabling users to verify data consistency between source and target databases. This feature introduces a new \ConsistencyCheckJob\ and related components (API, configuration, tasks runner, and metadata processor) to support running and managing consistency checks as part of the pipeline workflow.

kernel/data-pipeline/scenario/consistency-check · high confidence

Add database and system timestamp services

Added the DatabaseTimestampService, which retrieves timestamps by executing database-specific SQL queries (e.g., \SELECT NOW()\ for MySQL/PostgreSQL, \SELECT sysdate FROM DUAL\ for Oracle, and \SELECT GETDATE()\ for SQLServer), alongside a new SystemTimestampService that provides timestamps using the system clock. This introduces a new mechanism for time synchronization that can be selected via the \TimestampService\ SPI, with corresponding test coverage for all implementations.

kernel/time-service/type/database · high confidence

Add database-level privilege provider for user-database mappings

A new \DatabasePermittedPrivilegeProvider\ implementation is introduced to manage database-level access control. It parses a \user-database-mappings\ configuration (format: \username@hostname=database\) and grants access to specified databases for each user. The provider supports wildcard database access and is registered via the SPI mechanism, with corresponding unit tests validating the privilege resolution logic.

kernel/authority/provider/database · high confidence

Add global clock rule for distributed transaction timestamp coordination

Introduces a new GlobalClockRule that enables global clock-based transaction coordination. The implementation includes a transaction hook that injects snapshot and commit timestamps into database connections, with a default provider for openGauss that executes SQL statements to set the global timestamp. Configuration is managed via YAML and Java properties, and the rule is registered as a global rule builder and transaction hook via service loader files.

kernel/global-clock/core · high confidence

Add in-memory repository for standalone mode

Users can now use an in-memory repository implementation for standalone mode, which stores metadata in a TreeMap for fast, non-persistent operations. This new component, registered via the StandalonePersistRepository service provider interface, provides a lightweight alternative to file-based or database-backed repositories, suitable for testing or scenarios where persistence is not required.

mode/type/standalone/repository/provider/memory · high confidence

Add literal inline expression parser

The system now supports parsing literal inline expressions, which are comma-separated lists of values. This new \LiteralInlineExpressionParser\ implementation handles splitting and evaluating these expressions, with corresponding SPI service registration and unit tests.

infra/expr/type/literal · high confidence

Add openGauss SQL binding and projection extraction support

Introduces new openGauss-specific components for SQL binding and projection identifier extraction, including OpenGaussSQLBindEngine, OpenGaussProjectionIdentifierExtractor, and OpenGaussSQLStatementContextWarpProvider. These classes delegate to their PostgreSQL counterparts to provide openGauss dialect support within the binder infrastructure.

infra/binder/dialect/opengauss · high confidence

Add openGauss dialect support

The connector now supports the openGauss database. This includes a new \OpenGaussDatabaseType\ for JDBC URL prefix recognition, a \DialectDatabasePrivilegeChecker\ to validate user permissions, a \ConnectionPropertiesParser\ for JDBC URL parsing, and a \DialectMetaDataLoader\ to load schema and table metadata. The \OpenGaussDatabaseMetaData\ defines dialect-specific behaviors such as lowercase identifier patterns, quote characters, and transaction options. Additionally, \OpenGaussSystemDatabase\ and \OpenGaussKernelSupportedSystemTable\ define system databases and kernel-supported system tables, while \OpenGaussIdentifierCasePolicyProvider\ and \OpenGaussResultSetMapper\ handle case sensitivity and result set mapping. Service provider files are added to register these implementations.

(repo-wide) · high confidence

Add openGauss frontend engine and authentication support

The proxy now supports the openGauss database protocol. This change introduces the \OpenGaussFrontendEngine\ and its associated components, including an authentication engine that supports MD5 and SCRAM-SHA-256 password authentication methods. The implementation includes command execution engines for handling queries and batch binds, as well as error packet factories, enabling the proxy to communicate with openGauss-compatible clients.

proxy/frontend/dialect/opengauss · high confidence

Add openGauss support for data pipeline incremental ingestion

Added openGauss dialect support for the data pipeline, enabling incremental data ingestion via logical replication. This includes implementations for the incremental dumper, WAL decoding, position management, and SQL building, allowing users to replicate data from openGauss databases.

kernel/data-pipeline/dialect/opengauss · high confidence

Add round-robin and random load balancing algorithms

Users can now choose between round-robin and random load balancing strategies for distributing requests across available targets. The round-robin algorithm cycles through targets in order, while the random algorithm selects targets randomly. Both implementations are provided as new submodules with corresponding SPI service registrations and unit tests.

infra/algorithm/type/load-balancer/type/round-robin · high confidence

Add sharding feature support to the MCP interface

The Sharding feature is now exposed through the Model Context Protocol (MCP) interface, enabling AI-driven planning and inspection of sharding configurations. This change introduces a new \ShardingFeatureDefinition\ class that defines the workflow kinds and resource URIs for sharding rules, strategies, and key generators. It also registers a \ShardingMCPHandlerProvider\ that exposes resource handlers for algorithms, table rules, and governance components, along with tool handlers for planning and cleanup workflows. Additionally, a completion handler is provided to assist with sharding algorithm and key generator type suggestions.

mcp/features/shadow/src/main/java/org/apache/shardingsphere/mcp/feature/shadow, mcp/features/sharding/src/main/java/org/apache/shardingsphere/mcp/feature/sharding · high confidence

Add smart ANTLR4 rebuild script

A new shell script, smart-antlr-rebuild.sh, has been added to the scripts directory. This tool automates the process of recompiling ANTLR4 modules by tracking the last known good commit state per branch, allowing for smart, incremental rebuilds rather than full re-compilation every time.

scripts · high confidence

Added DialectSQLBatchOption to configure SQL batch support

A new DialectSQLBatchOption class has been introduced in the database connector module. This class exposes a 'supportSQLBatch' boolean flag, allowing the system to determine whether a specific database dialect supports batch SQL operations.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/sqlbatch · high confidence

Added DistSQL handler for SHOW AUTHORITY RULE

Users can now execute the DISTSQL command SHOW AUTHORITY RULE to retrieve the current authority configuration, including the list of grantees, the privilege provider type, and associated properties. This change introduces the ShowAuthorityRuleExecutor and its corresponding test cases, enabling visibility into the system's authority rules via DistSQL.

kernel/authority/distsql/handler · high confidence

Added DistSQL parser for global clock rule management

The distsql/parser module now includes a complete parser for the global clock feature, enabling users to execute \SHOW GLOBAL CLOCK RULE\ and \ALTER GLOBAL CLOCK RULE\ commands. This change introduces the necessary ANTLR grammar files (Alphabet, BaseRule, Keyword, Literals, RALStatement, Symbol, and GlobalClockDistSQLStatement) and the corresponding Java implementation classes (GlobalClockDistSQLLexer, GlobalClockDistSQLParser, GlobalClockDistSQLStatementVisitor, and GlobalClockDistSQLParserFacade) to parse and process these new DistSQL statements.

kernel/global-clock/distsql/parser, kernel/transaction/distsql/parser · high confidence

Added Firebird protocol handshake packet implementations

Added new Java classes for the Firebird database protocol dialect, including packet handlers for connection, attachment, and authentication handshakes. Specifically, the update introduces \FirebirdConnectPacket\, \FirebirdAttachPacket\, \FirebirdAcceptPacket\, \FirebirdAcceptDataPacket\, and \FirebirdSRPAuthenticationData\ to support the initial network negotiation and SRP-based authentication flow for Firebird connections.

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet/handshake · high confidence

Added HistogramBucketUtils utility for metric bucket configuration

A new utility class, HistogramBucketUtils, has been added to the metrics core plugin. It provides a static method to return a map defining histogram bucket parameters (exponential type, start value, factor, and count), which can be used to configure metric collection behavior.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/util · high confidence

Added InlineExpressionParserFactory and test fixtures for expression parsing

Introduced the InlineExpressionParserFactory in the infra/expr/entry module, which creates InlineExpressionParser instances based on inline expressions, supporting type selection (GROOVY, LITERAL, or custom types via angle-bracket syntax) and handling null or malformed inputs. Added corresponding unit tests and a custom fixture implementation (CustomInlineExpressionParserFixture) to verify parsing behavior, including edge cases and fixture-based evaluation.

infra/expr/entry · medium confidence

Added MCP descriptors and prompts for encrypt feature workflow planning

The encrypt feature now exposes MCP resources and prompts to guide the model in planning encrypt rule workflows. A new service provider file registers the \EncryptMCPHandlerProvider\, while the \mcp-descriptor-encrypt.yaml\ defines resources for listing encrypt algorithms and rules, and a \plan\_encrypt\_rule\ prompt that instructs the model to gather context (database, table, column, algorithm types) before calling the \database\_gateway\_plan\_encrypt\_rule\ tool. This enables automated, reviewable planning of ShardingSphere encrypt rule DistSQL artifacts.

mcp/features/encrypt · high confidence

Added MetaDataContextsFactoryAdvice to log metadata context build duration

A new advice class, MetaDataContextsFactoryAdvice, was added to the file logging plugin. This class instruments the metadata context factory to log the time taken to build metadata contexts, providing visibility into the performance of that specific operation.

agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/advice · high confidence

Added MetricsExporter interface for plugin metrics

A new MetricsExporter interface has been introduced in the metrics core plugin, defining an export method that accepts a plugin type and returns an optional GaugeMetricFamilyMetricsCollector. This change establishes the contract for exporting gauge metrics from plugins.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter · medium confidence

Added PostgreSQL incremental data ingestion via logical replication

Users can now perform incremental data ingestion from PostgreSQL using logical replication. This change introduces a new PostgreSQL-specific implementation of the incremental dumper, which connects to the database, opens a replication stream, and decodes Write-Ahead Log (WAL) events (such as inserts, updates, and deletes) into pipeline records. The implementation includes components for managing replication state, converting WAL events to data records, and handling transaction boundaries, enabling real-time or near-real-time data synchronization from PostgreSQL sources.

kernel/data-pipeline/dialect/postgresql · high confidence

Added PostgreSQL-specific exception handling and mapping

The PostgreSQL dialect module now includes a complete set of exception classes (such as PostgreSQLException, EmptyUsernameException, InvalidPasswordException, PrivilegeNotGrantedException, UnknownUsernameException, and ProtocolViolationException) along with a PostgreSQLDialectExceptionMapper that maps internal ShardingSphere exceptions to specific PostgreSQL error codes and messages. This enables more accurate error reporting and debugging for PostgreSQL users.

database/exception/dialect/postgresql/src/main · high confidence

Added Prometheus metrics exporter

A new PrometheusMetricsExporter class has been introduced to handle the export of metrics in Prometheus format. This addition enables the system to expose metrics via Prometheus-compatible endpoints, allowing for better observability and monitoring using Prometheus-based tooling.

agent/plugins/metrics/type/prometheus/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/prometheus/exoprter · high confidence

Added SPI interface and mapper for load balance algorithms

Introduced the \LoadBalanceAlgorithm\ interface and its corresponding \LoadBalanceAlgorithmTypeAndClassMapper\ in the \infra/algorithm/type/load-balancer/spi\ module. This establishes the Service Provider Interface (SPI) contract for load balancing algorithms, enabling the framework to discover and instantiate them via the typed SPI loader. A corresponding test ensures the mapper correctly resolves the \LoadBalanceAlgorithm\ class for the \LOAD\_BALANCE\_ALGORITHM\ type.

infra/algorithm/type/load-balancer/spi · high confidence

Added SQL Server statement models for DCL, DDL, and statistics operations

The SQL Server dialect parser now includes new statement model classes to support additional SQL Server-specific operations. This includes DCL statements for managing logins (Create, Alter, Drop), user permissions (Grant, Revoke, Deny), and the Revert command. It also adds DDL statements for managing services (Create, Alter, Drop) and updating table statistics. These new classes provide the structural representation for these SQL Server commands within the parser.

parser/sql/statement/dialect/sqlserver · high confidence

Added initial Hive SQL parser implementation

Introduced a new Hive SQL dialect within the SQL parser engine, providing the foundational grammar rules, lexer, and visitor components required to parse and analyze Hive-specific SQL statements. This addition enables the system to recognize and process Hive syntax, including data definition, manipulation, and administrative commands, effectively extending the parser's capabilities to support the Hive database type.

parser/sql/engine/dialect/hive · high confidence

Added schema table metadata aggregation and validation

A new \SchemaTableMetaDataAggregator\ and \TableMetaDataViolation\ class have been introduced in the \database/connector/core\ module. The aggregator collects table metadata from multiple sources and, when enabled, validates that all actual tables associated with a logical table share identical metadata. If inconsistencies are detected, the system throws a \RuleAndStorageMetaDataMismatchedException\, providing detailed information about the mismatched tables and their metadata to aid in debugging configuration errors.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/data/revise · high confidence

Doris database type registration and implementation

The Doris database type has been added to the connector dialect module, including the \DorisDatabaseType\ class and its SPI service registration, enabling the system to recognize and route connections using \jdbc:mysql:\ and \jdbc:mysqlx:\ prefixes to the Doris implementation, which maps to the MySQL trunk type. A corresponding unit test has been added to verify the JDBC URL prefixes and trunk type mapping.

database/connector/dialect/doris · high confidence

Expanded Oracle SQL parser support for DDL and system statements

The Oracle dialect parser now recognizes a broad set of new SQL statement types, including DDL operations such as alter and create for clusters, contexts, database links, pluggable databases, and various object types, alongside system and administrative commands like audit, analyze, purge, rename, and switch. This addition enables the parser to correctly identify and process these specific Oracle database management and schema definition commands.

parser/sql/statement/dialect/oracle · high confidence

Expanded Oracle SQL parser support for advanced SQL features

The Oracle SQL parser now supports a broader range of Oracle-specific SQL syntax, including CREATE and DROP for database objects, procedures, and functions, as well as advanced query features like PIVOT, SAMPLE clauses, hierarchical queries, and XML functions. This update enables the parser to correctly interpret and bind these complex Oracle SQL statements.

parser/sql/engine/dialect/oracle · high confidence

Expanded SQL parsing support for Apache Doris

The Apache Doris SQL parser has been significantly expanded to support a wide range of new SQL syntaxes, including DDL, DML, and administrative commands. This update enables the parsing of statements such as ALTER/PAUSE/RESume/STOP for jobs, routines, and sync jobs; various SHOW commands (e.g., for databases, tables, resources, and load warnings); and data management commands like BACKUP, CANCEL, and CLEAN. Additionally, the parser now handles complex table operations including ROLLUP, RENAME, and DISTRIBUTED BY clauses, as well as routine load and streaming job management.

parser/sql/engine/dialect/doris · high confidence

Expanded support for Apache Doris SQL syntax

The Apache Doris dialect parser now supports a wide range of new SQL statements, including administrative commands (ADMIN CLEAN/SET/ALTER/DROP), backup and restore operations (BACKUP, CANCEL), job management (CREATE/PAUSE/RESUME/STOP/SHOW/DESC for SYNC, ROUTINE, and STREAMING JOBS), and various SHOW commands (for DATA, FUNCTIONS, CATALOG, ENCRYPTKEY, FILE, LOAD, and more). This update enables the parser to correctly interpret and process these specific Doris-specific SQL constructs.

parser/sql/statement/dialect/doris · high confidence

HikariCP data source pool implementation added

Added the HikariCP implementation for the data source pool infrastructure, including metadata, property validation, and active connection detection. This introduces default configuration values (e.g., 30s connection timeout, 50 max pool size), validates property constraints (e.g., minimum timeout values), and registers the HikariCP-specific components via SPI service files.

infra/data-source-pool/type/hikari · high confidence

Initial repository configuration and development guidelines

The repository is initialized with essential configuration files: \.asf.yaml\ for Apache Software Foundation governance, \.codecov.yml\ for code coverage reporting, \.dockerignore\ for Docker build context, \.gitattributes\ for line ending and binary file handling, \.licenserc.yaml\ for license header enforcement, and \AGENTS.md\ providing development and AI agent guidelines.

(repo-wide) · high confidence

Introduce AGENTS policy harness for automated behavioral enforcement

Added a new policy harness in .codex/harness/agents that defines a catalog of behavioral cases (cases.toml) and a Python runner (run.py) to enforce constraints on agent actions. The harness specifies allowed, required, and forbidden actions (such as edit\_code, mutate\_git, mutate\_remote) for various scenarios like read-only reviews, local code changes, and remote updates, ensuring agents adhere to specific operational policies.

.codex/harness · high confidence

Introduce AdviceExecutor and factory for agent advice interception

Added the AdviceExecutor interface and AdviceExecutorFactory to the agent core module. The factory locates and instantiates specific advice executors (Constructor, Static, and Instance method variants) based on method signatures and configuration, enabling the agent to intercept and modify bytecode via ByteBuddy. This introduces a new mechanism for applying advice to target classes during runtime instrumentation.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/advisor/executor · high confidence

Introduce AgentPluginClassLoader for isolated plugin loading

The agent core module now includes a new classloader implementation, AgentPluginClassLoader, which loads classes from a collection of extra JAR files. This classloader is managed via a ClassLoaderContext that caches and reuses classloader instances per application classloader, enabling isolated loading of plugin classes without affecting the main application classpath.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/classloader · high confidence

Introduce AgentServiceLoader for SPI-based service discovery

A new AgentServiceLoader class has been added to the agent core module. This component provides a singleton-based mechanism to load and cache ServiceLoader instances for specific service interfaces, enabling the agent to discover and manage SPI (Service Provider Interface) implementations more efficiently.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/spi · high confidence

Introduce CDC job implementation and configuration model

Added the core implementation for Change Data Capture (CDC) jobs, including the \CDCJob\ class that orchestrates job execution, along with supporting classes such as \CDCJobId\, \CDCJobType\, and \CDCJobAPI\ for job creation and management. The change also introduces the \CDCJobConfiguration\ and \CDCTaskConfiguration\ models to define job and task settings, alongside YAML configuration classes (\YamlCDCJobConfiguration\, \YamlCDCJobConfigurationSwapper\) to enable YAML-based job configuration. Additionally, context and acknowledgment classes like \CDCConnectionContext\, \CDCJobItemContext\, \CDCAckId\, and \CDCAckPosition\ are added to manage connection state, job item state, and change tracking.

kernel/data-pipeline/scenario/cdc/core · high confidence

Introduce CDC server and frontend proxy infrastructure

Added a new CDC (Change Data Capture) server implementation (CDCServer) and its associated Netty channel handlers (CDCChannelInboundHandler, CDCServerHandlerInitializer) to handle CDC-specific protocol requests such as login, streaming, and acking. The ShardingSphereProxy was updated to support Unix domain sockets via Epoll's DomainSocketChannel, and a new CommandExecutorTask was introduced to manage command execution with improved logging (MDC) and exception handling. Additionally, connection management was enhanced with a ConnectionIdGenerator and a ConnectionLimitContext to track and limit active frontend connections, while a ConnectionThreadExecutorGroup was added to manage per-connection thread pools for XA transaction processing.

proxy/frontend/core · high confidence

Introduce DialectDatabaseMetaData interface and option classes for database-specific metadata

Added a new \DialectDatabaseMetaData\ interface and an \AbstractDelegatingDialectDatabaseMetaData\ implementation to centralize database dialect metadata. This includes new option classes for SQL, index, and protocol version, enabling the connector to expose database-specific capabilities such as whole-row projection support, index name length limits, and default protocol versions.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata · high confidence

Introduce DialectFunctionOption interface and DefaultFunctionOption implementation

The database connector module now includes a new \DialectFunctionOption\ interface and its \DefaultFunctionOption\ implementation within the metadata option package. This change introduces a mechanism to specify unparenthesized function names, with the default implementation returning an empty set. This structural addition supports dialect-specific function handling in the database connector.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/function · high confidence

Introduce Firebird protocol exception and packet classes

Added Firebird-specific implementations for database protocol handling: a new FirebirdProtocolException class for error handling and an abstract FirebirdPacket class that implements the DatabasePacket interface to manage packet serialization via FirebirdPacketPayload.

database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/exception, database/protocol/dialect/firebird/src/main/java/org/apache/shardingsphere/database/protocol/firebird/packet · high confidence

Introduce KernelProcessor for SQL execution context generation

A new KernelProcessor class has been added to the infra/context module to handle the generation of execution contexts for SQL statements. This processor orchestrates the flow of validating SQL support, routing, and rewriting, while also handling unsupported operations like temporary table DDLs. A corresponding test class, KernelProcessorTest, has been added to verify this new behavior.

infra/context · high confidence

Introduce KeyGenerateAlgorithm SPI and its type/class mapper

Added the \KeyGenerateAlgorithm\ interface and its corresponding \KeyGenerateAlgorithmTypeAndClassMapper\ implementation, enabling the framework to discover and load key generation algorithms via the SPI mechanism. A service provider configuration file was also added to register the mapper, and a corresponding unit test was included to verify the SPI loading behavior.

infra/algorithm/type/key-generator/spi · high confidence

Introduce MCP API interfaces and models for capabilities, exceptions, and payloads

The MCP API module now provides the foundational interfaces and data models for handling MCP capabilities, including completion, prompts, resources, and tools. This includes new interfaces like MCPHandlerProvider, MCPRequestContext, and specific handlers for resources, tools, and completions, alongside supporting classes such as MCPSessionIdentity, MCPTransportType, and various exception types. These changes establish the core contract for implementing and invoking MCP capabilities within the ShardingSphere runtime.

mcp/api · high confidence

Introduce MCP core completion and runtime context infrastructure

Adds the foundational implementation for MCP capabilities, including a new MCPCompletionService that orchestrates auto-completion for arguments and workflow plan IDs, backed by dedicated completion handlers (MetadataCompletionHandler, WorkflowPlanIdCompletionHandler) and a per-session rate limiter. The change also introduces the MCPFeatureRuntimeRequestContext and MCPRuntimeContext to manage session state, database capabilities, and workflow session data, while registering core resource handlers for database, schema, and metadata metadata. This provides the core engine for argument completion and runtime context management in the MCP module.

mcp/core · high confidence

Introduce MCP database capability and configuration validation support

Added a new MCP support module that introduces a capability-based model for database interactions. This includes a configuration validator to enforce validation rules on MCP configurations, and a database capability system that defines supported metadata object types (such as SCHEMA, TABLE, VIEW, COLUMN, INDEX, SEQUENCE) and statement types (such as QUERY, DML, DDL, TRANSACTION\_CONTROL, and EXPLAIN). The implementation provides a provider mechanism to load and manage capabilities for specific database types (e.g., MySQL, PostgreSQL, Oracle, ClickHouse), allowing the system to determine supported features like EXPLAIN execution and sequence metadata queries per database dialect.

mcp/support · high confidence

Introduce MCP-based mask feature for automated rule planning and validation

Added a new Mask feature within the MCP (Model Context Protocol) integration, providing automated planning, validation, and inspection for data masking rules. This includes a workflow planning service that generates DistSQL artifacts for creating or dropping mask rules, a recommendation service that suggests appropriate masking algorithms, and resource handlers that expose available mask algorithms and existing rules. The feature also provides completion handlers for algorithm types and tool handlers for executing the mask workflow, enabling users to manage data masking configurations through the MCP interface.

mcp/features/mask/src/main/java/org/apache/shardingsphere/mcp/feature/mask · high confidence

Introduce OpenTelemetry constants for tracing

A new constants class, OpenTelemetryConstants, has been added to the OpenTelemetry tracing plugin. This change defines the tracer name as 'shardingsphere-agent', which will be used to identify the agent in distributed traces.

agent/plugins/tracing/type/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/constant · high confidence

Introduce OpenTelemetry tracing plugin lifecycle service

The OpenTelemetry tracing plugin now includes a dedicated lifecycle service (OpenTelemetryTracingPluginLifecycleService) that initializes the OpenTelemetry SDK and configures system properties from the plugin's configuration. This change ensures that the tracing plugin is properly initialized and configured when the agent starts, providing a more robust and explicit lifecycle management for the OpenTelemetry integration.

agent/plugins/tracing/type/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry · medium confidence

Introduce PluginLifecycleServiceManager for plugin lifecycle management

A new PluginLifecycleServiceManager class has been added to the agent core plugin package. This manager handles the initialization and shutdown of plugin lifecycle services, including starting plugins via the AgentServiceLoader and registering a shutdown hook to close plugin JAR files and services gracefully.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin · high confidence

Introduce Prometheus metrics collectors for counters, gauges, histograms, summaries, and gauge metric families

Added new collector implementations for Prometheus metrics, including PrometheusMetricsCollectorFactory, PrometheusMetricsCounterCollector, PrometheusMetricsGaugeCollector, PrometheusMetricsGaugeMetricFamilyCollector, PrometheusMetricsHistogramCollector, and PrometheusMetricsSummaryCollector. These classes implement the core metric types (counter, gauge, histogram, summary, and gauge metric family) to support Prometheus-style metrics collection within the ShardingSphere agent.

agent/plugins/metrics/type/prometheus/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/prometheus/collector · high confidence

Introduce SPI-based system database and table metadata access

Added new classes in the database connector core to manage system database and table metadata via a Service Provider Interface (SPI) pattern. The change introduces \DialectSystemDatabase\ and \DialectKernelSupportedSystemTable\ interfaces, along with concrete \SystemDatabase\ and \SystemTable\ classes that delegate to these SPIs. This allows the system to dynamically discover and retrieve information about system databases, schemas, and tables for different database types, replacing previous hardcoded or non-extensible approaches.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/system · high confidence

Introduce SQL Federation engine with configurable caching and execution plan processing

The SQL Federation module now includes a new \SQLFederationEngine\ that manages the decision to use SQL federation for queries, utilizing a new \SQLFederationCacheOption\ to configure an execution plan cache with \initialCapacity\ and \maximumSize\ parameters. The engine delegates processing to a \SQLFederationProcessor\ (specifically \StandardSQLFederationProcessor\) which handles the preparation, execution, and release of SQL federation operations, returning results via a new \SQLFederationResultSet\ that supports forward-only iteration and standard JDBC metadata access while explicitly throwing \SQLFeatureNotSupportedException\ for unsupported cursor and update operations.

kernel/sql-federation/core · high confidence

Introduce SQLFederationCompilerEngine to centralize SQL statement compilation

The SQL federation compiler module now introduces a new \SQLFederationCompilerEngine\ that acts as the primary entry point for compiling SQL statements into execution plans. This engine delegates to a newly created \SQLStatementCompilerEngine\ and \SQLStatementCompiler\, which handle the conversion of SQL nodes to relational nodes, logical plan rewriting, and physical plan optimization. The change also adds supporting classes such as \CompilerContext\ and \CompilerContextFactory\ to manage the state required for compilation, including connection configurations and schema metadata. This refactors the compilation process into a more modular and cacheable structure, improving maintainability and enabling better integration with the existing SQL federation execution pipeline.

kernel/sql-federation/compiler · high confidence

Introduce SingleXAResource and XATransactionManagerProvider for XA transaction management

Added SingleXAResource, a wrapper for javax.transaction.xa.XAResource that delegates all XA operations to an underlying resource, and XATransactionManagerProvider, an SPI interface for managing XA transaction managers and recovery resources. The SingleXAResource class provides a consistent way to handle XA exceptions by mapping them, and the new provider interface supports registering, removing, and enlisting XA resources. A corresponding unit test class SingleXAResourceTest was added to verify the delegation behavior of the SingleXAResource implementation.

kernel/transaction/type/xa/spi · high confidence

Introduce TimestampService API and configuration

Added the TimestampService SPI interface and TimestampServiceRuleConfiguration class to the time-service API module. This introduces the core interface for timestamp generation and its associated configuration, enabling users to configure and interact with the timestamp service through the standard SPI mechanism.

kernel/time-service/api · high confidence

Introduce TimestampServiceRule and associated builders

The time-service module now includes the core implementation for the timestamp service rule, including the \TimestampServiceRule\ class, its configuration, and the \TimestampServiceRuleBuilder\ responsible for constructing it. The change also registers these components via SPI service files, enabling the system to discover and build the timestamp service rule during runtime.

kernel/time-service/core · high confidence

Introduce XA transaction support for multiple databases

Added XA transaction support for PostgreSQL, Oracle, MySQL, MariaDB, H2, Firebird, and openGauss. The change introduces the \XAShardingSphereTransactionManager\ and associated connection wrappers to enable distributed XA transactions across these database types.

kernel/transaction/type/xa/core · high confidence

Introduce YamlPluginConfigurationLoader for plugin configuration loading

A new YamlPluginConfigurationLoader class has been added to the agent core, providing a dedicated mechanism to load plugin configurations from YAML files. This change introduces a new component in the agent's configuration loading pipeline, enabling the system to parse and load YamlAgentConfiguration objects from specified YAML files.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/yaml/loader · high confidence

Introduce core agent plugin infrastructure and data source advice

Added new core agent plugin components including abstract method advice classes, a ShardingSphere data source advisor, and a plugin context manager to handle plugin enablement and context management. The update also introduces a plugin service loader using Java SPI, a method time recorder for performance tracking, and utility classes for SQL statement classification and reflection, enabling the agent to intercept and manage data source lifecycle events.

agent/plugins/core/src/main · high confidence

Introduce core database exception types and transformation engine

The \database/exception/core\ module now provides a centralized set of SQL dialect exception classes (such as \SQLDialectException\, \DatabaseProtocolException\, and specific error types like \ColumnNotFoundException\ or \TooManyConnectionsException\) along with a \SQLExceptionTransformEngine\ that converts internal framework exceptions into standard \java.sql.SQLException\ instances, enabling consistent error handling across different database dialects.

database/exception/core · high confidence

Introduce core database protocol abstractions and packet codec

Added new core classes for the database protocol layer, including the \PacketCodec\ Netty codec, the \DatabasePacketCodecEngine\ interface, and packet/parameter interfaces (\DatabasePacket\, \CommandPacket\, \SQLReceivedPacket\, \TypeUnspecifiedSQLParameter\). The change also introduces supporting types such as \BinaryCell\, \BinaryRow\, \CommonConstants\, and \DatabaseProtocolServerInfo\ to manage protocol versions and server information. Tests are provided for the codec and server info logic.

database/protocol/core · high confidence

Introduce core expression parsing infrastructure

Added the \InlineExpressionParser\ SPI interface and the \GroovyUtils\ utility class to the \shardingsphere-infra-expr-core\ module. The new \InlineExpressionParser\ interface defines the contract for splitting and evaluating inline expressions, while \GroovyUtils\ provides the underlying logic to split GroovyShell expressions. These changes support the existing \HintInlineShardingAlgorithm\, \ComplexInlineShardingAlgorithm\, and \InlineShardingAlgorithm\ classes with the ability to convert and evaluate original expressions. A corresponding test class \GroovyUtilsTest\ was added to verify the splitting logic.

infra/expr/core · high confidence

Introduce data masking feature with configurable algorithms and rule configuration

Users can now configure data masking rules to protect sensitive information in query results. This change introduces a new \MaskRuleConfiguration\ that allows defining which tables and columns to mask, along with a set of built-in masking algorithms such as \KEEP\_FIRST\_N\_LAST\_M\, \MASK\_FIRST\_N\_LAST\_M\, \MASK\_FROM\_X\_TO\_Y\, \MASK\_AFTER\_SPECIAL\_CHARS\, \MASK\_BEFORE\_SPECIAL\_CHARS\, \MD5\, and \GENERIC\_TABLE\_RANDOM\_REPLACE\. The system validates the configuration via \MaskRuleConfigurationChecker\ and applies the masking logic through a \MaskResultDecoratorEngine\ that decorates DQL results, ensuring that specified columns are transformed according to the chosen algorithm.

features/mask · high confidence

Introduce default distributed lock implementation for cluster mode

Added the \DistributedLockHolder\ and \DefaultDistributedLock\ classes in the \mode/type/cluster/repository/core\ module to provide a default distributed lock mechanism for cluster mode. This includes the core lock implementation, associated property classes, and corresponding unit tests.

mode/type/cluster/repository/core · high confidence

Introduce exclusive operation mechanism for cluster coordination

Added an exclusive operation mechanism in the mode-core module to manage cluster-wide coordination. This includes new classes for handling exclusive locks, managing exclusive operations, and providing callback interfaces for safe execution of critical sections. This change improves cluster state management and ensures thread-safe access to shared resources.

mode/core · high confidence

Introduce gen-ut skill for automated unit test generation

Added the gen-ut skill, which provides automated unit test generation for Apache ShardingSphere classes. The skill enforces strict quality gates, including 100% coverage targets, parameterized test optimization, and specific assertion styles. It includes a detailed SKILL.md defining rules for test structure, coverage, and optimization, along with Python scripts to collect quality baselines, run parallel quality gates, scan for rule violations, and manage verification state.

.codex/skills/gen-ut · high confidence

Introduce metric configuration model for agent metrics

Users can now define metrics using a structured configuration model. The diff introduces a new \MetricCollectorType\ enum defining supported metric types (COUNTER, GAUGE, HISTOGRAM, SUMMARY, GAUGE\_METRIC\_FAMILY) and a \MetricConfiguration\ class that serves as the data model for metric definitions, including properties like id, type, help text, labels, and custom props.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/config · high confidence

Introduce modular DistSQL parser engine with grammar definitions and visitor implementations

The DistSQL parser has been restructured into a modular architecture, introducing separate parser engines for 'kernel' and 'utility' DistSQL commands. This change adds ANTLR4 grammar files (Alphabet, BaseRule, Keyword, Literals, RALStatement, RDLStatement, RQLStatement, RULKeyword, RULStatement, Symbol) and corresponding Java classes (e.g., DistSQLParserEngine, KernelDistSQLStatementParserEngine, UtilityDistSQLStatementParserEngine) to handle parsing. This separation allows for better organization and potential future extensibility of the DistSQL command set.

parser/distsql/engine · high confidence

Introduce new MergeEngine and result processing architecture

The infra/merge module now includes a new MergeEngine that orchestrates the merging and decorating of query results. This change introduces a structured engine-based approach with dedicated interfaces for result processing, merging, and decoration, alongside new result implementations like LocalDataMergedResult, MemoryMergedResult, and StreamMergedResult to handle different data sources. The update also adds comprehensive unit tests for the MergeEngine and its components.

infra/merge · high confidence

Introduce new NodePath abstraction and engine for managing node paths

The mode/node module introduces a new \NodePath\ interface and a corresponding \NodePathEntity\ annotation to declaratively define node path templates. This is supported by a new \NodePathGenerator\ that converts annotated classes into string paths, and a \NodePathSearcher\ with \NodePathSearchCriteria\ for pattern matching and extraction. Specific path types such as \DatabaseMetaDataNodePath\, \StorageNodeNodePath\, \StatisticsDataNodePath\, and \ExclusiveOperationNodePath\ are added to represent various internal state structures, replacing the previous ad-hoc string handling with a structured, searchable path model.

mode/node · high confidence

Introduce new PostgreSQL frontend engine and authentication implementation

The proxy now includes a dedicated PostgreSQL frontend engine (PostgreSQLFrontendEngine) that manages the PostgreSQL protocol codec, authentication, and command execution. This adds support for PostgreSQL-specific authentication methods, including MD5 and plain password verification, as well as handling of portal contexts for prepared statements and queries. The implementation ensures that PostgreSQL clients can connect, authenticate, and execute standard SQL commands through the proxy.

proxy/frontend/dialect/postgresql · high confidence

Introduce new SPI loading infrastructure with caching and singleton support

The SPI module now includes a new \ShardingSphereServiceLoader\ and \RegisteredShardingSphereSPI\ to manage service discovery, supporting both singleton and multiton instantiation patterns via the \@SingletonSPI\ annotation. The \OrderedSPILoader\ and \TypedSPILoader\ have been refactored to use this new loader, introducing a \OrderedServicesCache\ to cache loaded services and avoid repeated classpath scans. Additionally, a \ServiceProviderNotFoundException\ has been added to provide clearer error messages when a service provider is not found.

infra/spi · high confidence

Introduce new SQL rewrite infrastructure in infra/rewrite/core

The \infra/rewrite/core\ module has been introduced, establishing a new, modularized SQL rewrite engine. This change adds a central \SQLRewriteEntry\ that coordinates the creation of an \SQLRewriteContext\ and delegates to either a \GenericSQLRewriteEngine\ or a \RouteSQLRewriteEngine\ depending on the routing context. The update also introduces a new \ParameterBuilder\ abstraction with \StandardParameterBuilder\ and \GroupedParameterBuilder\ implementations to handle SQL parameters, alongside a \ParameterRewritersBuilder\ to manage parameter rewriting logic. These components work together to transform and optimize SQL statements before execution.

infra/rewrite/core · high confidence

Introduce new SQL routing infrastructure with tableless routing support

The \infra/route/core\ module has been restructured to introduce a new SQL routing architecture. This includes a new \SQLRouter\ interface and \SQLRouteEngine\ to manage routing logic, alongside a \TablelessRouteEngineFactory\ that handles routing for SQL statements without table information. The update also adds a \RouteContext\ to track routing results, supporting both broadcast and unicast routing strategies for data sources and instances. These changes provide a more modular and extensible foundation for SQL routing within the system.

infra/route/core · high confidence

Introduce new SQL translator API and configuration classes

Added new classes to the SQL translator module: the \SQLTranslator\ SPI interface, \SQLTranslatorContext\ for holding translation context, \SQLTranslatorRuleConfiguration\ for rule configuration, and \SQLTranslationException\ along with \UnsupportedTranslatedDatabaseException\ for error handling. These changes establish the core API for SQL translation functionality within the ShardingSphere kernel.

kernel/sql-translator/api · high confidence

Introduce new configuration model for the Encrypt rule

The Encrypt rule configuration has been refactored to use a new set of configuration classes: \EncryptRuleConfiguration\, \EncryptTableRuleConfiguration\, \EncryptColumnRuleConfiguration\, and \EncryptColumnItemRuleConfiguration\. This change introduces a structured hierarchy for defining encryption rules, where rules are defined by tables and their respective cipher, assisted query, and like query columns. A corresponding configuration checker (\EncryptRuleConfigurationChecker\) has been added to validate these configurations, ensuring that all referenced encryptors are registered and that required column details are present.

features/encrypt · high confidence

Introduce new data source pool infrastructure classes

Added new classes to the data source pool module, including configuration models (ConnectionConfiguration, DataSourceConfiguration, PoolConfiguration), a catalog-switchable data source wrapper, a data source pool creator and reflection utility, metadata interfaces and implementations, and property domain objects. These changes provide the internal structure for managing and configuring data source pools.

infra/data-source-pool/core · high confidence

Introduce new metadata loading infrastructure for database connectors

The database connector module now includes a new metadata loading architecture, introducing \MetaDataLoader\ as the central orchestrator that coordinates the loading of schema, table, column, and index metadata. This new structure utilizes a \MetaDataLoaderConnection\ to wrap JDBC connections and delegates specific loading tasks to specialized loaders (e.g., \SchemaMetaDataLoader\, \TableMetaDataLoader\). The system now supports parallel loading of metadata and applies identifier normalization policies to table names, ensuring consistent case handling across different database types.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/data/loader · high confidence

Introduce new proxy configuration model and loader

The proxy backend core module now uses a new configuration model (ProxyConfiguration, ProxyGlobalConfiguration, YamlProxyConfiguration) and a dedicated loader (ProxyConfigurationLoader) to parse YAML files. The loader supports both the new 'global.yaml' and 'database-\.yaml' file names, while maintaining backward compatibility with the legacy 'server.yaml' and 'config-\.yaml' files. This change separates the loading and swapping of configuration data, improving the structure of how the proxy reads and validates its configuration.

proxy/backend/core · high confidence

Introduce result set mapping for database-specific data types

A new result set mapping layer has been added to the database connector core, introducing a \ResultSetMapper\ that routes SQL result set column extraction to database-specific \DialectResultSetMapper\ implementations. This allows the connector to handle database-specific data types (such as Oracle's TIMESTAMP WITH ZONE) via a pluggable SPI mechanism, improving type handling across different database dialects.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/resultset · high confidence

Introduce standalone mode repository API

The standalone mode now exposes a dedicated API module containing the StandalonePersistRepository interface and its associated configuration class, providing a clear separation for standalone repository operations.

mode/type/standalone/repository/api · high confidence

Introduce structured exception hierarchy for SQL and external errors

The exception module now provides a comprehensive, layered exception hierarchy to improve error handling and debugging. This includes a new \ShardingSpherePreconditions\ utility for state and null checks, a base \ShardingSphereExternalException\ for wrapping external errors, and a detailed SQL exception hierarchy (\ShardingSphereSQLException\) that categorizes errors by type (kernel, feature, generic) and specific categories (cluster, connection, data, lock, metadata, pipeline, syntax, transaction). The changes also add SQL state and vendor error interfaces to standardize error reporting.

infra/exception · high confidence

Introduce the review-pr skill with structured review workflow and supporting scripts

The .codex/skills/review-pr directory now contains a complete skill for reviewing Apache ShardingSphere pull requests. The SKILL.md file defines the review workflow, including modes (Formal Review, PR Discussion Reply, Local Candidate Preflight), review focus, canonical assessment, finding proof gates, behavior clustering, and multi-round review corrections. Reference documents (evidence-access.md, high-risk-review.md, review-corrections.md, sql-parser-review.md) provide detailed guidance for evidence handling, high-risk scenarios, and SQL parser reviews. The openai.yaml agent configuration enables the skill via the $review-pr prompt. Python scripts (build\_review\_inventory.py, review\_common.py, review\_ledger.py) provide deterministic scope inventory, shared helpers, and a private coverage ledger for tracking file and finding status during the review process.

.codex/skills/review-pr · high confidence

Introduce transaction configuration and SPI interfaces

Added the \TransactionType\ enum, \TransactionRuleConfiguration\ class, \ShardingSphereDistributedTransactionManager\ interface, and \TransactionHook\ interface to the \kernel/transaction/api\ module. These new components provide the API for configuring transaction types (LOCAL, XA, BASE), managing distributed transactions, and hooking into transaction lifecycle events (begin, commit, rollback). A corresponding test class \TransactionTypeTest\ was also added to verify the \isDistributedTransaction\ logic.

kernel/transaction/api · high confidence

Introduces cryptographic algorithm interfaces for encryption and decryption

The cryptographic algorithm SPI now provides two new interfaces: CryptographicAlgorithm, which defines methods for encrypting and decrypting values, and CryptographicPropertiesProvider, which exposes secret keys, modes, padding, IV parameters, and encoders. These interfaces allow users to implement and configure cryptographic algorithms within the infrastructure.

infra/algorithm/type/cryptographic/spi · high confidence

Introduces new configuration classes for database, mode, and key generation

Adds new configuration classes to the infrastructure layer, including DatabaseConfiguration and its implementations (DataSourceGeneratedDatabaseConfiguration, DataSourceProvidedDatabaseConfiguration) to manage database and storage unit settings. Also introduces ModeConfiguration and PersistRepositoryConfiguration to handle cluster and repository settings, along with KeyGenerateStrategiesConfiguration for key generation strategies. These changes provide a more structured and decoupled way to configure database connections, modes, and key generation in the system.

infra/common · high confidence

Introduces new metrics collector interfaces

The metrics core module adds five new interfaces to define how different metric types are collected: CounterMetricsCollector, GaugeMetricsCollector, GaugeMetricFamilyMetricsCollector, HistogramMetricsCollector, and SummaryMetricsCollector. These interfaces standardize the contract for collecting counter, gauge, histogram, and summary metrics, enabling consistent metric collection behavior across the agent.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/collector/type · high confidence

Introduces new privilege check types for database connectivity

A new interface, DialectDatabasePrivilegeChecker, and an associated enum, PrivilegeCheckType, have been added to the database connector core. The PrivilegeCheckType enum defines specific privilege check types including PIPELINE, SELECT, XA, and NONE, which are used by the checker to validate user privileges for different database operations.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/checker · high confidence

Introduction of AgentPath utility class

A new AgentPath utility class has been added to the agent core module. This class provides a static method, getRootPath, which resolves the agent's root directory by locating the agent JAR file via the provided classloader. This change introduces a centralized way to determine the agent's installation path.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/path · high confidence

Introduction of MessageDigestAlgorithm SPI interface

A new \MessageDigestAlgorithm\ interface is introduced in the \org.apache.shardingsphere.infra.algorithm.messagedigest.spi\ package. This interface extends \ShardingSphereAlgorithm\ and defines a \digest\ method that accepts and returns \Object\ types, establishing the contract for message digest implementations within the infrastructure layer.

infra/algorithm/type/message-digest/spi · high confidence

JDBC driver module refactoring and consolidation

The JDBC module has been consolidated into the main shardingsphere-jdbc module, merging the previously separate shardingsphere-jdbc-core module. This change introduces new public APIs for creating data sources, including ShardingSphereDataSourceFactory for programmatic configuration and YamlShardingSphereDataSourceFactory for YAML-based configuration. The refactoring also introduces a new exception hierarchy under org.apache.shardensphere.driver.exception (e.g., ConnectionClosedException, DriverConnectionException) and restructures the executor callback system with new interfaces like StatementAddCallback, ExecuteCallbackFactory, and various execute/query/update callback implementations. The ShardingSphereDriver class has been simplified to handle driver registration and URL acceptance, delegating connection logic to the new factory and cache mechanisms.

jdbc · high confidence

MD5 message-digest algorithm implementation added to the infrastructure layer

The MD5 message-digest algorithm is now available as a standalone module within the ShardingSphere infrastructure, allowing users to perform MD5 hashing operations. The implementation supports optional salt configuration via properties, and includes a corresponding unit test to verify digest generation and null-handling behavior.

infra/algorithm/type/message-digest/type/md5 · high confidence

MariaDB dialect support added

The MariaDB database dialect is now supported. This change introduces the \MariaDBDatabaseType\ and \MariaDBDatabaseMetaData\ classes, which delegate to the existing MySQL implementations for metadata and transaction options, enabling the system to recognize and handle MariaDB connections via the \jdbc:mariadb:\ URL prefix.

(repo-wide) · high confidence

MySQL SHOW statement segment removal support added

A new MySQL-specific implementation of the DialectToBeRemovedSegmentsProvider has been added to handle SQL segment removal for SHOW statements. The provider now explicitly processes MySQLShowTablesStatement, MySQLShowColumnsStatement, MySQLShowIndexStatement, and MySQLShowTableStatusStatement, ensuring that the 'from' database segment is correctly identified and removed during SQL rewriting. A corresponding test class has been added to verify this behavior.

infra/rewrite/dialect/mysql · high confidence

MySQL SQL parser grammar files added to the engine module

The MySQL SQL parser grammar files (ANTLR4 .g4 files and generated Java lexer) have been added to the \parser/sql/engine/dialect/mysql\ directory, establishing the foundational syntax rules for parsing MySQL-specific SQL constructs within the SQL engine.

parser/sql/engine/dialect/mysql · high confidence

MySQL dialect binder implementation and projection identifier extraction

The MySQL dialect module now includes a dedicated SQL bind engine (MySQLSQLBindEngine) that routes specific MySQL statement types—including LOAD, SHOW, and OPTIMIZE TABLE—to their respective type-specific binders (e.g., MySQLLoadDataStatementBinder, MySQLShowCreateTableStatementBinder). A new MySQLProjectionIdentifierExtractor handles projection identifier extraction for MySQL, enforcing a 255-character limit on subquery column names. Service provider interfaces are registered via META-INF/services to wire these components into the framework.

infra/binder/dialect/mysql · high confidence

MySQL dialect connector implementation added

The MySQL dialect connector is now fully implemented, providing a complete set of components for database interaction and metadata management. This includes a privilege checker for validating database permissions, a metadata loader for schema and table information, and a database metadata provider that defines MySQL-specific behaviors such as backtick quoting, case sensitivity policies, and data type mappings. The implementation also adds a connection properties parser, a default query properties provider, and a result set mapper to handle MySQL-specific data types like YEAR. Service provider interfaces are registered to wire these components into the framework.

(repo-wide) · high confidence

MySQL dialect exception mapping and error codes

The MySQL dialect now includes a comprehensive set of exception classes (e.g., DatabaseAccessDeniedException, HandshakeException, UnknownCharsetException) and a corresponding MySQLDialectExceptionMapper that converts internal SQLDialectException instances into standard java.sql.SQLException objects with appropriate MySQL vendor error codes and SQL states. This enables more precise error reporting for MySQL-specific database issues such as access denials, handshake failures, and variable errors.

database/exception/dialect/mysql · high confidence

New DistSQL statement and segment classes for RAL commands

The parser module now includes a comprehensive set of new classes in the \parser/distsql/statement\ directory to support DistSQL and RAL (Remote Administration Layer) commands. This includes a new \DistSQLSegment\ interface and related segment classes (e.g., \AlgorithmSegment\, \DataSourceSegment\, \ReadOrWriteSegment\) that model the structure of DistSQL statements. Additionally, a hierarchy of statement classes has been introduced, starting with \DistSQLStatement\ and \RALStatement\, with specific implementations for queryable commands (e.g., \ShowComputeNodesStatement\, \ShowPluginsStatement\) and updatable commands (e.g., \LockClusterStatement\, \SetDistVariableStatement\). A \DataSourceSegmentsConverter\ is also added to map data source segments to pool properties. These changes provide the internal representation for parsing and executing distributed SQL and administrative commands.

parser/distsql/statement · high confidence

New DistSQL statements for SQL parser rule management

The distsql/statement module introduces new DistSQL statement classes to manage SQL parser rules. A new CacheOptionSegment class is added to represent cache configuration options. Additionally, new statement classes are introduced: ShowSQLParserRuleStatement (extending ShowGlobalRulesStatement) for querying SQL parser rule configurations, and AlterSQLParserRuleStatement (extending GlobalRuleDefinitionStatement) for modifying them, each incorporating CacheOptionSegment fields for parse tree and SQL statement caches.

kernel/sql-parser/distsql/statement · medium confidence

New DistSQL statements for data migration lifecycle management

Added DistSQL statement classes to manage the data migration workflow, including updatable statements for starting, stopping, committing, rolling back, and checking migrations, as well as queryable statements for listing and checking status. The set also includes statements for registering and unregistering migration source storage units and a segment for mapping source to target tables.

kernel/data-pipeline/scenario/migration/distsql/statement · high confidence

New DistSQL statements for managing CDC streaming pipelines

Added DistSQL statement classes to support querying and managing CDC streaming pipelines. This includes \ShowStreamingListStatement\ and \ShowStreamingStatusStatement\ for retrieving the list and status of streaming jobs, as well as \ShowStreamingRuleStatement\ for rule-level queries. Additionally, \DropStreamingStatement\ is introduced to allow users to stop and remove streaming pipelines via DistSQL.

kernel/data-pipeline/scenario/cdc/distsql/statement · high confidence

New DistSQL statements for managing transaction rules

Users can now query and modify transaction rules via DistSQL. A new ShowTransactionRuleStatement allows users to view the current transaction rule configuration, while the new AlterTransactionRuleStatement enables users to update the default transaction provider type and its associated properties. These changes introduce the necessary statement classes and segments to support transaction rule management in the DistSQL interface.

kernel/transaction/distsql/statement · high confidence

New Dockerfiles and source distribution assembly for Agent, MCP, Proxy, and Proxy Native

Added new Dockerfiles for the ShardingSphere Agent, MCP server, Proxy, and Proxy Native builds, enabling containerized deployment and nightly image generation on ghcr.io. The Proxy and Agent images now use Eclipse Temurin JDK 25, while the MCP image uses JDK 21. Additionally, a new source distribution assembly (source-distribution.xml) was added to package the project's source code into a zip file, excluding build artifacts and IDE-specific files.

distribution · high confidence

New JDBC URL parsing and instance judgment components

The database connector now includes a new set of classes in the \jdbcurl\ package to handle JDBC URL parsing and database instance comparison. This includes \ConnectionProperties\ and \ConnectionPropertiesParser\ to parse URLs into structured objects, \DatabaseInstanceJudger\ and \DatabaseInstanceJudgeEngine\ to determine if two URLs point to the same database instance, and \JdbcUrlAppender\ to safely append query parameters to URLs. These components provide the core logic for identifying and manipulating database connection strings.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/jdbcurl · high confidence

New Java API for Sharding Rule Configuration

The sharding module introduces a new Java API for configuring sharding rules, including \ShardingRuleConfiguration\ and related classes for tables, auto tables, table references, and strategies. This provides a structured way to define sharding, key generation, and audit strategies in code.

features/sharding · high confidence

New MCP descriptors and prompts for broadcast, shadow, and sharding features

Added MCP (Model Context Protocol) descriptors and prompt templates for the broadcast, shadow, and sharding features. These new files define the resource templates, tool definitions, and planning prompts that allow the system to plan and validate DistSQL for these specific features. This enables the model to interact with ShardingSphere's broadcast, shadow, and sharding capabilities through structured workflows.

mcp/features/sharding · high confidence

New MySQL frontend engine and authentication handlers

The MySQL frontend engine and its associated components have been restructured. The \MySQLFrontendEngine\ now encapsulates the MySQL-specific protocol handling, including the \MySQLAuthenticationEngine\ which manages the MySQL handshake and user authentication (supporting \caching\_sha2\_password\, \clear\_text\, and \native\ password methods). The \MySQLCommandExecuteEngine\ routes incoming MySQL commands (such as \COM\_QUERY\, \COM\_STMT\_EXECUTE\, \COM\_QUIT\) to their respective executors, enabling the proxy to process MySQL client requests. This change introduces the core infrastructure for handling MySQL protocol connections and commands within the proxy.

proxy/frontend/dialect/mysql · high confidence

New PluginConfigurationLoader for agent configuration

A new PluginConfigurationLoader class has been added to the agent core, responsible for loading plugin configurations from the agent's YAML configuration file (agent.yaml) and mapping them to the appropriate PluginConfiguration objects.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config · high confidence

New SPI interfaces for rule configuration changes and persistence

The \mode/spi\ module introduces new abstractions for managing rule state and updates. The \PersistRepository\ interface provides a standard contract for querying, persisting, and deleting key-value data. Additionally, \RuleItemConfigurationChangedProcessor\ defines a lifecycle for swapping, finding, changing, and dropping rule item configurations, while \RuleChangedItemType\ serves as a data carrier for rule change metadata.

mode/spi · high confidence

New SQL parser SPI interfaces and type-specific visitor interfaces

The parser/sql/spi module introduces new API interfaces for the SQL parser, including ASTNode, SQLLexer, SQLParser, and SQLVisitor. It also adds type-specific statement visitor interfaces (DAL, DCL, DDL, DML, LCL, RL, and TCL) and corresponding facades (DialectSQLParserFacade, SQLStatementVisitorFacade) that extend DatabaseTypedSPI, enabling dialect-specific parser and visitor implementations.

parser/sql/spi · high confidence

New SQL parser examples for MySQL, OpenGauss, Oracle, PostgreSQL, SQL92, and SQLServer

The examples/shardingsphere-parser-example directory now includes standalone Java examples for parsing SQL statements across multiple database dialects. Each example demonstrates how to use the SQLParserEngine and SQLStatementVisitorEngine to parse and visit SQL statements for MySQL, OpenGauss, Oracle, PostgreSQL, SQL92, and SQLServer, allowing users to see how the parser handles common DML and DDL operations for each supported database type.

examples/shardingsphere-parser-example · high confidence

New SQL parser metadata and extraction utilities

The SQL parser now includes a new \parser.statement.core.extractor\ package containing \ColumnExtractor\ and \ExpressionExtractor\ classes, along with a suite of new enums in the \parser.statement.core.enums\ package (including \ACLAttributeType\, \AggregationType\, \CombineType\, \DirectionType\, \JoinType\, \LogicalOperator\, \OrderDirection\, \ParameterMarkerType\, \Paren\, \SSLType\, \SequenceFunction\, \SubqueryType\, and others). These additions provide structured metadata and extraction logic for SQL statements, enabling more robust parsing and analysis of SQL features such as aggregation, join types, and subqueries.

parser/sql/statement/core · high confidence

New ShardingSphere-JDBC metrics for statement execution and transactions

The ShardingSphere-JDBC agent now exposes new metrics for monitoring statement execution counts, execution errors, and latency histograms, as well as transaction counts for commit and rollback operations. These additions allow users to track the performance and reliability of JDBC interactions through the metrics plugin.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice/jdbc · high confidence

New URL parsing and argument replacement infrastructure

The \shardingsphere-infra-url\ module introduces a new \ShardingSphereURL\ class to parse and manage configuration URLs, supporting local file, ZooKeeper, and etcd sources. It also adds \URLArgumentLine\ and \URLArgumentLineRender\ to parse and replace placeholders in configuration files using environment variables or system properties, with a \URLArgumentPlaceholderType\ enum to control the replacement strategy.

infra/url/core · high confidence

New YAML configuration entities for advisor and pointcut settings

Added four new Java classes in the agent's YAML configuration package: YamlAdvisorConfiguration, YamlAdvisorsConfiguration, YamlPointcutConfiguration, and YamlPointcutParameterConfiguration. These classes define the data structures for advisor, pointcut, and parameter configurations, enabling the system to parse and manage these settings via YAML files.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/advisor/config/yaml/entity · high confidence

New YAML plugins configuration swapper for agent plugins

A new class, YamlPluginsConfigurationSwapper, has been added to the agent core module. This component handles the conversion of YAML-based agent configurations into internal PluginConfiguration objects for logging, metrics, and tracing plugins, enabling the agent to read and process plugin settings defined in YAML format.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/config/yaml/swapper · high confidence

New agent API interfaces for method interception

The agent API now provides a structured set of interfaces for intercepting and advising target code. A base \AgentAdvice\ interface and a \PluginConfiguration\ class were added. Specific advice types for constructors (\ConstructorAdvice\), instance methods (\InstanceMethodAdvice\), and static methods (\StaticMethodAdvice\) are introduced, each providing hooks for before, after, and exception scenarios. Helper classes \TargetAdviceMethod\ and \TargetAdviceObject\ support the interception context. This change enables plugins to implement specific advice logic for different target types.

agent/api/src/main/java/org/apache/shardingsphere/agent/api/advice · high confidence

New agent builder interceptors for method and target advice object handling

The agent core module introduces two new builder interceptors: MethodAdvisorBuilderInterceptor, which applies advice execution to matched methods, and TargetAdviceObjectBuilderInterceptor, which adds a volatile field to implement the TargetAdviceObject interface. These changes enhance the agent's ability to intercept and modify class structures at build time.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/builder/interceptor/impl · high confidence

New algorithm core module with configuration and exception types

The infra/algorithm/core module now includes a new ShardingSphereAlgorithm interface, an AlgorithmConfiguration class for holding algorithm type and properties, and a set of specific exceptions (AlgorithmDefinitionException, AlgorithmExecuteException, AlgorithmInitializationException, etc.) to handle algorithm-related errors. Additionally, an AlgorithmChangedProcessor and YAML support classes (YamlAlgorithmConfiguration, YamlAlgorithmConfigurationSwapper) are added to manage algorithm configuration changes, with corresponding tests verifying the new functionality.

infra/algorithm/core · high confidence

New authority and authentication core components

The kernel/authority/core module now introduces a new authentication and authority checking architecture. This includes the \Authenticator\ interface and \AuthenticatorFactory\ for managing authentication methods, the \AuthorityChecker\ and \AuthoritySQLExecutionChecker\ for validating user permissions and SQL execution rights, and the \AuthorityRule\ to manage user privileges and configuration. Additionally, YAML configuration support is added via \YamlAuthorityRuleConfiguration\ and its associated swappers, enabling users to define authority rules in configuration files.

kernel/authority/core · high confidence

New authority rule configuration and privilege provider SPI

The authority module introduces new configuration classes, including \AuthorityRuleConfiguration\ and \UserConfiguration\, which define the structure for managing user credentials and privilege providers. A new \PrivilegeProvider\ SPI interface is added to handle privilege building logic, decoupling the API from specific implementations. This change enables more flexible configuration of authentication and authorization rules within the system.

kernel/authority/api · medium confidence

New cluster persist repository API and configuration

Introduced a new \ClusterPersistRepository\ interface and its associated configuration, exception, and listener types in the \mode/type/cluster/repository/api\ module. This adds a dedicated API for cluster-based persistence operations, including support for ephemeral data, exclusive persistence, distributed locking, and data change event listening.

mode/type/cluster/repository/api · high confidence

New database metadata enums for null ordering, quoting, and table types

The database connector module now includes three new enumeration types in the metadata package: NullsOrderType, which defines how NULL values are ordered in SQL queries; QuoteCharacter, which provides methods to wrap, unwrap, and identify SQL identifier quoting styles; and TableType, which distinguishes between standard tables and views. These enums support database metadata operations by standardizing how these common database concepts are represented and processed within the connector layer.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/enums · high confidence

New frontend SPI interfaces for authentication, command execution, and protocol handling

The proxy/frontend/spi module now introduces several new interfaces that define the frontend protocol handling and command execution contracts: AuthenticationEngine for managing connection handshakes and user authentication, CommandExecuteEngine for routing and executing database commands, and its associated executor interfaces (CommandExecutor, QueryCommandExecutor, ResponseType) for processing query results. Additionally, the DatabaseProtocolFrontendEngine interface is added to serve as the central SPI entry point for database protocol frontends, exposing methods to retrieve the codec engine, authentication engine, and command execute engine. These changes establish the structural foundation for how the proxy handles incoming client connections and commands at the protocol level.

proxy/frontend/spi · medium confidence

New pipeline RAL statement types for data pipeline management

The distsql/statement module now includes new Java classes that define the structure for pipeline-related RAL (Remote Access Layer) statements. Specifically, the code introduces a base interface for all pipeline statements (PipelineRALStatement), a queryable abstract class (QueryablePipelineRALStatement), and an updatable abstract class (UpdatablePipelineRALStatement) that extends the base interface. Additionally, a concrete statement (AlterTransmissionRuleStatement) is added to handle transmission rule modifications, providing the necessary types for managing data pipeline configurations via SQL.

kernel/data-pipeline/distsql/statement · high confidence

New pipeline channel and consistency check infrastructure

Added new classes to support pipeline channel creation and data consistency checking. This includes the \PipelineChannel\ interface and its \MemoryPipelineChannel\ implementation, along with \InventoryChannelCreator\ and \IncrementalChannelCreator\ to instantiate channels for inventory and incremental tasks. Additionally, the \PipelineDataConsistencyChecker\ interface and related utilities like \DataConsistencyCheckUtils\ and \ConsistencyCheckJobItemProgressContext\ are introduced to handle data consistency verification logic.

kernel/data-pipeline/core · high confidence

New pipeline data source configuration API

The data-pipeline API module now includes new classes to manage data source configurations for data pipelines. This introduces the \PipelineDataSourceConfiguration\ interface and its implementations (\ShardingSpherePipelineDataSourceConfiguration\ and \StandardPipelineDataSourceConfiguration\) to handle YAML-based and standard JDBC configurations. Additionally, a \JdbcQueryPropertiesExtension\ SPI is added to allow database-specific query property extensions, and a \PipelineDataSourceCreator\ SPI is provided to create data sources for pipeline operations.

kernel/data-pipeline/api · high confidence

New proxy metrics for metadata and state

Added two new metrics exporters for ShardingSphere-Proxy: \proxy\_meta\_data\_info\ exposes the count of databases and storage units, while \proxy\_state\ exposes the proxy's current state (e.g., OK or circuit break).

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/exporter/impl/proxy · high confidence

New tracing advice classes for JDBC, SQL parsing, and root spans

The tracing plugin now includes new advice classes to instrument core database operations. \TracingJDBCExecutorCallbackAdvice\ captures execution details for JDBC calls, while \TracingSQLParserEngineAdvice\ handles SQL parsing events. Additionally, \TracingRootSpanAdvice\ manages the lifecycle of root spans, and \AttributeConstants\ defines standard span attributes. These changes enhance observability by automatically recording SQL execution, parsing, and root span data for ShardingSphere.

agent/plugins/tracing/core/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/core/advice · high confidence

New transaction rule and connection management components

Added the \TransactionRule\ and \ConnectionTransaction\ classes to manage transaction states and connections, alongside a \ShardingSphereTransactionManagerEngine\ to handle distributed transaction managers. The update introduces a \ResourceDataSource\ to wrap data sources with unique identifiers and a \ResourceIdGenerator\ for generating these IDs. It also adds exception classes for transaction management failures, timeout issues, and resource name length violations. Furthermore, the change includes an \ImplicitTransactionCallback\ interface for implicit transaction handling, a \ConnectionSavepointManager\ for managing savepoints, and a \SavepointReleaseSQLProvider\ SPI with a MySQL-specific implementation. Configuration is supported via \YamlTransactionRuleConfiguration\ and its swapper, with service loader files registering the new rule builders and YAML mappers.

kernel/transaction/core · high confidence

New utility classes for resource loading, event handling, and data serialization

The infra/util module introduces several new utility classes to support core infrastructure capabilities. A new event bus system is provided via EventBusContext and EventSubscriber, enabling internal event-driven communication. Resource management is improved with DataSourcesCloser and QuietlyCloser for safe resource cleanup. The module adds a JSON utility (JsonUtils) using Jackson for serialization, a YAML engine (YamlEngine) for parsing and generating YAML, and a ClasspathResourceDirectoryReader for accessing classpath resources. Additionally, helper classes like PropertiesBuilder, ReflectionUtils, and RegexUtils are added to simplify common tasks.

infra/util · high confidence

OpenGauss dialect receives dedicated admin executor and JDBC metadata handling

The OpenGauss dialect now includes its own implementations for database admin executors (including system table and function query factories, and specific executors for version, password deadline, and variable display) and JDBC result metadata checking. These components delegate to PostgreSQL implementations where appropriate but provide openGauss-specific routing and metadata handling, enabling the proxy to correctly process administrative queries and result metadata for openGauss backends.

proxy/backend/dialect/opengauss · high confidence

OpenTelemetry tracing configuration and service registration

Added the OpenTelemetry tracing plugin's advisor configuration file (opentelemetry-advisors.yaml), which defines pointcuts for SQL parsing, JDBC execution, and frontend command execution to enable distributed tracing. Additionally, registered the OpenTelemetryTracingPluginLifecycleService via the SPI mechanism to ensure proper plugin lifecycle management.

agent/plugins/tracing/type/opentelemetry/src/main/resources · high confidence

Oracle dialect connector implementation

Added the complete Oracle dialect implementation for the database connector, including the OracleDatabaseType, OracleMetaDataLoader, OracleDatabaseMetaData, and various option classes (data type, function, schema, identifier case policy, and result set mapper). This enables the system to parse Oracle JDBC URLs, load metadata, handle data types and functions specific to Oracle, and manage identifier case sensitivity and system schemas.

database/connector/dialect/oracle/src/main · high confidence

PostgreSQL SQL parser grammar and implementation added

The PostgreSQL dialect parser is now available, introducing a complete set of ANTL4 grammar files (covering DDL, DML, TCL, and DCL statements) and the corresponding Java implementation classes (lexer, parser, and visitor). This enables the system to parse and analyze PostgreSQL SQL syntax.

parser/sql/engine/dialect/postgresql · high confidence

Prometheus metrics plugin now exposes an HTTP server for scraping

The Prometheus metrics plugin now includes a dedicated lifecycle service that starts an HTTP server to expose collected metrics. This allows external systems to scrape Prometheus-style metrics from the agent, with support for JVM information, proxy state/metadata, and JDBC state/metadata exporters.

agent/plugins/metrics/type/prometheus/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/prometheus · high confidence

Proxy mode statistics collection is now scheduled via a dedicated job worker

A new statistics collection job and its associated worker have been added to the kernel/schedule/core module. The \StatisticsCollectJobWorker\ initializes a scheduled task that runs on proxy instances, using a ZooKeeper-based registry center to manage the job lifecycle. A corresponding lifecycle listener triggers initialization and cleanup, while a cron update listener allows dynamic configuration changes. Tests cover initialization, configuration updates, and destruction scenarios for the job and its worker.

kernel/schedule/core · high confidence

Restructure ShardingSphere-Proxy binary distribution and add release documentation

The ShardingSphere-Proxy binary distribution has been reorganized to improve clarity and compliance. A new assembly descriptor (\shardingsphere-proxy-binary-distribution.xml\) defines the structure of the release archive, separating core dependencies into the \lib\ directory while moving optional dependencies for Hive and Seata-AT into an \opt-lib\ directory. Additionally, the release package now includes comprehensive release documentation, including the Apache 2.0 License, a detailed NOTICE file listing third-party components and their licenses, and a README with usage instructions.

distribution/proxy · high confidence

SQL Server dialect parser implementation added

The SQL Server dialect parser has been implemented, introducing a complete set of ANTL4 grammar files (including BaseRule, DDL, DML, DCL, and TCL statements) and Java parser classes (Lexer, Parser, and Facade) to enable parsing of SQL Server-specific SQL syntax.

parser/sql/engine/dialect/sqlserver · high confidence

SQL parser rule configuration and builder

The SQL parser rule now exposes cache configuration for parse trees and SQL statements, allowing users to control memory usage and performance through YAML settings. The system now uses a dedicated builder and swapper to manage these cache options, ensuring consistent defaults and validation for SQL parsing behavior.

kernel/sql-parser/core · high confidence

Sharding pipeline support for data import

Added the data-pipeline-feature-sharding module, which introduces a \PipelineShardingColumnsExtractor\ to identify required sharding columns during data import, and a \ShardingPipelineYamlRuleConfigurationReviser\ that enables range queries for inline sharding algorithms and removes audit strategies from YAML configurations. These changes allow the data pipeline to correctly handle sharding rules during import operations.

kernel/data-pipeline/feature/sharding · high confidence

ShardingSphere MCP distribution adds startup scripts and configuration files

The ShardingSphere MCP distribution now includes shell and batch scripts (start.sh, start.bat, docker-entrypoint.sh) that validate the Java version (requiring 21+) and launch the MCP server. It also provides default configuration files for HTTP and STDIO transport modes, along with a logback logging configuration, enabling users to run the MCP server directly.

distribution/mcp · high confidence

Standalone mode now uses a new ContextManagerBuilder and dedicated persist services

The standalone mode implementation has been refactored to use a new \StandaloneContextManagerBuilder\ that constructs the \ContextManager\ with a \ComputeNodeInstanceContext\ and an \ExclusiveOperatorEngine\ for local locking. A new \StandalonePersistServiceFacade\ and its builder are introduced, delegating to specific standalone implementations like \StandaloneMetaDataManagerPersistService\, \StandaloneComputeNodePersistService\, and \StandaloneProcessPersistService\. This change isolates standalone-specific logic, such as worker ID generation and exclusive operation handling, from the shared mode core, providing a cleaner separation between standalone and cluster mode implementations.

mode/type/standalone/core · high confidence

Support for additional MySQL data administration and replication statements

The MySQL dialect now supports parsing a broader set of data administration and replication commands, including CLone, DELIMITER, HELP, Killo, RESET PERSIST, RESTAR, SHUTDOWN, and USE DATABASE. It also adds support for INSTALL/UNINSTALL COMPONENT and PLUGINS, CACHE/LOAD INDEX, and various binary log and replication operations such as CHANGE MASTER/REPLICA/SLAVE, START/STOP SLAVE/REPLICA, and SHOW commands for master status, binary logs, and relay log events.

parser/sql/statement/dialect/mysql · high confidence

YAML-based advisor configuration support

Users can now define AOP-style pointcuts and advisors via YAML configuration files. The new swapper classes (YamlAdvisorConfigurationSwapper, YamlAdvisorsConfigurationSwapper, YamlPointcutConfigurationSwapper) parse YAML structures into internal configuration objects, supporting method and constructor pointcuts with modifiers, parameter counts, and return types. This enables externalized, declarative configuration of agent behavior without code changes.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/advisor/config/yaml/swapper · high confidence

Security

Security: Upgrade dependencies to address multiple vulnerabilities

The project has performed a comprehensive update of its Maven dependencies to address several security vulnerabilities. Notable upgrades include Bouncy Castle (bcpkix-jdk18on) to 1.84, Quartz to 2.4.0, and SnakeYAML to 1.32. The update also includes fixes for [CVE redacted], [CVE redacted], [CVE redacted], [CVE redacted], [CVE redacted], and [CVE redacted] among others. This ensures that the ShardingSphere platform is protected against known security risks in its third-party libraries.

(dependencies) · high confidence

Architecture

Database connector exception and data type loading refactored

The database connector module has been restructured to improve code organization and error handling. Exception classes such as CheckDatabaseEnvironmentFailedException, ConnectionURLException, and others have been moved to the new org.apache.shardingsphere.database.connector.core.exception package, providing clearer error reporting for connection and environment issues. Additionally, the DataTypeLoader and DataTypeRegistry classes have been introduced to manage database metadata and data type mappings, enabling more robust handling of database-specific data types through a registry pattern.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/exception, database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/datatype · high confidence

PostgreSQL SQL binding and projection handling refactored into dedicated module

The PostgreSQL dialect's SQL binding and projection identifier extraction logic has been reorganized into the new \infra/binder/dialect/postgresql\ module. This change introduces a dedicated \PostgreSQLSQLBindEngine\ to handle statement binding (including \PostgreSQLCopyStatement\), a \PostgreSQLSQLStatementContextWarpProvider\ to manage context wrapping for specific statement types, and a \PostgreSQLProjectionIdentifierExtractor\ to standardize how projection identifiers and column names are derived for PostgreSQL queries. These components are now registered via Java SPI service files, ensuring the framework correctly applies PostgreSQL-specific binding and projection rules during query execution.

infra/binder/dialect/postgresql · high confidence

Refactored SQL statement binding context structure

The SQL statement binder has been refactored to use a new context hierarchy and factory pattern. A new \SQLStatementContextFactory\ creates specific context objects (e.g., \SelectStatementContext\, \InsertStatementContext\) based on the SQL statement type, supporting dialect-specific wrapping via \DialectCommonSQLStatementContextWarpProvider\. The \SQLStatementContextExtractor\ now centralizes the extraction of where segments, column segments, and join conditions across subqueries. New context classes such as \GeneratedKeyContext\, \InsertSelectContext\, \InsertValueContext\, and \OnDuplicateUpdateContext\ are introduced to manage insert-related data, while \GroupByContext\ and \OrderByItem\ handle grouping and ordering logic.

infra/binder/core · high confidence

Refactored cluster mode metadata and event handling architecture

The cluster mode's internal architecture has been refactored to improve modularity and maintainability. The \ClusterContextManagerBuilder\ has been restructured to initialize the \ContextManager\ with a new \ClusterPersistRepository\ and \ExclusiveOperatorEngine\. Event handling has been split into specialized handlers for database, schema, table, view, and rule changes, each implementing specific interfaces like \DatabaseChangedHandler\ or \GlobalConfigurationChangedHandler\. This change separates concerns for different metadata types and configuration changes, making the system easier to extend and maintain.

mode/type/cluster/core · high confidence

Behavioural changes

Add MySQL and PostgreSQL DAL statement routing logic

Introduced new route deciders for MySQL and PostgreSQL to handle Data Access Language (DAL) statements. For MySQL, the new \MySQLDALStatementBroadcastRouteDecider\ implements specific routing rules: resource group statements (create, alter, drop, set) and statements with the \AllowNotUseDatabaseSQLStatementAttribute\ are routed as instance broadcasts, while \SHOW variables\ is routed as a unicast. For PostgreSQL, the \PostgreSQLDALStatementBroadcastRouteDecider\ routes \RESET\ and \LOAD\ statements as data source broadcasts. These changes ensure that these specific SQL statements are executed on the correct nodes (single instance vs. all nodes) within a sharded environment.

infra/route/dialect/mysql · high confidence

Added HighFrequencyInvocation annotation

A new Java annotation, HighFrequencyInvocation, has been added to the infra/annotation module. This annotation marks classes or methods as high-frequency invocations and includes a 'canBeCached' property to indicate whether the invocation can be cached.

infra/annotation · high confidence

Configured JVM memory and headless mode for Maven builds

A new .mvn/jvm.config file has been added to the project, configuring the Java Virtual Machine with a 4GB maximum heap size (-Xmx4g), a 512m metaspace limit (-XX:MaxMetaspaceSize=512m), disabled shared archives (-Xshare:off), and headless AWT mode (-Djava.awt.headless=true). This ensures consistent JVM settings for Maven builds, particularly preventing memory-related issues and enabling headless operation.

.mvn · high confidence

Consolidated YAML advisors configuration loading

The system now uses a unified YamlAdvisorsConfigurationLoader to load advisor configurations from a single YAML source, replacing the previous separate loading of file-proxy-advisors.yaml and file-jdbc-advisors.yaml. This change simplifies the configuration structure by merging previously distinct advisor configuration files into a single file-advisors.yaml, streamlining how advisor settings are loaded and applied.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/advisor/config/yaml/loader · high confidence

Database connector core package refactored with new metadata and option classes

The \org.apache.shardingsphere.database.connector\ package has been restructured to include new core classes such as \DefaultDatabase\ and \GlobalDataSourceRegistry\, alongside a comprehensive set of metadata model classes (\ColumnMetaData\, \TableMetaData\, \SchemaMetaData\, etc.) and dialect-specific option classes (\DialectColumnOption\, \DialectConnectionOption\, \DialectJoinOption\, \DialectPaginationOption\, \DialectDriverQuerySystemCatalogOption\). This change introduces new data structures for database metadata and configuration options, likely to support more granular control over database connections, schema introspection, and SQL dialect behaviors.

(repo-wide) · high confidence

Deprecate the AllPermittedPrivilegeProvider

The AllPermittedPrivilegeProvider, which granted all privileges to users, is now marked as deprecated in favor of DatabasePermittedPrivilegeProvider. This change affects the authority provider module, where the provider and its associated AllPermittedPrivileges class are now legacy. Users relying on the 'ALL\_PERMITTED' or 'ALL\_PRIVILEGES\_PERMITTED' types should migrate to the new provider. Tests have been added to verify the deprecated provider's behavior.

kernel/authority/provider/simple · high confidence

File logging plugin lifecycle service implementation

The file logging plugin now includes a dedicated \FileLoggingPluginLifecycleService\ that implements the \PluginLifecycleService\ interface. This service handles the plugin's lifecycle by setting the \enhancedForProxy\ state in the \PluginContext\ during startup, allowing the plugin to be aware of whether it is running in an enhanced proxy context.

agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file · medium confidence

Improved PostgreSQL proxy behavior for composite types, fetch size, and admin variables

The PostgreSQL proxy now enforces stricter handling of composite result columns by throwing an error if a query returning composite types is routed to multiple storage units, preventing ambiguous results. Additionally, the proxy now strictly enforces the configured fetch size for PostgreSQL connections to control memory usage. The proxy also introduces new admin executors to support PostgreSQL-specific variable management, including SET/RESET/SHOW for variables like client\_encoding and transaction isolation, and provides accurate metadata for query headers including type OIDs for STRUCT types.

proxy/backend/dialect/postgresql · high confidence

Introduce PluginLifecycleService interface for plugin lifecycle management

A new PluginLifecycleService interface has been added to the agent API, providing a standardized contract for plugin lifecycle management. This interface defines the start() method for initializing plugins with configuration and the getType() method for identifying plugin types, while also extending AutoCloseable to support resource cleanup. This change replaces the previous PluginBootService, offering a more explicit lifecycle management mechanism for plugins within the agent framework.

agent/api/src/main/java/org/apache/shardingsphere/agent/spi · high confidence

Introduce default data type handling for database connectors

A new default implementation of the DialectDataTypeOption interface has been added to provide standard mappings for integer, string, and binary data types. This change establishes a baseline for how database connectors interpret and classify SQL data types, ensuring consistent behavior across different database dialects.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/datatype · medium confidence

Introduce new PostgreSQL protocol dialect implementation

The PostgreSQL protocol dialect has been restructured with a new packet codec engine, command packet factory, and dedicated packet classes for data rows, row descriptions, and parameter descriptions. This refactoring introduces support for extended protocol commands, binary and text value formats, and specific handling for PostgreSQL array column types and authentication methods, enabling more robust and maintainable database protocol interactions.

database/protocol/dialect/postgresql · high confidence

Introduce new SQL validation engine and SPI-based checker architecture

The \infra/checker\ module now includes a new \SupportedSQLCheckEngine\ that iterates through registered \SupportedSQLChecker\ implementations to validate SQL statements. This change introduces a new SPI-based architecture where \SupportedSQLCheckersBuilder\ interfaces allow rules to provide their own SQL checkers, enabling more modular and extensible SQL validation logic within the infrastructure layer.

infra/checker · high confidence

Introduce policy-based identifier case normalization and matching

The identifier case handling has been refactored to use a new \IdentifierCasePolicy\ and \IdentifierCasePolicySet\ system, replacing the previous \StandardIdentifierCasePolicy\ and \DefaultIdentifierCasePolicyProvider\. This change introduces a context-aware mechanism for normalizing and matching database identifiers (such as tables, schemas, and columns) based on quote character and scope, allowing for more flexible case sensitivity rules across different database types.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/identifier · high confidence

Introduce schema option abstractions for database connectors

Added new Java classes to define how database connectors handle schema metadata. The interface DialectSchemaOption and its implementation DefaultSchemaOption allow the connector to determine if a schema is available, retrieve the current schema from a connection, and access default or system schema names. The DialectSchemaSemantics enum defines whether the database uses native schemas or treats databases as schemas, enabling the connector to adapt its metadata queries based on the specific database dialect.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/schema · high confidence

Introduced PluginJarLoader to manage plugin JAR loading

Added a new PluginJarLoader class that scans the agent's plugins directory for JAR files, filtering out hidden files, and loads them using Java's JarFile API. This change introduces a dedicated component for plugin discovery and loading, replacing previous mechanisms with a more explicit and filtered approach to identifying and loading plugin JARs.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/plugin/jar · high confidence

Introduces AgentPluginEnable interface for plugin enablement

A new AgentPluginEnable interface has been added to the agent API, defining a standard method for determining whether a plugin is enabled. This change supports moving the logic for enabling plugins from a central location to each individual advice, allowing for more granular control over plugin activation.

agent/api/src/main/java/org/apache/shardingsphere/agent/api/plugin · medium confidence

Introduces explicit DDL commit policy and unified transaction options

The system now explicitly defines how DDL statements are committed after execution via the new DDLCommitPolicy enum, which offers two strategies: COMMIT\_CURRENT\_TRANSACTION and NO\_ADDITIONAL\_COMMIT. This is paired with a new DialectTransactionOption class that consolidates various transactional capabilities, including support for global CSN, auto-commit in nested transactions, DDL in XA transactions, metadata refresh in transactions, and specific error handling for commit failures. This change clarifies and centralizes transaction behavior configuration for different database dialects.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/transaction · high confidence

MySQL SQL Federation dialect components renamed and registered

The MySQL-specific implementations for SQL federation—specifically the column type converter, connection config builder, and function register—have been renamed to include 'SQLFederation' in their class names (e.g., \MySQLSQLFederationColumnTypeConverter\). Corresponding SPI service files have been updated to register these new classes, ensuring the system correctly loads MySQL-specific SQL federation behaviors for type conversion, connection configuration, and function registration.

kernel/sql-federation/dialect/mysql · medium confidence

New advice executors for constructors and static methods

The agent core now includes dedicated executors for constructor, instance method, and static method advice, each implementing the AdviceExecutor interface to intercept and run associated plugins. Each executor iterates over registered advices, checks if each is enabled via the AgentPluginEnable interface, and invokes the corresponding lifecycle methods (e.g., beforeMethod/afterMethod/onThrowing for instance and static methods; onConstructor for constructors). Errors during advice execution are logged at SEVERE level using java.util.logging, and the intercept method configures ByteBuddy to apply the appropriate method interception.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/advisor/executor/type · medium confidence

New dialect options for ALTER TABLE and ADD COLUMN operations

Added new configuration classes, DialectAddColumnOption and DialectAlterTableOption, to the altertable package. DialectAddColumnOption stores the 'beforeEachAddColumn' string, while DialectAlterTableOption exposes flags for merge/drop column support and parentheses usage, alongside the new add column option. This introduces new metadata options for how the database connector handles ALTER TABLE and ADD COLUMN dialects.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/altertable · high confidence

Oracle projection identifier extraction is now handled by a dedicated extractor

The Oracle dialect now uses a new \OracleProjectionIdentifierExtractor\ to process projection identifiers. This extractor standardizes identifier casing to uppercase and handles literal expressions and subqueries, ensuring consistent identifier resolution for Oracle queries.

infra/binder/dialect/oracle · high confidence

Prometheus metrics plugin registers via Java SPI

The Prometheus metrics plugin now registers itself using the Java Service Provider Interface (SPI) mechanism. New service configuration files have been added to declare the \PrometheusMetricsCollectorFactory\ and \PrometheusPluginLifecycleService\ implementations, enabling automatic discovery and lifecycle management of the Prometheus metrics collector.

agent/plugins/metrics/type/prometheus/src/main/resources/META-INF/services · medium confidence

Refactor SQL parser engine with new core components and caching

The SQL parser engine in the core module has been refactored to introduce a new architecture for parsing and visiting SQL statements. This includes the addition of a \SQLParserEngine\ that manages parsing and caching of Abstract Syntax Trees (AST) using Caffeine, a \SQLStatementVisitorEngine\ to handle statement visiting, and a \ParseASTNode\ class to manage parse trees and hidden tokens (such as executable comments). The refactoring also introduces a \SQLParserFactory\ for creating parser instances, a \SQLParserExecutor\ for executing parsing with a two-phase fallback strategy, and specific exception classes (\ParseSQLException\, \SQLParsingException\, \SQLASTVisitorException\) to handle errors. These changes provide a more robust and cache-enabled foundation for SQL parsing across different database types.

parser/sql/engine/core · high confidence

Refactor ShardingSphere-Proxy bootstrap and configuration structure

The proxy's startup process has been restructured to use a new \Bootstrap\ entry point that loads configuration from \global.yaml\ and example files named \database-\*.yaml\ (e.g., \database-sharding.yaml\). This change introduces a \BootstrapArguments\ class to handle startup parameters, a \BootstrapInitializer\ to set up the \ContextManager\, and a \DatabaseServerInfo\ mechanism to detect and log database server versions. Additionally, the default configuration path is now configurable via the \PROXY\_DEFAULT\_CONFIG\_PATH\ environment variable.

proxy/bootstrap · high confidence

Refactor metrics collection infrastructure with SPI-based factory and registry

The metrics collection subsystem has been refactored to use a Service Provider Interface (SPI) pattern for extensibility. A new \MetricsCollector\ interface and a \MetricsCollectorFactory\ interface (extending \PluginTypedSPI\) have been introduced to standardize how metrics collectors are created from configurations. Additionally, a \MetricsCollectorRegistry\ has been added to manage and retrieve these collectors via a service loader, replacing previous instantiation methods. This change affects how metrics plugins are registered and accessed within the agent.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/collector · high confidence

Refactor shadow rule configuration and algorithm SPIs

The shadow feature's configuration model has been refactored to use new, more specific configuration classes: ShadowRuleConfiguration now holds collections of ShadowDataSourceConfiguration and ShadowTableConfiguration, while the algorithm SPIs have been restructured with a base ShadowAlgorithm interface, a ColumnShadowAlgorithm for column-based matching, and a HintShadowAlgorithm for SQL hint-based matching. This change introduces new exception types for shadow-specific errors and updates the configuration checker to validate the new structure, ensuring that production and shadow data sources are correctly mapped and that algorithms are properly registered.

features/shadow · high confidence

Refactor single table rule with new checkers, loaders, and metadata revisers

The single table rule implementation has been refactored to improve structure and performance. A new SingleRuleConfigurationEmptyChecker validates configuration emptiness, while SingleSupportedSQLCheckersBuilder registers checkers for DROP SCHEMA and DROP TABLE operations. The SingleTableDataNodeLoader handles loading single table data nodes, and the SingleSQLFederationDecider determines if a query can be federated. Additionally, the SingleMetaDataReviseEntry and SingleConstraintReviser manage metadata revision and constraint handling. These changes streamline the single table rule's internal logic and improve maintainability.

kernel/single/core · medium confidence

Refactored DistSQL handler with new executor engines and aware interfaces

The DistSQL handler module was refactored to introduce new execution engines and awareness interfaces. A new DistSQLExecutorAwareSetter was added to centralize the injection of database, rule, and connection context into executors via the DistSQLExecutorDatabaseAware, DistSQLExecutorRuleAware, and DistSQLExecutorConnectionContextAware interfaces. The query and update execution paths were restructured into DistSQLQueryExecuteEngine and DistSQLUpdateExecuteEngine, which route to specific executors. For rule definitions, a new operator pattern was introduced with DatabaseRuleOperator, Create/Alter/DropDatabaseRuleOperator, and their factory, replacing the previous direct execution logic. Additionally, a DistSQLConnectionContext was added to carry connection state, and constants were extracted to DistSQLConstants.

infra/distsql-handler · high confidence

Refactored JDBC example generator architecture

The JDBC example generator has been refactored to use a pure Java implementation instead of the previous template-based approach. This introduces new core classes including ExampleGeneratorMain, JDBCExampleGenerator, and GenerateUtils, alongside a scenario-based architecture (ExampleScenario, FeatureExampleScenario, FrameworkExampleScenario) that maps features like sharding, encryption, and masking to specific template generation logic. The generator now reads configuration from a YAML file (YamlExampleConfiguration) and supports multiple frameworks (JDBC, Spring Boot starters, JPA, MyBatis) and transaction modes, allowing for more flexible and maintainable example code generation.

examples/shardingsphere-jdbc-example-generator · high confidence

Refactored SQL and routing metrics into dedicated advice classes

The metrics core plugin now uses specific advice classes to track SQL parsing, routing, and result counts. SQLParseCountAdvice increments the parsed\_sql\_total counter by SQL statement type. SQLRouteCountAdvice tracks the routed\_sql\_total metric, adding a database label and splitting the metric by database and type. RouteResultCountAdvice introduces new metrics for routed storage units and tables, each labeled with the database and name. These changes provide more granular visibility into SQL processing and routing behavior.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice · medium confidence

Refactored SQL execution engine with new process and audit abstractions

The SQL execution engine has been refactored to introduce a new \ProcessEngine\ and \SQLAuditEngine\, separating execution logic from audit and process management. The \ExecutorEngine\ now manages thread pools via \ExecutorServiceManager\ and supports both serial and parallel execution of \ExecutionGroup\ units. Additionally, the \SQLExecutionChecker\ interface and \SQLAuditor\ SPI have been added to the executor module, allowing for pre-execution checks and post-execution auditing through the \OrderedSPILoader\. These changes restructure how SQL statements are prepared, executed, and audited within the infrastructure layer.

infra/executor · high confidence

Refactored SQL federation executor with new context and enumerator classes

The SQL federation executor package was refactored to simplify engine logic. This introduces new context classes (ExecutorBindContext, ExecutorContext) and enumerable scan implementation (EnumerableScanImplementor) that handle data row enumeration for both JDBC and memory-based sources. The refactoring includes a new MemoryTableStatisticsBuilder for generating table statistics, a MemoryDataTypeConverter for type conversion, and dedicated enumerators (JDBCDataRowEnumerator, MemoryDataRowEnumerator) that provide consistent iteration over query results. These changes streamline how the SQL federation layer processes and returns data to the user.

kernel/sql-federation/executor · high confidence

Refactored SQL parser engine with dedicated cache management

The SQL parser engine in the infra/parser module has been refactored to improve performance and maintainability. A new \SQLParserEngine\ interface and \ShardingSphereSQLParserEngine\ implementation now handle SQL parsing, delegating to a dedicated \SQLStatementParserEngine\ for standard SQL and a \DistSQLStatementParserEngine\ for distributed SQL. The refactoring introduces a \CacheManager\ and \SQLStatementCacheBuilder\ to manage Caffeine-based caching for parsed SQL statements, allowing for dynamic cache option updates. This change also includes a corresponding test suite for the new cache components.

infra/parser · high confidence

Refactored ShardingSphere Agent core initialization and preconditions

The agent's core initialization flow has been restructured: the main entry point (ShardingSphereAgent) now explicitly loads plugin configurations, plugin JARs, and advisor configurations before creating and installing the AgentBuilder. Additionally, a new AgentPreconditions utility class has been introduced to centralize state and argument validation checks.

agent/core/src/main/java/org/apache/shardingsphere/agent/core · medium confidence

Refactored YAML parsing with stricter validation and security hardening

The agent's YAML parsing logic has been refactored to use a custom \AgentYamlConstructor\ that enforces stricter rules: map keys cannot be null or blank, and class loading is restricted to the expected root class. Additionally, the \LoaderOptions\ are configured to disable duplicate keys and limit alias depth, addressing security concerns related to YAML parsing.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/yaml · medium confidence

Refactored advisor configuration loading and data models

The agent core now uses new, simplified data models (AdvisorConfiguration, MethodAdvisorConfiguration) and a dedicated AdvisorConfigurationLoader to load advisor configurations from plugin JARs. This change consolidates the loading logic, adds logging when configuration files are missing, and ensures resources are properly closed, which may affect how advisor configurations are discovered and merged from plugin JARs.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/advisor/config · medium confidence

Refactored agent core builder package and introduced interceptor chain engine

The agent core module has been refactored to improve the structure of the agent builder. The \agent.core.transformer\ package was renamed to \agent.core.builder\, and the \AgentBuilderFactory\ was added to centralize the creation of the ByteBuddy agent builder. A new \AgentBuilderInterceptChainEngine\ was introduced to manage a chain of \AgentBuilderInterceptor\ implementations, allowing for modular interception of the agent builder process. Additionally, new classes such as \AgentJunction\ and \AgentTransformer\ were added to handle type matching and transformation logic within this new structure.

agent/core/src/main/java/org/apache/shardingsphere/agent/core/builder · high confidence

Refactored broadcast rule implementation and routing

The broadcast rule implementation has been refactored to use a new, modular routing engine that distinguishes between database-level and table-level broadcast routing, as well as unicast routing for specific statement types. This change introduces new classes such as BroadcastSQLRouter, BroadcastRouteEngineFactory, and specific route engines (BroadcastDatabaseBroadcastRouteEngine, BroadcastTableBroadcastRouteEngine, BroadcastUnicastRouteEngine) to handle different SQL statement types (DDL, DAL, DCL, DML) with appropriate routing strategies. The configuration and rule classes have also been updated to support this new structure, ensuring that broadcast tables are correctly identified and routed across all data nodes.

features/broadcast · high confidence

Refactored database type detection and SPI loader to use metadata fallback

The database connector core module has been refactored to improve how database types are detected and loaded. A new \DatabaseType\ interface and \DatabaseTypeFactory\ now handle detection via JDBC URL prefixes and, as a fallback, via \DialectJdbcUrlFetcher\ when metadata is unavailable. The \DatabaseTypedSPILoader\ has been updated to support this new structure, enabling services to be loaded based on a trunk database type if a specific branch type is not found. Additionally, the \DatabaseTypeRegistry\ now exposes all branch database types associated with a trunk type and provides methods for default schema naming and identifier formatting.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/type · medium confidence

Refactored generated key handling with new option classes

The handling of database-generated keys has been refactored to use a new interface, DialectGeneratedKeyOption, and its default implementation, DefaultGeneratedKeyOption. This change introduces a more structured way to manage generated key metadata, specifically allowing for the retrieval of the column name and checking if an explicit value triggers key generation. This affects how the system processes auto-increment and other database-generated key values.

database/connector/core/src/main/java/org/apache/shardingsphere/database/connector/core/metadata/database/metadata/option/keygen · medium confidence

Refactored session management with new context classes

The session module introduces new context classes to manage database connections, cursors, and transactions more explicitly. \ConnectionContext\ now encapsulates \CursorConnectionContext\ and \TransactionConnectionContext\, providing a unified way to track the current database, manage cursor state, and handle transaction types (including XA and BASE for distributed transactions). \QueryContext\ has been refactored to use these new contexts, allowing for better tracking of used databases and supporting SQL statements that do not require a specific database selection. The changes also include a new \UsedDataSourceProvider\ interface and a \TransactionManager\ interface to support these new contexts. Tests have been added for \CursorConnectionContext\ and \TransactionConnectionContext\.

infra/session · high confidence

Refine proxy metrics collection with dedicated advice classes

The proxy metrics plugin now uses specialized advice classes to collect distinct metrics, improving clarity and maintainability. Specifically, transaction metrics are split into \CommitTransactionsCountAdvice\ and \RollbackTransactionsCountAdvice\ for \proxy\_transactions\_total\. Execution metrics are separated into \ExecuteLatencyHistogramAdvice\ for \proxy\_execute\_latency\_millis\ (now collected only for \QueryCommandExecutor\), \ExecuteErrorsCountAdvice\ for \proxy\_execute\_errors\_total\, and \RequestsCountAdvice\ for \proxy\_requests\_total\. Additionally, \CurrentConnectionsCountAdvice\ handles \proxy\_current\_connections\ as a gauge. These changes replace the previous monolithic or less granular advice implementations, ensuring each metric type is tracked by its own dedicated component.

agent/plugins/metrics/core/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/core/advice/proxy · high confidence

Rename PluginBootService to PluginLifecycleService

The service provider file for the file logging plugin has been updated to register the new \FileLoggingPluginLifecycleService\ implementation, reflecting the renaming of the \PluginBootService\ interface to \PluginLifecycleService\. This change ensures the service loader can correctly locate and instantiate the plugin's lifecycle management logic.

agent/plugins/logging/type/file/src/main/resources/META-INF/services · low confidence

Restructure readwrite-splitting configuration and validation

The readwrite-splitting feature now uses a new configuration model that groups data sources into \ReadwriteSplittingDataSourceGroupRuleConfiguration\ objects, each defining a write source, a list of read sources, and a load balancer. A dedicated \ReadwriteSplittingDataSourceRuleConfigurationChecker\ validates that all referenced data sources exist and are not duplicated, while \ReadwriteSplittingRuleConfigurationChecker\ ensures load balancers are registered and valid. Additionally, a \TransactionalReadQueryStrategy\ enum (PRIMARY, FIXED, DYNAMIC) is introduced to control how transactions are routed to read replicas. These changes provide stricter configuration validation and a more modular approach to defining read-write splitting rules.

features/readwrite-splitting · high confidence

Simplified Hive SQL statement constructors and added attributes to select statements

The constructors for several Hive SQL statement classes, including HiveShowConnectorsStatement, HiveShowFunctionsStatement, HiveShowMaterializedViewsStatement, HiveShowPartitionsStatement, HiveShowTblpropertiesStatement, and HiveShowViewsStatement, have been refactored to use an empty buildAttributes method. Additionally, these specific statements now include SQLStatementAttributes with a TablelessDataSourceBroadcastRouteSQLStatementAttribute, while other statements like HiveDescribeStatement and HiveAbortStatement have been simplified to rely on the base class constructor without extra attributes.

parser/sql/statement/dialect/hive · medium confidence

Updated Maven Wrapper to version 3.3.4

The project's Maven Wrapper has been updated to version 3.3.4, which is now configured to download Apache Maven 3.9.14 from the official Maven repository. This update ensures that developers and CI systems use a consistent, self-contained build environment without requiring a pre-installed Maven.

.mvn/wrapper · high confidence

Fixes

Fix COUNT(\*) handling for Firebird

Added the FirebirdProjectionIdentifierExtractor to correctly handle projection identifiers for the Firebird database dialect. This implementation ensures that aggregate functions like COUNT(\) are processed correctly during query binding, addressing the issue where COUNT(\) handling was previously missing or incorrect for this specific database type.

infra/binder/dialect/firebird · high confidence

Test coverage

Add comprehensive tests for MySQL privilege checking; Add end-to-end driver tests for encryption, read-write splitting, and sharding; Add end-to-end tests for the Prometheus metrics plugin; Add end-to-end tests for transaction operations; Add integration tests for SQL node converter engine; Add tests for PostgreSQL database metadata; Add unit tests for AgentServiceLoader; Add unit tests for MethodTimeRecorder; Add unit tests for PluginContext; Add unit tests for YamlAdvisorsConfigurationLoader; Add unit tests for database connector result set mappers; Added E2E test fixtures for ShardingSphere proxy and algorithms; Added E2E test infrastructure for the agent engine; Added ReflectionFixture test utility; Added TargetObjectFixture test helper; Added e2e agent test fixtures for JDBC and Proxy; Added end-to-end tests for Jaeger and Zipkin tracing plugins; Added end-to-end tests for MCP workflow and functionality scenarios; Added end-to-end tests for pipeline operations; Added end-to-end tests for the SHOW processlist operation; Added end-to-end tests for the file logging plugin; Added integration test for SPI implementation matching; Added integration tests for YAML rule configuration and node tuple swapping; Added integration tests for pipeline data consistency and metadata loading; Added native test infrastructure for database integration tests; Added test coverage for H2 database connector metadata components; Added test coverage for Presto database metadata and system database components; Added test coverage for YamlPluginConfigurationLoader; Added test fixtures for AgentService SPI; Added test fixtures for YAML-based advisor configuration; Added test fixtures for agent advice hooks; Added test fixtures for database infrastructure; Added test fixtures for rule configuration and YAML swapping; Added tests for AdvisorConfigurationLoader; Added tests for Firebird binary protocol value handlers; Added tests for Firebird identifier case policy; Added tests for Firebird protocol constants and buffer handling; Added tests for H2 JDBC URL parsing and instance judger; Added tests for MySQL JDBC URL parsing and default query properties; Added tests for MySQL metadata option classes; Added tests for MySQL system database and kernel-supported system tables; Added tests for OpenGauss database privilege checker; Added tests for Oracle JDBC URL parsing; Added tests for PostgreSQL exception handling; Added tests for SQL92 database metadata and function options; Added tests for ShardingSphere MCP sharding feature handlers; Added tests for agent core YAML engine and preconditions; Added tests for database connector core components; Added tests for the MCP encrypt feature; Added tests for the read-write splitting MCP feature; Added unit tests for AgentPath; Added unit tests for AgentPluginClassLoader and ClassLoaderContext; Added unit tests for AgentReflectionUtils and SQLStatementUtils; Added unit tests for ClickHouse database metadata and system database behavior; Added unit tests for FileLoggingPluginLifecycleService; Added unit tests for Firebird database connector options; Added unit tests for Firebird date/time utility functions; Added unit tests for Firebird execute statement packet parsing; Added unit tests for Firebird metadata loaders; Added unit tests for Firebird metadata registries; Added unit tests for Firebird packet payload handling; Added unit tests for Firebird statement packet handling; Added unit tests for Firebird statement preparation packets; Added unit tests for FirebirdStatusVector; Added unit tests for Hive JDBC URL parsing and fetching; Added unit tests for Hive database metadata and identifier case policy; Added unit tests for HiveFunctionOption; Added unit tests for JDBC URL parsing across multiple database dialects; Added unit tests for MetaDataContextsFactoryAdvice; Added unit tests for MySQL identifier case policy provider; Added unit tests for MySQL metadata loading; Added unit tests for OpenGauss and PostgreSQL identifier case policy providers; Added unit tests for OpenTelemetry agent advice classes; Added unit tests for OpenTelemetry tracing plugin lifecycle; Added unit tests for Oracle ResultSet mapping; Added unit tests for PluginConfigurationLoader; Added unit tests for PluginConfigurationValidator; Added unit tests for PluginJarLoader; Added unit tests for PluginLifecycleServiceManager; Added unit tests for PluginPreconditions; Added unit tests for PostgreSQL database privilege checking; Added unit tests for PostgreSQL system database and kernel-supported system tables; Added unit tests for Prometheus metric collectors; Added unit tests for PrometheusMetricsCollectorFactory; Added unit tests for PrometheusMetricsExporter; Added unit tests for PrometheusPluginLifecycleService; Added unit tests for SQL Server database metadata; Added unit tests for SQL Server metadata loading; Added unit tests for SQLServerFunctionOption; Added unit tests for ShardingSphereDataSourceAdvice; Added unit tests for YAML advisor configuration swappers; Added unit tests for YamlPluginsConfigurationSwapper; Added unit tests for agent builder and junction components; Added unit tests for agent builder interceptors; Added unit tests for agent core advisor executors; Added unit tests for database type implementations; Added unit tests for metrics core advice and collectors; Added unit tests for system database metadata retrieval; Added unit tests for the Firebird packet codec engine; Added unit tests for the ShardingSphere MCP broadcast feature; Added unit tests for tracing core components; Expanded SQL binder integration tests for DDL, DML, and dialect-specific scenarios; External SQL parser integration test framework refactored; Introduce new SQL rewrite integration test framework; New DistSQL rule executor test infrastructure; New test infrastructure for log capture, auto-mocking, and deep-equality matchers; Refactored E2E test environment container management; Refactored MySQL protocol codec and added comprehensive test coverage; Refactored SQL E2E test framework with new data set and case loading infrastructure.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 69.

Lenses

  • Code Health 81
  • Architecture 97
  • Maturity 77
  • Readiness 78
  • Security 56
  • Domain Modelling 100

Changes since last survey

  • 300 commits — 257 feature/other, 43 fixes

By area

  • test/e2e — 37 commits
  • mcp/features — 36 commits
  • database/connector — 30 commits
  • mcp/core — 24 commits
  • mcp/support — 24 commits
  • infra/common — 15 commits
  • (root) — 12 commits
  • database/protocol — 12 commits
  • infra/binder — 9 commits
  • parser/sql — 8 commits
  • proxy/backend — 8 commits
  • .codex/harness — 7 commits
  • .codex/skills — 7 commits
  • features/encrypt — 7 commits
  • docs/document — 6 commits
  • mode/core — 6 commits
  • proxy/frontend — 5 commits
  • test/it — 5 commits
  • .github/workflows — 4 commits
  • mcp/bootstrap — 4 commits

Notable commits

  • fix: Fix BLOB result set handling in MySQL Proxy (#39340)
  • fix: Fix CLOB result set handling in MySQL Proxy (#39338)
  • fix: Fix Javadoc of DropBroadcastTableRuleStatement to match class name (#39198)
  • fix: Fix MCP E2E conformance discovery and Hive test dependency (#39230)
  • fix: Fix MCP E2E metadata search response pagination (#39185)
  • fix: Fix MCP Rule DistSQL recovery guidance (#39055)
  • fix: Fix MCP clarification sensitivity handling (#39169)
  • fix: Fix MCP savepoint rollback statement normalization (#39163)
  • fix: Fix MySQL TIME fractional seconds in proxy results (#39329)
  • fix: Fix MySQL prepared statement parameter signedness in Proxy (#39204)
  • fix: Fix NullPointerException in Firebird transaction isolation resolution (#39136)
  • fix: Fix Oracle column binding for unparenthesized function names (#39310)
  • fix: Fix Oracle column case sensitivity detection (#39297)
  • fix: Fix Oracle metadata version comparison for 18c and later (#39104)
  • fix: Fix Oracle pre-12.2 column case sensitivity (#39298)
  • fix: Fix PostgreSQL composite column type OID resolution (#39241)
  • fix: Fix PostgreSQL transactional DDL error handling (#39288)
  • fix: Fix SQL Federation pagination binding for long LIMIT parameters (#39237)
  • fix: Fix SQL Server row number column binding (#39229)
  • fix: Fix ShardingSphere-MCP model-facing contract drift (#39017)
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

apache/shardingsphere was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 99a0b47786fd854dcb0f6325b102f492579ef3d3 — the exact code this score is about.
  • Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer latest.