mirror of
https://github.com/apache/doris.git
synced 2026-11-04 17:16:21 +00:00
### What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary: JDBC schema lookup, scanning, and write failures
previously reported incomplete diagnostics: remote SQLSTATE and vendor
error codes were lost across FE catalog paths, delegated clients, and BE
Java scanner/writer wrappers, while repeated wrapping could duplicate or
corrupt messages. This change traverses SQLException cause and
nextException graphs with cycle detection and deduplication, carries
diagnostics through a neutral connector SPI, preserves original causes
and Doris error codes, and consistently redacts configured secrets and
JDBC URLs in summaries and JNI stack traces. Existing metadata fallbacks
and connector lifecycle behavior remain intact.
### Release note
JDBC errors now expose separate remote_sqlstate and
remote_vendor_error_code fields while preserving Doris error-code
semantics. The FE connector SPI is now API 13.0 and the JNI plugin SPI
is now API 5.0; external connector and JNI plugins must be rebuilt
against the updated APIs.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [x] Unit Test
- [x] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
Validation details:
- 59 focused Java unit tests in 14 test classes passed with
`run-fe-ut.sh`.
- Standard ASAN FE/BE build with `build.sh --fe --be -j96` passed,
including Checkstyle and all nine JNI plugin layout checks.
- `test_jdbc_error_diagnostics` passed against MySQL 8 with
`run-regression-test.sh -d external_table_p0/jdbc -s
test_jdbc_error_diagnostics` (one suite, no failures or skips).
- MySQL protocol verification retained Doris ERROR 1105 / errCode=2
alongside remote SQLSTATE 42000 / vendor code 1142, emitted once without
the configured password.
- Behavior changed:
- [ ] No.
- [x] Yes. JDBC diagnostics now retain remote codes and sanitize
messages consistently across FE and BE wrappers.
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
146 lines
7.1 KiB
XML
146 lines
7.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<modules>
|
|
<module>jni-spi</module>
|
|
<module>jni-bootstrap</module>
|
|
<module>plugin-toolkit</module>
|
|
<module>fluss-client-patch</module>
|
|
<module>paimon-common-patch</module>
|
|
<module>iceberg-metadata-scanner</module>
|
|
<module>hadoop-hudi-scanner</module>
|
|
<module>hive-udf-shade</module>
|
|
<module>hive-apache-shade</module>
|
|
<module>java-udf</module>
|
|
<module>jdbc-scanner</module>
|
|
<module>paimon-s3-shade</module>
|
|
<module>paimon-scanner</module>
|
|
<module>fluss-scanner</module>
|
|
<module>max-compute-connector</module>
|
|
<module>trino-connector-scanner</module>
|
|
<module>hadoop-deps</module>
|
|
<module>java-writer</module>
|
|
</modules>
|
|
|
|
<parent>
|
|
<groupId>org.apache.doris</groupId>
|
|
<version>${revision}</version>
|
|
<artifactId>fe</artifactId>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
|
|
<artifactId>be-java-extensions</artifactId>
|
|
<packaging>pom</packaging>
|
|
|
|
<!--
|
|
No module below declares a JUnit dependency, and none should. The fe parent pom already puts
|
|
junit-jupiter-engine, junit-jupiter-params and junit-platform-launcher on the test classpath
|
|
of EVERY module, so a JUnit 5 test compiles here without a per-module entry. Adding one is
|
|
not merely redundant: it also fails the Dependency License Review workflow, which resolves
|
|
no allow-listed SPDX license for org.junit.jupiter:junit-jupiter. JUnit 4 is not available
|
|
and must not come back - see the banJUnit4 rule in fe/check/checkstyle/checkstyle.xml.
|
|
-->
|
|
<properties>
|
|
<doris.home>${basedir}/../../</doris.home>
|
|
<fe_ut_parallel>1</fe_ut_parallel>
|
|
<!--
|
|
The JNI plugin API version, declared exactly once. This single property is the only
|
|
number: it is filtered into jni-spi's META-INF/doris/jni-plugin-api-version.properties
|
|
(what BE expects) AND stamped into every plugin jar's MANIFEST below (what a plugin
|
|
declares). Both sides of the comparison therefore come from one value in one build; there
|
|
is no second number that could drift. See org.apache.doris.jni.spi.SpiVersion.
|
|
|
|
Bump the MAJOR (and zero the minor) in the SAME commit as ANY change to the jni-spi
|
|
surface - adding an interface or a method counts, not only removing or changing one. That
|
|
definition is what makes a differing minor safe to ignore.
|
|
-->
|
|
<jni.plugin.api.version>6.0</jni.plugin.api.version>
|
|
</properties>
|
|
|
|
<build>
|
|
<plugins>
|
|
<!--
|
|
Stamps the declared JNI plugin API version into every jar built under this aggregator,
|
|
so a plugin carries the version it was compiled against without a per-module pom
|
|
change. The loader reads it back from the jar that defines the plugin's DorisPlugin.
|
|
Merges with (does not replace) the ASF parent's maven-jar-plugin <archive><manifest>
|
|
configuration.
|
|
-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
<configuration>
|
|
<archive>
|
|
<manifestEntries>
|
|
<Doris-Jni-Plugin-Api-Version>${jni.plugin.api.version}</Doris-Jni-Plugin-Api-Version>
|
|
</manifestEntries>
|
|
</archive>
|
|
</configuration>
|
|
</plugin>
|
|
<!--
|
|
Every module here that deploys as a plugin fills target/lib with copy-dependencies,
|
|
and build.sh copies target/lib/*.jar into the plugin directory verbatim. copy-
|
|
dependencies only ever adds: it never removes a jar the pom has stopped declaring. So
|
|
a working copy built twice without `mvn clean` - the normal way to iterate - deploys
|
|
the union of both dependency sets, and the second build's plugin directory is not the
|
|
one CI would produce from the same pom.
|
|
|
|
That difference runs the wrong way round. A dependency dropped or narrowed to test
|
|
scope keeps working locally, out of a jar nothing declares any more, while the clean
|
|
build that finds out is somebody else's. Wiping the directory in the phase before
|
|
copy-dependencies refills it makes an incremental build's plugin directory equal to a
|
|
clean one's.
|
|
|
|
Both executions are also forced under runAlways in fe/.mvn/maven-build-cache-config.xml.
|
|
A build-cache hit restores the module jar and nothing else, so without that a cache-
|
|
restored module has no target/lib at all: harmless on a working copy, which still
|
|
holds the directory its last real build wrote, but CI wipes target/ before every
|
|
build while the cache survives, and deployed every plugin empty.
|
|
-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-clean-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>wipe-plugin-lib</id>
|
|
<phase>prepare-package</phase>
|
|
<goals>
|
|
<goal>clean</goal>
|
|
</goals>
|
|
<configuration>
|
|
<!-- Only this directory. The default set is target/ as a whole, which
|
|
at prepare-package would delete the classes about to be jarred. -->
|
|
<excludeDefaultDirectories>true</excludeDefaultDirectories>
|
|
<filesets>
|
|
<fileset>
|
|
<directory>${project.build.directory}/lib</directory>
|
|
</fileset>
|
|
</filesets>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
</project>
|