This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1a250a66ec2 [refactor](fe) Add fe-foundation module with
zero-dependency JDK-only utilities (#61175)
1a250a66ec2 is described below
commit 1a250a66ec21cb08f5d4b3ab280c77da091802c0
Author: Calvin Kirs <[email protected]>
AuthorDate: Wed Mar 11 12:07:17 2026 +0800
[refactor](fe) Add fe-foundation module with zero-dependency JDK-only
utilities (#61175)
…
fe-common has accumulated heavy transitive dependencies (Guava, Hadoop,
Trino SPI, ANTLR, Alibaba SDK, etc.), making it unsuitable for
lightweight consumers such as SPI plugins and fe-extension modules. This
creates a new fe-foundation module that sits at the very bottom of the
FE dependency hierarchy (fe-foundation < fe-extension-spi < fe-common <
fe-core) and carries zero third-party compile dependencies.
Scope of this first iteration:
- Create the fe-foundation Maven module with zero-dependency pom.xml
- Move 10 pure-JDK utility classes from fe-common and fe-core into new
org.apache.doris.foundation.{format,property,type,util} packages:
FormatOptions, ResultOr, ConnectorProperty, ConnectorPropertiesUtils,
ParamRules, StoragePropertiesException, BitUtil, ByteBufferUtil,
PathUtils, SerializationUtils
- Replace trivial Guava/commons-lang3 usage in ConnectorPropertiesUtils
with JDK equivalents (Sets.newHashSet -> new HashSet, StringUtils ->
private isNotBlank method)
- Update all import statements across ~80 consuming files
- Add fe-foundation as dependency in fe-common and fe-core pom.xml
Classes intentionally left in fe-common for future phases:
- Pair/Triple: use Gson @SerializedName, persisted in editlog metadata
- Writable and IO interfaces: 194+ importers deeply embedded in the
persistence/catalog layer
### What problem does this PR solve?
---
fe/fe-core/pom.xml | 4 +
.../org/apache/doris/analysis/ArrayLiteral.java | 2 +-
.../org/apache/doris/analysis/BoolLiteral.java | 2 +-
.../java/org/apache/doris/analysis/BrokerDesc.java | 2 +-
.../java/org/apache/doris/analysis/CastExpr.java | 2 +-
.../org/apache/doris/analysis/DateLiteral.java | 2 +-
.../org/apache/doris/analysis/DecimalLiteral.java | 2 +-
.../main/java/org/apache/doris/analysis/Expr.java | 2 +-
.../org/apache/doris/analysis/FloatLiteral.java | 2 +-
.../org/apache/doris/analysis/IPv4Literal.java | 2 +-
.../org/apache/doris/analysis/IPv6Literal.java | 2 +-
.../org/apache/doris/analysis/JsonLiteral.java | 2 +-
.../org/apache/doris/analysis/LiteralExpr.java | 2 +-
.../java/org/apache/doris/analysis/MapLiteral.java | 2 +-
.../java/org/apache/doris/analysis/MaxLiteral.java | 2 +-
.../org/apache/doris/analysis/NullLiteral.java | 2 +-
.../org/apache/doris/analysis/PlaceHolderExpr.java | 2 +-
.../org/apache/doris/analysis/StringLiteral.java | 2 +-
.../org/apache/doris/analysis/StructLiteral.java | 2 +-
.../apache/doris/analysis/VarBinaryLiteral.java | 2 +-
.../org/apache/doris/common/util/LocationPath.java | 2 +-
.../org/apache/doris/common/util/PrintableMap.java | 2 +-
.../apache/doris/datasource/InternalCatalog.java | 2 +-
.../doris/datasource/hive/HMSTransaction.java | 2 +-
.../datasource/property/ConnectionProperties.java | 4 +-
.../metastore/AWSGlueMetaStoreBaseProperties.java | 6 +-
.../metastore/AbstractIcebergProperties.java | 2 +-
.../metastore/AbstractPaimonProperties.java | 2 +-
.../metastore/AliyunDLFBaseProperties.java | 8 +-
.../property/metastore/HMSBaseProperties.java | 6 +-
.../metastore/HiveGlueMetaStoreProperties.java | 2 +-
.../property/metastore/HiveHMSProperties.java | 2 +-
.../metastore/IcebergHMSMetaStoreProperties.java | 2 +-
.../metastore/IcebergJdbcMetaStoreProperties.java | 2 +-
.../property/metastore/IcebergRestProperties.java | 4 +-
.../metastore/PaimonHMSMetaStoreProperties.java | 2 +-
.../metastore/PaimonRestMetaStoreProperties.java | 4 +-
.../storage/AbstractS3CompatibleProperties.java | 4 +-
.../property/storage/AzureProperties.java | 4 +-
.../property/storage/AzurePropertyUtils.java | 2 +-
.../property/storage/BrokerProperties.java | 2 +-
.../datasource/property/storage/COSProperties.java | 2 +-
.../datasource/property/storage/GCSProperties.java | 2 +-
.../property/storage/HdfsProperties.java | 2 +-
.../property/storage/HdfsPropertiesUtils.java | 2 +-
.../property/storage/MinioProperties.java | 2 +-
.../datasource/property/storage/OBSProperties.java | 2 +-
.../property/storage/OSSHdfsProperties.java | 2 +-
.../datasource/property/storage/OSSProperties.java | 4 +-
.../property/storage/OzoneProperties.java | 2 +-
.../datasource/property/storage/S3Properties.java | 4 +-
.../property/storage/S3PropertyUtils.java | 2 +-
.../property/storage/StorageProperties.java | 4 +-
.../org/apache/doris/nereids/NereidsPlanner.java | 2 +-
.../org/apache/doris/nereids/StatementContext.java | 2 +-
.../nereids/trees/expressions/literal/Literal.java | 2 +-
.../trees/plans/commands/insert/InsertUtils.java | 2 +-
.../apache/doris/planner/GroupCommitPlanner.java | 2 +-
.../doris/planner/RuntimeFilterGenerator.java | 2 +-
.../java/org/apache/doris/qe/StmtExecutor.java | 2 +-
.../main/java/org/apache/doris/qe/VariableMgr.java | 2 +-
.../analysis/VarBinaryLiteralAnalysisTest.java | 2 +-
.../apache/doris/common/util/LocationPathTest.java | 2 +-
.../datasource/iceberg/IcebergTransactionTest.java | 2 +-
.../doris/datasource/property/ParamRulesTest.java | 191 ---------------------
.../metastore/AliyunDLFBasePropertiesTest.java | 4 +-
.../IcebergAliyunDLFMetaStorePropertiesTest.java | 2 +-
.../property/storage/AzurePropertiesTest.java | 2 +-
.../property/storage/AzurePropertyUtilsTest.java | 2 +-
.../property/storage/COSPropertiesTest.java | 2 +-
.../property/storage/HdfsPropertiesTest.java | 2 +-
.../property/storage/HdfsPropertiesUtilsTest.java | 2 +-
.../storage/S3ConnectorPropertiesUtilsTest.java | 2 +-
.../trees/expressions/VarBinaryLiteralTest.java | 2 +-
.../apache/doris/planner/HiveTableSinkTest.java | 2 +-
fe/fe-foundation/DESIGN.md | 172 +++++++++++++++++++
fe/fe-foundation/pom.xml | 78 +++++++++
.../doris/foundation/format}/FormatOptions.java | 2 +-
.../property/ConnectorPropertiesUtils.java | 24 +--
.../foundation}/property/ConnectorProperty.java | 2 +-
.../doris/foundation}/property/ParamRules.java | 2 +-
.../property}/StoragePropertiesException.java | 2 +-
.../apache/doris/foundation/type}/ResultOr.java | 2 +-
.../org/apache/doris/foundation}/util/BitUtil.java | 2 +-
.../doris/foundation}/util/ByteBufferUtil.java | 2 +-
.../apache/doris/foundation}/util/PathUtils.java | 2 +-
.../doris/foundation}/util/SerializationUtils.java | 2 +-
.../doris/foundation/format/FormatOptionsTest.java | 55 ++++++
.../property/ConnectorPropertiesUtilsTest.java | 65 +++++--
.../doris/foundation/property/ParamRulesTest.java | 167 ++++++++++++++++++
.../apache/doris/foundation/type/ResultOrTest.java | 56 ++++++
.../apache/doris/foundation/util/BitUtilTest.java | 47 +++++
.../doris/foundation/util/ByteBufferUtilTest.java | 50 ++++++
.../doris/foundation}/util/PathUtilsTest.java | 11 +-
.../foundation}/util/SerializationUtilsTest.java | 11 +-
fe/pom.xml | 6 +
96 files changed, 808 insertions(+), 325 deletions(-)
diff --git a/fe/fe-core/pom.xml b/fe/fe-core/pom.xml
index cace329dcbf..f1f4932381b 100644
--- a/fe/fe-core/pom.xml
+++ b/fe/fe-core/pom.xml
@@ -84,6 +84,10 @@ under the License.
</profile>
</profiles>
<dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>fe-foundation</artifactId>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fe-common</artifactId>
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/ArrayLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ArrayLiteral.java
index a4741ff7362..00a6d83d6be 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ArrayLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ArrayLiteral.java
@@ -20,7 +20,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.ArrayType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.commons.lang3.StringUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/BoolLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/BoolLiteral.java
index 4116994d843..501b3289f95 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BoolLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BoolLiteral.java
@@ -23,7 +23,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.gson.annotations.SerializedName;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
index 886ce5950e7..ede0706a22e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BrokerDesc.java
@@ -23,7 +23,7 @@ import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
import org.apache.doris.datasource.property.storage.BrokerProperties;
import org.apache.doris.datasource.property.storage.StorageProperties;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.doris.persist.gson.GsonUtils;
import org.apache.doris.thrift.TFileType;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
index 6fae80d12e5..4d814c5e63f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java
@@ -21,7 +21,7 @@
package org.apache.doris.analysis;
import org.apache.doris.catalog.Type;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.gson.annotations.SerializedName;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
index bcf36cbd83b..6d1f0224d6e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
@@ -24,8 +24,8 @@ import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.ScalarType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.InvalidFormatException;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.nereids.util.DateUtils;
import com.google.common.base.Preconditions;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DecimalLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/DecimalLiteral.java
index 0fa06466b9d..e86cf01577d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DecimalLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/DecimalLiteral.java
@@ -22,7 +22,7 @@ import org.apache.doris.catalog.ScalarType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.Config;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.qe.SessionVariable;
import com.google.common.base.Preconditions;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
index edb944ba632..77a8c61e237 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java
@@ -24,8 +24,8 @@ import org.apache.doris.catalog.AggStateType;
import org.apache.doris.catalog.Function;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.TreeNode;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.nereids.util.Utils;
import com.google.common.base.Joiner;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/FloatLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/FloatLiteral.java
index 978fa717736..79c15e0c475 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FloatLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FloatLiteral.java
@@ -20,7 +20,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import
org.apache.doris.nereids.trees.expressions.literal.format.FractionalFormat;
import com.google.gson.annotations.SerializedName;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java
index 8a014590a9c..9240ce66085 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv4Literal.java
@@ -19,7 +19,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.gson.annotations.SerializedName;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java
index 3b2c0cc5dae..d1149608da6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/IPv6Literal.java
@@ -19,7 +19,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.gson.annotations.SerializedName;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/JsonLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/JsonLiteral.java
index ca3ce7c4940..199c8502657 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/JsonLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/JsonLiteral.java
@@ -19,7 +19,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/LiteralExpr.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/LiteralExpr.java
index c1439465659..ba3a13b35b8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/LiteralExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/LiteralExpr.java
@@ -23,7 +23,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.common.base.Preconditions;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java
index a354e51c03a..59d751c6738 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/MapLiteral.java
@@ -20,7 +20,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.MapType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/MaxLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/MaxLiteral.java
index 4fbaaf7758e..3ea986dfa69 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/MaxLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/MaxLiteral.java
@@ -17,7 +17,7 @@
package org.apache.doris.analysis;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
public final class MaxLiteral extends LiteralExpr {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/NullLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/NullLiteral.java
index e4835865251..d5698141700 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/NullLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/NullLiteral.java
@@ -24,7 +24,7 @@ import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.FeConstants;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import java.nio.ByteBuffer;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java
index d538740b01a..53bc9af9239 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java
@@ -21,7 +21,7 @@ import org.apache.doris.catalog.MysqlColType;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.common.base.Preconditions;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java
index d67257927c2..c7fa50b6cf8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/StringLiteral.java
@@ -21,7 +21,7 @@
package org.apache.doris.analysis;
import org.apache.doris.catalog.Type;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.common.base.Preconditions;
import com.google.gson.annotations.SerializedName;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/StructLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/StructLiteral.java
index 754c1443f70..bdf09dfb6df 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/StructLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/StructLiteral.java
@@ -20,7 +20,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.StructType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.commons.lang3.StringUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/analysis/VarBinaryLiteral.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/VarBinaryLiteral.java
index e3c64215082..dd0e890150c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/VarBinaryLiteral.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/VarBinaryLiteral.java
@@ -19,7 +19,7 @@ package org.apache.doris.analysis;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import com.google.common.io.BaseEncoding;
import com.google.gson.annotations.SerializedName;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java
b/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java
index 1ce6576635d..c7558938711 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/LocationPath.java
@@ -20,7 +20,7 @@ package org.apache.doris.common.util;
import org.apache.doris.common.UserException;
import org.apache.doris.datasource.property.storage.AzurePropertyUtils;
import org.apache.doris.datasource.property.storage.StorageProperties;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.doris.fs.FileSystemType;
import org.apache.doris.fs.SchemaTypeMapper;
import org.apache.doris.thrift.TFileType;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PrintableMap.java
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PrintableMap.java
index 0f7d67c3454..33f87769296 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/PrintableMap.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/PrintableMap.java
@@ -18,7 +18,6 @@
package org.apache.doris.common.util;
import org.apache.doris.common.maxcompute.MCProperties;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
import
org.apache.doris.datasource.property.metastore.AWSGlueMetaStoreBaseProperties;
import org.apache.doris.datasource.property.metastore.AliyunDLFBaseProperties;
import org.apache.doris.datasource.property.storage.AzureProperties;
@@ -29,6 +28,7 @@ import
org.apache.doris.datasource.property.storage.OBSProperties;
import org.apache.doris.datasource.property.storage.OSSHdfsProperties;
import org.apache.doris.datasource.property.storage.OSSProperties;
import org.apache.doris.datasource.property.storage.S3Properties;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
import com.google.common.collect.Sets;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
index 293ddf85402..078cb84078c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java
@@ -98,7 +98,6 @@ import org.apache.doris.common.FeConstants;
import org.apache.doris.common.MarkedCountDownLatch;
import org.apache.doris.common.MetaNotFoundException;
import org.apache.doris.common.Pair;
-import org.apache.doris.common.ResultOr;
import org.apache.doris.common.UserException;
import org.apache.doris.common.io.CountingDataOutputStream;
import org.apache.doris.common.lock.MonitoredReentrantLock;
@@ -112,6 +111,7 @@ import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.common.util.Util;
import org.apache.doris.datasource.es.EsRepository;
import org.apache.doris.event.DropPartitionEvent;
+import org.apache.doris.foundation.type.ResultOr;
import org.apache.doris.mtmv.BaseTableInfo;
import org.apache.doris.mtmv.MTMVUtil;
import org.apache.doris.mysql.privilege.PrivPredicate;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java
index f7ff09dcdc0..0a7fe103427 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java
@@ -25,9 +25,9 @@ import org.apache.doris.backup.Status;
import org.apache.doris.common.Pair;
import org.apache.doris.common.UserException;
import org.apache.doris.common.profile.SummaryProfile;
-import org.apache.doris.common.util.PathUtils;
import org.apache.doris.datasource.NameMapping;
import org.apache.doris.datasource.statistics.CommonStatistics;
+import org.apache.doris.foundation.util.PathUtils;
import org.apache.doris.fs.FileSystem;
import org.apache.doris.fs.FileSystemProvider;
import org.apache.doris.fs.FileSystemUtil;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectionProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectionProperties.java
index 1247eabcc2a..916076c5123 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectionProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectionProperties.java
@@ -18,7 +18,9 @@
package org.apache.doris.datasource.property;
import org.apache.doris.common.CatalogConfigFileUtils;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AWSGlueMetaStoreBaseProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AWSGlueMetaStoreBaseProperties.java
index b17504fbca7..e24405d7826 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AWSGlueMetaStoreBaseProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AWSGlueMetaStoreBaseProperties.java
@@ -17,9 +17,9 @@
package org.apache.doris.datasource.property.metastore;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import org.apache.doris.datasource.property.ParamRules;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ParamRules;
import com.google.common.base.Strings;
import lombok.Getter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractIcebergProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractIcebergProperties.java
index 8123e698727..c566e3b8e5a 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractIcebergProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractIcebergProperties.java
@@ -20,10 +20,10 @@ package org.apache.doris.datasource.property.metastore;
import org.apache.doris.common.security.authentication.ExecutionAuthenticator;
import org.apache.doris.datasource.iceberg.IcebergExternalCatalog;
import org.apache.doris.datasource.metacache.CacheSpec;
-import org.apache.doris.datasource.property.ConnectorProperty;
import
org.apache.doris.datasource.property.storage.AbstractS3CompatibleProperties;
import org.apache.doris.datasource.property.storage.S3Properties;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractPaimonProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractPaimonProperties.java
index 7d0fca2446c..9c9631a516f 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractPaimonProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AbstractPaimonProperties.java
@@ -18,8 +18,8 @@
package org.apache.doris.datasource.property.metastore;
import org.apache.doris.common.security.authentication.ExecutionAuthenticator;
-import org.apache.doris.datasource.property.ConnectorProperty;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.collect.ImmutableList;
import lombok.Getter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AliyunDLFBaseProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AliyunDLFBaseProperties.java
index 8b3d6735fa7..a0066b28dcb 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AliyunDLFBaseProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/AliyunDLFBaseProperties.java
@@ -17,10 +17,10 @@
package org.apache.doris.datasource.property.metastore;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import org.apache.doris.datasource.property.ParamRules;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ParamRules;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import com.aliyun.datalake.metastore.common.DataLakeConfig;
import org.apache.commons.lang3.BooleanUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HMSBaseProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HMSBaseProperties.java
index 54019cffe31..75e5ef34a00 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HMSBaseProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HMSBaseProperties.java
@@ -22,9 +22,9 @@ import org.apache.doris.common.Config;
import org.apache.doris.common.security.authentication.AuthenticationConfig;
import org.apache.doris.common.security.authentication.HadoopAuthenticator;
import
org.apache.doris.common.security.authentication.KerberosAuthenticationConfig;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import org.apache.doris.datasource.property.ParamRules;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ParamRules;
import com.google.common.base.Strings;
import lombok.Getter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveGlueMetaStoreProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveGlueMetaStoreProperties.java
index 06cd55b431b..ea0f5437d6c 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveGlueMetaStoreProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveGlueMetaStoreProperties.java
@@ -17,8 +17,8 @@
package org.apache.doris.datasource.property.metastore;
-import org.apache.doris.datasource.property.ConnectorProperty;
import org.apache.doris.datasource.property.common.AwsCredentialsProviderMode;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.glue.catalog.util.AWSGlueConfig;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveHMSProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveHMSProperties.java
index 636759e33f6..5a22cfd7c95 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveHMSProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/HiveHMSProperties.java
@@ -19,7 +19,7 @@ package org.apache.doris.datasource.property.metastore;
import org.apache.doris.common.Config;
import
org.apache.doris.common.security.authentication.HadoopExecutionAuthenticator;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergHMSMetaStoreProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergHMSMetaStoreProperties.java
index 7484a529490..94c4d19f9eb 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergHMSMetaStoreProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergHMSMetaStoreProperties.java
@@ -19,8 +19,8 @@ package org.apache.doris.datasource.property.metastore;
import
org.apache.doris.common.security.authentication.HadoopExecutionAuthenticator;
import org.apache.doris.datasource.iceberg.IcebergExternalCatalog;
-import org.apache.doris.datasource.property.ConnectorProperty;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
import lombok.Getter;
import org.apache.commons.lang3.exception.ExceptionUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergJdbcMetaStoreProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergJdbcMetaStoreProperties.java
index ecd74ee5fe1..ea2cb0c5836 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergJdbcMetaStoreProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergJdbcMetaStoreProperties.java
@@ -19,8 +19,8 @@ package org.apache.doris.datasource.property.metastore;
import org.apache.doris.catalog.JdbcResource;
import org.apache.doris.datasource.iceberg.IcebergExternalCatalog;
-import org.apache.doris.datasource.property.ConnectorProperty;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.conf.Configuration;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergRestProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergRestProperties.java
index 7100d269262..887e6d49c5e 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergRestProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergRestProperties.java
@@ -18,9 +18,9 @@
package org.apache.doris.datasource.property.metastore;
import org.apache.doris.datasource.iceberg.IcebergExternalCatalog;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import org.apache.doris.datasource.property.ParamRules;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ParamRules;
import lombok.Getter;
import org.apache.hadoop.conf.Configuration;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonHMSMetaStoreProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonHMSMetaStoreProperties.java
index 24342fce457..e7e6689d3e3 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonHMSMetaStoreProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonHMSMetaStoreProperties.java
@@ -19,8 +19,8 @@ package org.apache.doris.datasource.property.metastore;
import
org.apache.doris.common.security.authentication.HadoopExecutionAuthenticator;
import org.apache.doris.datasource.paimon.PaimonExternalCatalog;
-import org.apache.doris.datasource.property.ConnectorProperty;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.hadoop.conf.Configuration;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonRestMetaStoreProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonRestMetaStoreProperties.java
index 85651a2dc83..465fc873b7c 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonRestMetaStoreProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonRestMetaStoreProperties.java
@@ -18,9 +18,9 @@
package org.apache.doris.datasource.property.metastore;
import org.apache.doris.datasource.paimon.PaimonExternalCatalog;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import org.apache.doris.datasource.property.ParamRules;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ParamRules;
import lombok.Getter;
import org.apache.paimon.catalog.Catalog;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AbstractS3CompatibleProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AbstractS3CompatibleProperties.java
index 7d7e5ffb1b6..113b9e78371 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AbstractS3CompatibleProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AbstractS3CompatibleProperties.java
@@ -18,9 +18,9 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import org.apache.doris.datasource.property.ConnectorProperty;
import org.apache.doris.datasource.property.common.AwsCredentialsProviderMode;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzureProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzureProperties.java
index b4848aa61b6..9a871235e47 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzureProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzureProperties.java
@@ -19,9 +19,9 @@ package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.Config;
import org.apache.doris.common.UserException;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import org.apache.doris.datasource.property.ParamRules;
import org.apache.doris.datasource.property.storage.exception.AzureAuthType;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ParamRules;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzurePropertyUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzurePropertyUtils.java
index 90152580701..a7086feda41 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzurePropertyUtils.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/AzurePropertyUtils.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.commons.lang3.StringUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/BrokerProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/BrokerProperties.java
index 2987eb762ae..a1c9b2e4d36 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/BrokerProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/BrokerProperties.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/COSProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/COSProperties.java
index 80c94fa3efd..e9f66572c96 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/COSProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/COSProperties.java
@@ -17,7 +17,7 @@
package org.apache.doris.datasource.property.storage;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/GCSProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/GCSProperties.java
index c8c878b4ce4..483ce490756 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/GCSProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/GCSProperties.java
@@ -17,7 +17,7 @@
package org.apache.doris.datasource.property.storage;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.collect.ImmutableSet;
import lombok.Getter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsProperties.java
index 1ef4c5f921d..ad696c1eb4f 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsProperties.java
@@ -19,7 +19,7 @@ package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
import org.apache.doris.common.security.authentication.HadoopAuthenticator;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtils.java
index 8f2e92d1e64..3a503217b28 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtils.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtils.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/MinioProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/MinioProperties.java
index cec9ca23e2d..c2c6a31ba57 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/MinioProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/MinioProperties.java
@@ -17,7 +17,7 @@
package org.apache.doris.datasource.property.storage;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.collect.ImmutableSet;
import lombok.Getter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OBSProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OBSProperties.java
index 2b2b886c524..6b3cafe99fd 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OBSProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OBSProperties.java
@@ -17,7 +17,7 @@
package org.apache.doris.datasource.property.storage;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSHdfsProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSHdfsProperties.java
index a461d644626..db84a15002d 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSHdfsProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSHdfsProperties.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.collect.ImmutableSet;
import lombok.Setter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
index a41f08b2401..c8fca077804 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
@@ -18,8 +18,8 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OzoneProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OzoneProperties.java
index 24d1079b998..dbcdab93be0 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OzoneProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OzoneProperties.java
@@ -17,7 +17,7 @@
package org.apache.doris.datasource.property.storage;
-import org.apache.doris.datasource.property.ConnectorProperty;
+import org.apache.doris.foundation.property.ConnectorProperty;
import com.google.common.collect.ImmutableSet;
import lombok.Getter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3Properties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3Properties.java
index 6bfb4f462ff..9b2aa2a8c11 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3Properties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3Properties.java
@@ -22,10 +22,10 @@ import
org.apache.doris.cloud.proto.Cloud.CredProviderTypePB;
import org.apache.doris.cloud.proto.Cloud.ObjectStoreInfoPB.Provider;
import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import org.apache.doris.datasource.property.ConnectorProperty;
import
org.apache.doris.datasource.property.common.AwsCredentialsProviderFactory;
import org.apache.doris.datasource.property.common.AwsCredentialsProviderMode;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.ConnectorProperty;
import org.apache.doris.thrift.TCredProviderType;
import org.apache.doris.thrift.TS3StorageParam;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3PropertyUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3PropertyUtils.java
index 4e64f13a635..887a9b25c54 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3PropertyUtils.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/S3PropertyUtils.java
@@ -19,7 +19,7 @@ package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
import org.apache.doris.common.util.S3URI;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java
index 687451ee1ba..724543353f2 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java
@@ -19,8 +19,8 @@ package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
import org.apache.doris.datasource.property.ConnectionProperties;
-import org.apache.doris.datasource.property.ConnectorProperty;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.ConnectorProperty;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import lombok.Getter;
import org.apache.commons.lang3.BooleanUtils;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java
index 8ba3cbca000..8a6aa282f49 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java
@@ -25,7 +25,6 @@ import org.apache.doris.catalog.Env;
import org.apache.doris.catalog.TableIf;
import org.apache.doris.common.Config;
import org.apache.doris.common.FeConstants;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.NereidsException;
import org.apache.doris.common.Pair;
import org.apache.doris.common.UserException;
@@ -33,6 +32,7 @@ import org.apache.doris.common.profile.SummaryProfile;
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.common.util.Util;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.mysql.FieldInfo;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.glue.LogicalPlanAdapter;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java
index dd2b1a61226..d938657d611 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java
@@ -27,13 +27,13 @@ import org.apache.doris.catalog.MaterializedIndexMeta;
import org.apache.doris.catalog.Partition;
import org.apache.doris.catalog.TableIf;
import org.apache.doris.catalog.View;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.Id;
import org.apache.doris.common.IdGenerator;
import org.apache.doris.common.Pair;
import org.apache.doris.datasource.mvcc.MvccSnapshot;
import org.apache.doris.datasource.mvcc.MvccTable;
import org.apache.doris.datasource.mvcc.MvccTableInfo;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.mtmv.BaseTableInfo;
import org.apache.doris.nereids.analyzer.UnboundRelation;
import org.apache.doris.nereids.exceptions.AnalysisException;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java
index 7a085d556fa..0a6fbada035 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java
@@ -23,7 +23,7 @@ import org.apache.doris.analysis.LiteralExpr;
import org.apache.doris.catalog.MysqlColType;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.Config;
-import org.apache.doris.common.util.ByteBufferUtil;
+import org.apache.doris.foundation.util.ByteBufferUtil;
import org.apache.doris.mysql.MysqlProto;
import org.apache.doris.nereids.exceptions.AnalysisException;
import org.apache.doris.nereids.exceptions.CastException;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
index b5561f0d77e..663c8e57d8b 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertUtils.java
@@ -26,10 +26,10 @@ import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Table;
import org.apache.doris.catalog.TableIf;
import org.apache.doris.common.Config;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.util.DebugPointUtil;
import org.apache.doris.datasource.hive.HMSExternalTable;
import org.apache.doris.datasource.jdbc.JdbcExternalTable;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.nereids.CascadesContext;
import org.apache.doris.nereids.analyzer.Scope;
import org.apache.doris.nereids.analyzer.UnboundAlias;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/GroupCommitPlanner.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/GroupCommitPlanner.java
index 4b70189c811..1a987405671 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/GroupCommitPlanner.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/GroupCommitPlanner.java
@@ -28,11 +28,11 @@ import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.ErrorCode;
import org.apache.doris.common.ErrorReport;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.LoadException;
import org.apache.doris.common.Pair;
import org.apache.doris.common.UserException;
import org.apache.doris.common.util.DebugUtil;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.nereids.StatementContext;
import org.apache.doris.nereids.load.NereidsStreamLoadPlanner;
import org.apache.doris.nereids.load.NereidsStreamLoadTask;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
index c934635738e..d79a2a13111 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/planner/RuntimeFilterGenerator.java
@@ -17,7 +17,7 @@
package org.apache.doris.planner;
-import org.apache.doris.common.util.BitUtil;
+import org.apache.doris.foundation.util.BitUtil;
import org.apache.doris.qe.SessionVariable;
/**
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index 33029cc9b37..3a42505ba50 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -46,7 +46,6 @@ import org.apache.doris.common.Config;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.ErrorCode;
import org.apache.doris.common.FeConstants;
-import org.apache.doris.common.FormatOptions;
import org.apache.doris.common.NereidsException;
import org.apache.doris.common.QueryTimeoutException;
import org.apache.doris.common.Status;
@@ -64,6 +63,7 @@ import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.common.util.Util;
import org.apache.doris.datasource.FileScanNode;
import org.apache.doris.datasource.tvf.source.TVFScanNode;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.metric.MetricRepo;
import org.apache.doris.mysql.FieldInfo;
import org.apache.doris.mysql.MysqlChannel;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
index c6f986875eb..25d9e59688a 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
@@ -32,7 +32,7 @@ import org.apache.doris.common.ErrorCode;
import org.apache.doris.common.ErrorReport;
import org.apache.doris.common.PatternMatcher;
import org.apache.doris.common.VariableAnnotation;
-import org.apache.doris.common.util.SerializationUtils;
+import org.apache.doris.foundation.util.SerializationUtils;
import org.apache.doris.nereids.trees.expressions.literal.Literal;
import org.apache.doris.persist.GlobalVarPersistInfo;
import org.apache.doris.statistics.StatisticConstants;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/analysis/VarBinaryLiteralAnalysisTest.java
b/fe/fe-core/src/test/java/org/apache/doris/analysis/VarBinaryLiteralAnalysisTest.java
index 0a6c82a45f8..c42a652e23b 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/analysis/VarBinaryLiteralAnalysisTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/analysis/VarBinaryLiteralAnalysisTest.java
@@ -17,7 +17,7 @@
package org.apache.doris.analysis;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.thrift.TExprNode;
import org.apache.doris.thrift.TExprNodeType;
import org.apache.doris.thrift.TVarBinaryLiteral;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java
b/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java
index 8a73619824c..170b0380874 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/common/util/LocationPathTest.java
@@ -19,7 +19,7 @@ package org.apache.doris.common.util;
import org.apache.doris.common.UserException;
import org.apache.doris.datasource.property.storage.StorageProperties;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.doris.fs.FileSystemType;
import org.apache.doris.thrift.TFileType;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergTransactionTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergTransactionTest.java
index 00e0bc69ec4..e3d224d5bba 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergTransactionTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergTransactionTest.java
@@ -19,9 +19,9 @@ package org.apache.doris.datasource.iceberg;
import org.apache.doris.common.UserException;
import org.apache.doris.common.security.authentication.ExecutionAuthenticator;
-import org.apache.doris.common.util.SerializationUtils;
import org.apache.doris.datasource.ExternalTable;
import org.apache.doris.datasource.NameMapping;
+import org.apache.doris.foundation.util.SerializationUtils;
import
org.apache.doris.nereids.trees.plans.commands.insert.IcebergInsertCommandContext;
import org.apache.doris.thrift.TFileContent;
import org.apache.doris.thrift.TIcebergCommitData;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/ParamRulesTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/ParamRulesTest.java
deleted file mode 100644
index 24fb075d15e..00000000000
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/ParamRulesTest.java
+++ /dev/null
@@ -1,191 +0,0 @@
-// 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.
-
-package org.apache.doris.datasource.property;
-
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.function.Executable;
-
-public class ParamRulesTest {
-
- @Test
- void testRequire_passesWhenValueIsPresent() {
- ParamRules rules = new ParamRules()
- .require("non-empty", "Field is required");
- Assertions.assertDoesNotThrow(new Executable() {
- @Override
- public void execute() {
- rules.validate();
- }
- });
- }
-
- @Test
- void testRequire_failsWhenValueIsMissing() {
- ParamRules rules = new ParamRules()
- .require(" ", "Field is required");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, new Executable() {
- @Override
- public void execute() {
- rules.validate();
- }
- });
- Assertions.assertEquals("Field is required", e.getMessage());
- }
-
- @Test
- void testMutuallyExclusive_passesWhenOnlyOneIsPresent() {
- ParamRules rules = new ParamRules()
- .mutuallyExclusive("value1", "", "Cannot be both set");
- Assertions.assertDoesNotThrow(() -> rules.validate());
- }
-
- @Test
- void testMutuallyExclusive_failsWhenBothArePresent() {
- ParamRules rules = new ParamRules()
- .mutuallyExclusive("val1", "val2", "Cannot be both set");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, () -> rules.validate());
- Assertions.assertEquals("Cannot be both set", e.getMessage());
- }
-
- @Test
- void testRequireIf_passesWhenConditionDoesNotMatch() {
- ParamRules rules = new ParamRules()
- .requireIf("simple", "kerberos", "", "Must be set when
kerberos");
- Assertions.assertDoesNotThrow(() -> rules.validate());
- }
-
- @Test
- void testRequireIf_passesWhenConditionMatchesAndRequiredIsPresent() {
- ParamRules rules = new ParamRules()
- .requireIf("kerberos", "kerberos", "keytab", "Must be set when
kerberos");
- Assertions.assertDoesNotThrow(() -> rules.validate());
- }
-
- @Test
- void testRequireIf_failsWhenConditionMatchesAndRequiredMissing() {
- ParamRules rules = new ParamRules()
- .requireIf("kerberos", "kerberos", "", "Must be set when
kerberos");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, () -> rules.validate());
- Assertions.assertEquals("Must be set when kerberos", e.getMessage());
- }
-
- @Test
- void testRequireAllIfPresent_passesWhenConditionAbsent() {
- ParamRules rules = new ParamRules()
- .requireAllIfPresent("", new String[]{"a", "b"}, "All
required");
- Assertions.assertDoesNotThrow(() -> rules.validate());
- }
-
- @Test
- void testRequireAllIfPresent_passesWhenAllArePresent() {
- ParamRules rules = new ParamRules()
- .requireAllIfPresent("condition", new String[]{"a", "b"}, "All
required");
- Assertions.assertDoesNotThrow(() -> rules.validate());
- }
-
- @Test
- void testRequireAllIfPresent_failsWhenAnyMissing() {
- ParamRules rules = new ParamRules()
- .requireAllIfPresent("set", new String[]{"a", ""}, "Missing
dependency");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, () -> rules.validate());
- Assertions.assertEquals("Missing dependency", e.getMessage());
- }
-
- @Test
- void testValidateWithPrefix() {
- ParamRules rules = new ParamRules()
- .require("", "Missing value");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class,
- () -> rules.validate("Config Error"));
- Assertions.assertEquals("Config Error: Missing value", e.getMessage());
- }
-
- @Test
- void testRequireTogether() {
- ParamRules rules = new ParamRules()
- .requireTogether(new String[]{"accessKey", ""}, "Both
accessKey and secretKey are required together");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class,
- () -> rules.validate());
- Assertions.assertEquals("Both accessKey and secretKey are required
together", e.getMessage());
- ParamRules rightRule = new ParamRules()
- .requireTogether(new String[]{"accessKey", "secretKey"}, "Both
accessKey and secretKey are required together");
- Assertions.assertDoesNotThrow(() -> rightRule.validate());
- }
-
- @Test
- void testAtLeastOne() {
- ParamRules rules = new ParamRules()
- .requireAtLeastOne(new String[]{""}, "At least one of
accessKey and iamrole is required");
- IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class,
- () -> rules.validate());
- Assertions.assertEquals("At least one of accessKey and iamrole is
required", e.getMessage());
- ParamRules rightRule1 = new ParamRules()
- .requireAtLeastOne(new String[]{"accessKey", "iamrole"}, "At
least one of accessKey and iamrole is required");
- Assertions.assertDoesNotThrow(() -> rightRule1.validate());
- ParamRules rightRule2 = new ParamRules()
- .requireAtLeastOne(new String[]{"accessKey", ""}, "At least
one of accessKey and iamrole is required");
- Assertions.assertDoesNotThrow(() -> rightRule2.validate());
- ParamRules rightRule3 = new ParamRules()
- .requireAtLeastOne(
- new String[]{"", "iamrole"}, "At least one of
accessKey and iamrole is required"
- );
- Assertions.assertDoesNotThrow(() -> rightRule3.validate());
- }
-
- @Test
- void testComplexLambdaValidation() {
- String username = "alice";
- String password = "";
- String email = "[email protected]";
- int age = 17;
- int maxAge = 100;
-
- ParamRules rules = new ParamRules();
-
- // Add multiple lambda rules
- rules.check(() -> username == null || username.isEmpty(), "Username
must not be empty")
- .check(() -> password == null || password.length() < 6,
"Password must be at least 6 characters")
- .check(() -> !email.contains("@"), "Email must be valid")
- .check(() -> age < 18 || age > maxAge, "Age must be between 18
and 100")
- .check(() -> username.equals(email), "Username and email
cannot be the same");
- // Validate with prefix message
- IllegalArgumentException ex =
Assertions.assertThrows(IllegalArgumentException.class,
- () -> rules.validate("Validation Failed"));
- // Check that the error message is prefixed
- assert ex.getMessage().startsWith("Validation Failed: ");
- }
-
- @Test
- void testComplexLambdaValidationSuccess() {
- String username = "alice";
- String password = "password123";
- String email = "[email protected]";
- int age = 25;
- int maxAge = 100;
- ParamRules rules = new ParamRules();
- // Should pass without exception
- Assertions.assertDoesNotThrow(() -> {
- rules.check(() -> username == null || username.isEmpty(),
"Username must not be empty")
- .check(() -> password == null || password.length() < 6,
"Password must be at least 6 characters")
- .check(() -> !email.contains("@"), "Email must be valid")
- .check(() -> age < 18 || age > maxAge, "Age must be
between 18 and 100")
- .check(() -> username.equals(email), "Username and email
cannot be the same");
- });
- }
-}
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/AliyunDLFBasePropertiesTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/AliyunDLFBasePropertiesTest.java
index ba28c4caab3..42862ef0c75 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/AliyunDLFBasePropertiesTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/AliyunDLFBasePropertiesTest.java
@@ -17,8 +17,8 @@
package org.apache.doris.datasource.property.metastore;
-import org.apache.doris.datasource.property.ConnectorPropertiesUtils;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.ConnectorPropertiesUtils;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/IcebergAliyunDLFMetaStorePropertiesTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/IcebergAliyunDLFMetaStorePropertiesTest.java
index 5c773967220..45deebe4b4a 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/IcebergAliyunDLFMetaStorePropertiesTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/IcebergAliyunDLFMetaStorePropertiesTest.java
@@ -19,7 +19,7 @@ package org.apache.doris.datasource.property.metastore;
import org.apache.doris.datasource.iceberg.dlf.DLFCatalog;
import org.apache.doris.datasource.property.storage.StorageProperties;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.iceberg.catalog.Catalog;
import org.junit.jupiter.api.Assertions;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertiesTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertiesTest.java
index 8171f33db40..be56b7b98f6 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertiesTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertiesTest.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.apache.hadoop.conf.Configuration;
import org.junit.jupiter.api.Assertions;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertyUtilsTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertyUtilsTest.java
index cbc584d9a10..2700262f81c 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertyUtilsTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/AzurePropertyUtilsTest.java
@@ -17,7 +17,7 @@
package org.apache.doris.datasource.property.storage;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/COSPropertiesTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/COSPropertiesTest.java
index ef0d5b46e24..33daf435d15 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/COSPropertiesTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/COSPropertiesTest.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import com.google.common.collect.Maps;
import org.junit.jupiter.api.Assertions;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesTest.java
index b8ba275e9cf..f50cceaf0dd 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesTest.java
@@ -21,7 +21,7 @@ import org.apache.doris.common.Config;
import org.apache.doris.common.UserException;
import
org.apache.doris.common.security.authentication.HadoopKerberosAuthenticator;
import
org.apache.doris.common.security.authentication.HadoopSimpleAuthenticator;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import com.google.common.collect.Maps;
import org.apache.hadoop.conf.Configuration;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtilsTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtilsTest.java
index eed7360206b..e54b55186f6 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtilsTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/HdfsPropertiesUtilsTest.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import com.google.common.collect.ImmutableSet;
import org.junit.jupiter.api.Assertions;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/S3ConnectorPropertiesUtilsTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/S3ConnectorPropertiesUtilsTest.java
index a1aba03d5aa..18414f47b36 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/S3ConnectorPropertiesUtilsTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/S3ConnectorPropertiesUtilsTest.java
@@ -18,7 +18,7 @@
package org.apache.doris.datasource.property.storage;
import org.apache.doris.common.UserException;
-import
org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
+import org.apache.doris.foundation.property.StoragePropertiesException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/VarBinaryLiteralTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/VarBinaryLiteralTest.java
index 51a21341b01..f584cc36c9f 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/VarBinaryLiteralTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/expressions/VarBinaryLiteralTest.java
@@ -22,7 +22,7 @@ import org.apache.doris.analysis.ExprToThriftVisitor;
import org.apache.doris.analysis.NullLiteral;
import org.apache.doris.analysis.ToSqlParams;
import org.apache.doris.analysis.VarBinaryLiteral;
-import org.apache.doris.common.FormatOptions;
+import org.apache.doris.foundation.format.FormatOptions;
import org.apache.doris.thrift.TExprNode;
import org.apache.doris.thrift.TExprNodeType;
import org.apache.doris.thrift.TVarBinaryLiteral;
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java
b/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java
index 8f4adff727c..8ade2d52d2b 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/HiveTableSinkTest.java
@@ -21,13 +21,13 @@ import org.apache.doris.catalog.Column;
import org.apache.doris.catalog.PrimitiveType;
import org.apache.doris.common.UserException;
import org.apache.doris.common.security.authentication.ExecutionAuthenticator;
-import org.apache.doris.common.util.PathUtils;
import org.apache.doris.datasource.hive.HMSCachedClient;
import org.apache.doris.datasource.hive.HMSExternalCatalog;
import org.apache.doris.datasource.hive.HMSExternalDatabase;
import org.apache.doris.datasource.hive.HMSExternalTable;
import org.apache.doris.datasource.hive.ThriftHMSCachedClient;
import org.apache.doris.datasource.property.storage.StorageProperties;
+import org.apache.doris.foundation.util.PathUtils;
import org.apache.doris.qe.ConnectContext;
import mockit.Mock;
diff --git a/fe/fe-foundation/DESIGN.md b/fe/fe-foundation/DESIGN.md
new file mode 100644
index 00000000000..7b4b4e32741
--- /dev/null
+++ b/fe/fe-foundation/DESIGN.md
@@ -0,0 +1,172 @@
+# fe-foundation Module Design Document
+
+## 1. Background & Motivation
+
+The existing `fe-common` module has accumulated heavy dependencies over time
(Guava, Hadoop,
+ANTLR, Alibaba MaxCompute SDK, etc.), making it unsuitable as a lightweight
shared library for the
+plugin/SPI ecosystem. When SPI plugin authors depend on `fe-common`, they are
forced to pull in
+dozens of transitive dependencies that have nothing to do with their plugin
logic.
+
+We need a **zero-dependency foundation module** that sits below `fe-common`
and `fe-extension-spi`
+in the dependency hierarchy, providing only the most essential,
general-purpose utilities that any
+module — including SPI plugins — can safely depend on.
+
+## 2. Naming Decision
+
+| Candidate | Verdict
|
+|------------------|-------------------------------------------------------------------------|
+| `fe-foundation` | **Chosen.** Clear "below-common" semantics. No ambiguity
with existing modules. |
+| `fe-base` | Too generic; widely used in other contexts.
|
+| `fe-essentials` | Good semantics but verbose.
|
+| `fe-primitives` | Implies primitive types; misleading.
|
+| `fe-toolkit` | "Toolkit" implies a heavier helper library rather than a
minimal foundation layer. |
+| `fe-kernel` | Conflicts with database "kernel" terminology.
|
+
+## 3. Module Positioning
+
+```
+fe-foundation ← Zero third-party dependencies. Pure JDK utilities.
+ │
+ ├── fe-extension-spi ← Plugin contracts (Plugin, PluginFactory,
PluginContext)
+ │ │
+ │ └── fe-extension-loader ← Plugin classloading & discovery
+ │
+ ├── fe-common ← Heavier shared code (Gson, Guava, Hadoop,
etc.)
+ │
+ └── fe-core ← Main FE module (optimizer, catalog,
transaction)
+```
+
+**Key principle:** `fe-foundation` has **ZERO** compile-scope third-party
dependencies. Only JDK.
+
+## 4. Admission Criteria
+
+A class qualifies for `fe-foundation` if it meets **ALL** of:
+
+1. **Zero third-party runtime dependencies** — only `java.*` imports
+2. **No coupling to Doris business logic** — no references to catalog,
optimizer, planner, etc.
+3. **General-purpose** — useful across multiple modules (SPI plugins,
fe-common, fe-core, etc.)
+4. **Stable API** — unlikely to change frequently
+
+## 5. Package Structure
+
+```
+org.apache.doris.foundation/
+├── property/
+│ ├── ConnectorProperty.java # @annotation: marks config fields
+│ ├── ConnectorPropertiesUtils.java # Reflection-based KV → Bean binder
+│ ├── StoragePropertiesException.java # Property-related RuntimeException
+│ └── ParamRules.java # Fluent parameter validation DSL
+├── type/
+│ └── ResultOr.java # Rust-style Result<T, E> type
+├── format/
+│ └── FormatOptions.java # Immutable data formatting config
+└── util/
+ ├── BitUtil.java # Bit manipulation helpers
+ ├── ByteBufferUtil.java # Unsigned ByteBuffer reads
+ ├── SerializationUtils.java # Deep clone via Java serialization
+ └── PathUtils.java # URI path comparison utilities
+```
+
+## 6. Classes Included (First Iteration)
+
+### 6.1 Property Framework (from fe-core)
+
+| Class | Original Location | External Deps | Description |
+|-------|-------------------|---------------|-------------|
+| `ConnectorProperty` | `o.a.d.datasource.property` | None | Runtime
annotation for connector config fields |
+| `ConnectorPropertiesUtils` | `o.a.d.datasource.property` | None
(Guava/commons-lang3 removed) | Reflection-based KV→Bean binding |
+| `ParamRules` | `o.a.d.datasource.property` | None | Fluent validation DSL
with chained rules |
+| `StoragePropertiesException` | `o.a.d.datasource.property.storage.exception`
| None | RuntimeException for property errors |
+
+### 6.2 Type Utilities (from fe-common)
+
+| Class | Original Location | External Deps | Description |
+|-------|-------------------|---------------|-------------|
+| `ResultOr<T,E>` | `o.a.d.common` | None | Success-or-error result type |
+
+### 6.3 Format Utilities (from fe-common)
+
+| Class | Original Location | External Deps | Description |
+|-------|-------------------|---------------|-------------|
+| `FormatOptions` | `o.a.d.common` | None | Immutable formatting configuration
|
+
+### 6.4 General Utilities (from fe-core)
+
+| Class | Original Location | External Deps | Description |
+|-------|-------------------|---------------|-------------|
+| `BitUtil` | `o.a.d.common.util` | None | log2, power-of-2 rounding |
+| `ByteBufferUtil` | `o.a.d.common.util` | None | Unsigned byte buffer reads |
+| `SerializationUtils` | `o.a.d.common.util` | None | Deep clone via
serialization |
+| `PathUtils` | `o.a.d.common.util` | None | URI path comparison with S3
handling |
+
+## 7. Classes NOT Included (and Why)
+
+| Class | Reason |
+|-------|--------|
+| `Pair`, `Triple` | Depend on `@SerializedName` (Gson) for persistence.
Moving would require adding Gson or breaking persistence compatibility. |
+| `Writable`, `Codec`, `CountingDataOutputStream`, `DataInputBuffer`,
`DataOutputBuffer`, etc. | Deeply embedded in the persistence layer (194+
importers for Writable). High-risk migration better done in a separate phase. |
+| `CloudCredential` | Depends on `commons-lang3`. Could be migrated after
trivial refactoring. |
+| `GZIPUtils`, `EnvUtils` | Depend on `commons-io` / Guava. Could be migrated
after trivial refactoring. |
+
+## 8. Serialization Safety Analysis
+
+All 10 classes are **SAFE** to move (package rename):
+
+- **None** implement `java.io.Serializable` (except
`StoragePropertiesException` via `Throwable`,
+ but it is never serialized to disk)
+- **None** are registered in `RuntimeTypeAdapterFactory` (no class name stored
in JSON)
+- **None** have `serialVersionUID`
+- All are either annotations, static utility classes, or transient runtime
objects
+- No class name is stored in any editlog, metadata image, or checkpoint
+
+## 9. Migration Strategy
+
+### Phase 1 (This PR): Backward-Compatible Migration
+
+1. Create `fe-foundation` module with zero dependencies
+2. Copy classes to new `org.apache.doris.foundation.*` packages
+3. In original locations, replace class bodies with **extends/delegation** to
the foundation class:
+ ```java
+ // fe-core: org.apache.doris.datasource.property.ParamRules
+ // Now just re-exports the foundation class
+ package org.apache.doris.datasource.property;
+ public class ParamRules extends
org.apache.doris.foundation.property.ParamRules {}
+ ```
+4. No existing code needs to change import statements
+5. New code should prefer importing from `org.apache.doris.foundation.*`
+
+### Phase 2 (Future): Gradually update imports across the codebase
+
+- Update import statements in fe-core to use foundation packages directly
+- Deprecate and eventually remove the re-export shims
+- Migrate more classes from fe-common (IO utilities, Pair/Triple after
decoupling Gson)
+
+## 10. Build Configuration
+
+```xml
+<!-- fe-foundation/pom.xml -->
+<artifactId>fe-foundation</artifactId>
+<packaging>jar</packaging>
+<name>Doris FE Foundation</name>
+<description>Zero-dependency foundation utilities for Doris FE modules and SPI
plugins</description>
+
+<dependencies>
+ <!-- Intentionally empty. This module has ZERO third-party dependencies.
-->
+</dependencies>
+```
+
+## 11. Dependency Graph After Migration
+
+```
+fe-foundation (0 deps)
+ ↑
+ ├── fe-extension-spi (depends on fe-foundation)
+ │ ↑
+ │ └── fe-extension-loader
+ │
+ ├── fe-common (depends on fe-foundation + Guava + Gson + Hadoop + ...)
+ │ ↑
+ │ └── fe-core
+ │
+ └── fe-core (depends on fe-foundation + fe-common + ...)
+```
diff --git a/fe/fe-foundation/pom.xml b/fe/fe-foundation/pom.xml
new file mode 100644
index 00000000000..2890ce4e43c
--- /dev/null
+++ b/fe/fe-foundation/pom.xml
@@ -0,0 +1,78 @@
+<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.doris</groupId>
+ <version>${revision}</version>
+ <artifactId>fe</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>fe-foundation</artifactId>
+ <packaging>jar</packaging>
+ <name>Doris FE Foundation</name>
+ <description>Zero-dependency foundation utilities for Doris FE modules and
SPI plugins</description>
+
+ <!-- Intentionally NO dependencies. This module depends only on JDK. -->
+
+ <build>
+ <finalName>doris-fe-foundation</finalName>
+ <directory>${project.basedir}/target/</directory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <attach>true</attach>
+ </configuration>
+ <executions>
+ <execution>
+ <id>create-source-jar</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ <goal>test-jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare-test-jar</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git
a/fe/fe-common/src/main/java/org/apache/doris/common/FormatOptions.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/format/FormatOptions.java
similarity index 98%
rename from
fe/fe-common/src/main/java/org/apache/doris/common/FormatOptions.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/format/FormatOptions.java
index 39d939a6a8e..a77f6c02c8c 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/FormatOptions.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/format/FormatOptions.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common;
+package org.apache.doris.foundation.format;
/**
* Format options for formatting literals in FE.
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectorPropertiesUtils.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ConnectorPropertiesUtils.java
similarity index 91%
rename from
fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectorPropertiesUtils.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ConnectorPropertiesUtils.java
index 35b8ce4e754..6be437c7ba4 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectorPropertiesUtils.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ConnectorPropertiesUtils.java
@@ -15,13 +15,11 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.datasource.property;
-
-import com.google.common.collect.Sets;
-import org.apache.commons.lang3.StringUtils;
+package org.apache.doris.foundation.property;
import java.lang.reflect.Field;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -72,7 +70,7 @@ public class ConnectorPropertiesUtils {
for (Field field : supportedProps) {
String matchedName = getMatchedPropertyName(field, props);
- if (StringUtils.isNotBlank(matchedName) &&
StringUtils.isNotBlank(props.get(matchedName))) {
+ if (isNotBlank(matchedName) && isNotBlank(props.get(matchedName)))
{
try {
Object rawValue = props.get(matchedName);
Object convertedValue = convertValue(rawValue,
field.getType());
@@ -101,7 +99,7 @@ public class ConnectorPropertiesUtils {
return null;
}
for (String name : annotation.names()) {
- if (StringUtils.isNotBlank(props.get(name))) {
+ if (isNotBlank(props.get(name))) {
return name;
}
}
@@ -150,11 +148,11 @@ public class ConnectorPropertiesUtils {
/**
* Return the sensitive keys of the give properties
*
- * @param clazz
- * @return
+ * @param clazz the class to inspect
+ * @return set of property name aliases marked as sensitive
*/
public static Set<String> getSensitiveKeys(Class<?> clazz) {
- Set<String> keys = Sets.newHashSet();
+ Set<String> keys = new HashSet<>();
List<Field> supportedProps = getConnectorProperties(clazz);
for (Field field : supportedProps) {
ConnectorProperty anno =
field.getAnnotation(ConnectorProperty.class);
@@ -166,5 +164,11 @@ public class ConnectorPropertiesUtils {
}
return keys;
}
-}
+ /**
+ * Checks if a string is not null, not empty, and not whitespace-only.
+ */
+ private static boolean isNotBlank(String s) {
+ return s != null && !s.trim().isEmpty();
+ }
+}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectorProperty.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ConnectorProperty.java
similarity index 96%
rename from
fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectorProperty.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ConnectorProperty.java
index 7078f6c61a3..96d607d7c76 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ConnectorProperty.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ConnectorProperty.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.datasource.property;
+package org.apache.doris.foundation.property;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ParamRules.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ParamRules.java
similarity index 99%
rename from
fe/fe-core/src/main/java/org/apache/doris/datasource/property/ParamRules.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ParamRules.java
index bc364897f6b..f8f02b32539 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/ParamRules.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/ParamRules.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.datasource.property;
+package org.apache.doris.foundation.property;
import java.util.ArrayList;
import java.util.List;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/exception/StoragePropertiesException.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/StoragePropertiesException.java
similarity index 96%
rename from
fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/exception/StoragePropertiesException.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/StoragePropertiesException.java
index 00d8c46411f..f8d12fdba4e 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/exception/StoragePropertiesException.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/property/StoragePropertiesException.java
@@ -22,7 +22,7 @@
* an error message, and another that also accepts a cause exception.
*/
-package org.apache.doris.datasource.property.storage.exception;
+package org.apache.doris.foundation.property;
public class StoragePropertiesException extends RuntimeException {
diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/ResultOr.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/type/ResultOr.java
similarity index 97%
rename from fe/fe-common/src/main/java/org/apache/doris/common/ResultOr.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/type/ResultOr.java
index 40909e98229..143b765b5ec 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/common/ResultOr.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/type/ResultOr.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common;
+package org.apache.doris.foundation.type;
public class ResultOr<T, E> {
private final T value;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/BitUtil.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/BitUtil.java
similarity index 97%
rename from fe/fe-core/src/main/java/org/apache/doris/common/util/BitUtil.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/BitUtil.java
index 84c4ec111a1..fa83d0fb1b1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/BitUtil.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/BitUtil.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common.util;
+package org.apache.doris.foundation.util;
public class BitUtil {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/ByteBufferUtil.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/ByteBufferUtil.java
similarity index 96%
rename from
fe/fe-core/src/main/java/org/apache/doris/common/util/ByteBufferUtil.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/ByteBufferUtil.java
index 4ec8f01149a..9568e6b3a92 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/ByteBufferUtil.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/ByteBufferUtil.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common.util;
+package org.apache.doris.foundation.util;
import java.nio.ByteBuffer;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PathUtils.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/PathUtils.java
similarity index 98%
rename from fe/fe-core/src/main/java/org/apache/doris/common/util/PathUtils.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/PathUtils.java
index dd4ca93e2ca..954d4c5bddd 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/common/util/PathUtils.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/PathUtils.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common.util;
+package org.apache.doris.foundation.util;
import java.net.URI;
import java.net.URISyntaxException;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/common/util/SerializationUtils.java
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/SerializationUtils.java
similarity index 98%
rename from
fe/fe-core/src/main/java/org/apache/doris/common/util/SerializationUtils.java
rename to
fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/SerializationUtils.java
index cc18bcb0a10..131eddd0a97 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/common/util/SerializationUtils.java
+++
b/fe/fe-foundation/src/main/java/org/apache/doris/foundation/util/SerializationUtils.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common.util;
+package org.apache.doris.foundation.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
diff --git
a/fe/fe-foundation/src/test/java/org/apache/doris/foundation/format/FormatOptionsTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/format/FormatOptionsTest.java
new file mode 100644
index 00000000000..e14203aa22a
--- /dev/null
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/format/FormatOptionsTest.java
@@ -0,0 +1,55 @@
+// 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.
+
+package org.apache.doris.foundation.format;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class FormatOptionsTest {
+
+ @Test
+ public void testDefaultOptions() {
+ FormatOptions options = FormatOptions.getDefault();
+ Assertions.assertEquals("\"", options.getNestedStringWrapper());
+ Assertions.assertEquals(":", options.getMapKeyDelim());
+ Assertions.assertEquals("null", options.getNullFormat());
+ Assertions.assertEquals(", ", options.getCollectionDelim());
+ Assertions.assertTrue(options.isBoolValueNum());
+ Assertions.assertEquals(0, options.level);
+ }
+
+ @Test
+ public void testPrestoOptions() {
+ FormatOptions options = FormatOptions.getForPresto();
+ Assertions.assertEquals("", options.getNestedStringWrapper());
+ Assertions.assertEquals("=", options.getMapKeyDelim());
+ Assertions.assertEquals("NULL", options.getNullFormat());
+ Assertions.assertEquals(", ", options.getCollectionDelim());
+ Assertions.assertTrue(options.isBoolValueNum());
+ }
+
+ @Test
+ public void testHiveOptions() {
+ FormatOptions options = FormatOptions.getForHive();
+ Assertions.assertEquals("\"", options.getNestedStringWrapper());
+ Assertions.assertEquals(":", options.getMapKeyDelim());
+ Assertions.assertEquals("null", options.getNullFormat());
+ Assertions.assertEquals(",", options.getCollectionDelim());
+ Assertions.assertFalse(options.isBoolValueNum());
+ }
+}
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/ConnectorPropertiesUtilsTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/property/ConnectorPropertiesUtilsTest.java
similarity index 67%
rename from
fe/fe-core/src/test/java/org/apache/doris/datasource/property/ConnectorPropertiesUtilsTest.java
rename to
fe/fe-foundation/src/test/java/org/apache/doris/foundation/property/ConnectorPropertiesUtilsTest.java
index 3490a5c6ae0..6880a5f3ac0 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/ConnectorPropertiesUtilsTest.java
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/property/ConnectorPropertiesUtilsTest.java
@@ -15,35 +15,39 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.datasource.property;
+package org.apache.doris.foundation.property;
-import org.apache.doris.nereids.types.UnsupportedType;
-
-import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.Set;
public class ConnectorPropertiesUtilsTest {
@Test
void testBasicBinding() {
Map<String, String> props = new HashMap<>();
+ props.put("base.key", "base");
props.put("string.key", "hello");
props.put("int.key", "123");
props.put("bool.key", "true");
props.put("long.key", "456");
props.put("double.key", "3.14");
+ props.put("secret.key", "sensitive");
SampleConfig config = new SampleConfig();
ConnectorPropertiesUtils.bindConnectorProperties(config, props);
+ Assertions.assertEquals("base", config.getBaseValue());
Assertions.assertEquals("hello", config.getStringValue());
Assertions.assertEquals(123, config.getIntValue());
Assertions.assertTrue(config.isBoolValue());
Assertions.assertEquals(456L, config.getLongValue());
Assertions.assertEquals(3.14, config.getDoubleValue(), 0.0001);
+ Assertions.assertEquals("sensitive", config.getSecretValue());
}
@Test
@@ -65,7 +69,7 @@ public class ConnectorPropertiesUtilsTest {
SampleConfig config = new SampleConfig();
ConnectorPropertiesUtils.bindConnectorProperties(config, props);
- Assertions.assertEquals("default", config.getGlueCatalogId()); // not
overridden
+ Assertions.assertEquals("default", config.getGlueCatalogId());
}
@Test
@@ -75,6 +79,7 @@ public class ConnectorPropertiesUtilsTest {
Assertions.assertNull(config.getStringValue());
Assertions.assertEquals(0, config.getIntValue());
+ Assertions.assertNull(config.getBaseValue());
}
@Test
@@ -83,26 +88,48 @@ public class ConnectorPropertiesUtilsTest {
props.put("unsupported.key", "something");
SampleConfig config = new SampleConfig();
- RuntimeException ex = Assertions.assertThrows(RuntimeException.class,
() -> {
- ConnectorPropertiesUtils.bindConnectorProperties(config, props);
- });
+ RuntimeException ex = Assertions.assertThrows(RuntimeException.class,
+ () -> ConnectorPropertiesUtils.bindConnectorProperties(config,
props));
Assertions.assertTrue(ex.getMessage().contains("Unsupported property
type"));
}
@Test
- void testPartialBindingWithTypeErrorIgnored() {
+ void testPartialBindingWithTypeErrorThrowsException() {
Map<String, String> props = new HashMap<>();
props.put("int.key", "not-a-number");
SampleConfig config = new SampleConfig();
- Assertions.assertThrows(RuntimeException.class, () -> {
- ConnectorPropertiesUtils.bindConnectorProperties(config, props);
- });
+ Assertions.assertThrows(RuntimeException.class,
+ () -> ConnectorPropertiesUtils.bindConnectorProperties(config,
props));
+ }
+
+ @Test
+ void testGetConnectorPropertiesIncludesSuperclassFields() {
+ List<java.lang.reflect.Field> fields =
ConnectorPropertiesUtils.getConnectorProperties(SampleConfig.class);
+ Assertions.assertTrue(fields.stream().anyMatch(field ->
field.getName().equals("baseValue")));
+ Assertions.assertTrue(fields.stream().anyMatch(field ->
field.getName().equals("stringValue")));
+ Assertions.assertFalse(fields.stream().anyMatch(field ->
field.getName().equals("glueCatalogId")));
+ }
+
+ @Test
+ void testGetSensitiveKeys() {
+ Set<String> keys =
ConnectorPropertiesUtils.getSensitiveKeys(SampleConfig.class);
+ Assertions.assertTrue(keys.contains("secret.key"));
+ Assertions.assertTrue(keys.contains("secret.alias"));
+ Assertions.assertFalse(keys.contains("string.key"));
}
- public class SampleConfig {
+ static class BaseConfig {
+ @ConnectorProperty(names = {"base.key"})
+ private String baseValue;
+ String getBaseValue() {
+ return baseValue;
+ }
+ }
+
+ static class SampleConfig extends BaseConfig {
@ConnectorProperty(names = {"string.key"})
private String stringValue;
@@ -125,7 +152,10 @@ public class ConnectorPropertiesUtilsTest {
private String glueCatalogId = "default";
@ConnectorProperty(names = {"unsupported.key"})
- private UnsupportedType unsupportedField;
+ private UnsupportedFieldType unsupportedField;
+
+ @ConnectorProperty(names = {"secret.key", "secret.alias"}, sensitive =
true)
+ private String secretValue;
public String getStringValue() {
return stringValue;
@@ -155,10 +185,15 @@ public class ConnectorPropertiesUtilsTest {
return glueCatalogId;
}
- public UnsupportedType getUnsupportedField() {
+ public UnsupportedFieldType getUnsupportedField() {
return unsupportedField;
}
+ public String getSecretValue() {
+ return secretValue;
+ }
}
+ static class UnsupportedFieldType {
+ }
}
diff --git
a/fe/fe-foundation/src/test/java/org/apache/doris/foundation/property/ParamRulesTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/property/ParamRulesTest.java
new file mode 100644
index 00000000000..8f9ce9f425d
--- /dev/null
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/property/ParamRulesTest.java
@@ -0,0 +1,167 @@
+// 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.
+
+package org.apache.doris.foundation.property;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class ParamRulesTest {
+
+ @Test
+ void testRequirePassesWhenValueIsPresent() {
+ ParamRules rules = new ParamRules().require("non-empty", "Field is
required");
+ Assertions.assertDoesNotThrow(() -> rules.validate());
+ }
+
+ @Test
+ void testRequireFailsWhenValueIsMissing() {
+ ParamRules rules = new ParamRules().require(" ", "Field is required");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, rules::validate);
+ Assertions.assertEquals("Field is required", e.getMessage());
+ }
+
+ @Test
+ void testMutuallyExclusivePassesWhenOnlyOneIsPresent() {
+ ParamRules rules = new ParamRules().mutuallyExclusive("value1", "",
"Cannot be both set");
+ Assertions.assertDoesNotThrow(() -> rules.validate());
+ }
+
+ @Test
+ void testMutuallyExclusiveFailsWhenBothArePresent() {
+ ParamRules rules = new ParamRules().mutuallyExclusive("val1", "val2",
"Cannot be both set");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, rules::validate);
+ Assertions.assertEquals("Cannot be both set", e.getMessage());
+ }
+
+ @Test
+ void testRequireIfPassesWhenConditionDoesNotMatch() {
+ ParamRules rules = new ParamRules().requireIf("simple", "kerberos",
"", "Must be set when kerberos");
+ Assertions.assertDoesNotThrow(() -> rules.validate());
+ }
+
+ @Test
+ void testRequireIfPassesWhenConditionMatchesAndRequiredIsPresent() {
+ ParamRules rules = new ParamRules().requireIf("kerberos", "kerberos",
"keytab", "Must be set when kerberos");
+ Assertions.assertDoesNotThrow(() -> rules.validate());
+ }
+
+ @Test
+ void testRequireIfFailsWhenConditionMatchesAndRequiredMissing() {
+ ParamRules rules = new ParamRules().requireIf("kerberos", "kerberos",
"", "Must be set when kerberos");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, rules::validate);
+ Assertions.assertEquals("Must be set when kerberos", e.getMessage());
+ }
+
+ @Test
+ void testRequireAllIfPresentPassesWhenConditionAbsent() {
+ ParamRules rules = new ParamRules().requireAllIfPresent("", new
String[] {"a", "b"}, "All required");
+ Assertions.assertDoesNotThrow(() -> rules.validate());
+ }
+
+ @Test
+ void testRequireAllIfPresentPassesWhenAllArePresent() {
+ ParamRules rules = new ParamRules().requireAllIfPresent("condition",
new String[] {"a", "b"}, "All required");
+ Assertions.assertDoesNotThrow(() -> rules.validate());
+ }
+
+ @Test
+ void testRequireAllIfPresentFailsWhenAnyMissing() {
+ ParamRules rules = new ParamRules().requireAllIfPresent("set", new
String[] {"a", ""}, "Missing dependency");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, rules::validate);
+ Assertions.assertEquals("Missing dependency", e.getMessage());
+ }
+
+ @Test
+ void testValidateWithPrefix() {
+ ParamRules rules = new ParamRules().require("", "Missing value");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class,
+ () -> rules.validate("Config Error"));
+ Assertions.assertEquals("Config Error: Missing value", e.getMessage());
+ }
+
+ @Test
+ void testRequireTogether() {
+ ParamRules rules = new ParamRules()
+ .requireTogether(new String[] {"accessKey", ""}, "Both
accessKey and secretKey are required together");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, rules::validate);
+ Assertions.assertEquals("Both accessKey and secretKey are required
together", e.getMessage());
+
+ ParamRules rightRule = new ParamRules().requireTogether(
+ new String[] {"accessKey", "secretKey"},
+ "Both accessKey and secretKey are required together");
+ Assertions.assertDoesNotThrow(() -> rightRule.validate());
+ }
+
+ @Test
+ void testRequireAtLeastOne() {
+ ParamRules rules = new ParamRules()
+ .requireAtLeastOne(new String[] {""}, "At least one of
accessKey and iamrole is required");
+ IllegalArgumentException e =
Assertions.assertThrows(IllegalArgumentException.class, rules::validate);
+ Assertions.assertEquals("At least one of accessKey and iamrole is
required", e.getMessage());
+
+ Assertions.assertDoesNotThrow(() -> new ParamRules()
+ .requireAtLeastOne(new String[] {"accessKey", "iamrole"},
+ "At least one of accessKey and iamrole is required")
+ .validate());
+ Assertions.assertDoesNotThrow(() -> new ParamRules()
+ .requireAtLeastOne(new String[] {"accessKey", ""},
+ "At least one of accessKey and iamrole is required")
+ .validate());
+ Assertions.assertDoesNotThrow(() -> new ParamRules()
+ .requireAtLeastOne(new String[] {"", "iamrole"},
+ "At least one of accessKey and iamrole is required")
+ .validate());
+ }
+
+ @Test
+ void testComplexLambdaValidation() {
+ String username = "alice";
+ String password = "";
+ String email = "[email protected]";
+ int age = 17;
+ int maxAge = 100;
+
+ ParamRules rules = new ParamRules();
+ rules.check(() -> username == null || username.isEmpty(), "Username
must not be empty")
+ .check(() -> password == null || password.length() < 6,
"Password must be at least 6 characters")
+ .check(() -> !email.contains("@"), "Email must be valid")
+ .check(() -> age < 18 || age > maxAge, "Age must be between 18
and 100")
+ .check(() -> username.equals(email), "Username and email
cannot be the same");
+
+ IllegalArgumentException ex =
Assertions.assertThrows(IllegalArgumentException.class,
+ () -> rules.validate("Validation Failed"));
+ Assertions.assertTrue(ex.getMessage().startsWith("Validation Failed:
"));
+ }
+
+ @Test
+ void testComplexLambdaValidationSuccess() {
+ String username = "alice";
+ String password = "password123";
+ String email = "[email protected]";
+ int age = 25;
+ int maxAge = 100;
+
+ Assertions.assertDoesNotThrow(() -> new ParamRules()
+ .check(() -> username == null || username.isEmpty(), "Username
must not be empty")
+ .check(() -> password == null || password.length() < 6,
"Password must be at least 6 characters")
+ .check(() -> !email.contains("@"), "Email must be valid")
+ .check(() -> age < 18 || age > maxAge, "Age must be between 18
and 100")
+ .check(() -> username.equals(email), "Username and email
cannot be the same")
+ .validate());
+ }
+}
diff --git
a/fe/fe-foundation/src/test/java/org/apache/doris/foundation/type/ResultOrTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/type/ResultOrTest.java
new file mode 100644
index 00000000000..116675723ac
--- /dev/null
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/type/ResultOrTest.java
@@ -0,0 +1,56 @@
+// 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.
+
+package org.apache.doris.foundation.type;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class ResultOrTest {
+
+ @Test
+ public void testOk() {
+ ResultOr<String, String> result = ResultOr.ok("value");
+ Assertions.assertTrue(result.isOk());
+ Assertions.assertFalse(result.isErr());
+ Assertions.assertEquals("value", result.unwrap());
+ Assertions.assertEquals("Ok(value)", result.toString());
+ }
+
+ @Test
+ public void testErr() {
+ ResultOr<String, String> result = ResultOr.err("boom");
+ Assertions.assertTrue(result.isErr());
+ Assertions.assertFalse(result.isOk());
+ Assertions.assertEquals("boom", result.unwrapErr());
+ Assertions.assertEquals("Err(boom)", result.toString());
+ }
+
+ @Test
+ public void testUnwrapErrOnOkThrows() {
+ ResultOr<String, String> result = ResultOr.ok("value");
+ IllegalStateException ex =
Assertions.assertThrows(IllegalStateException.class, result::unwrapErr);
+ Assertions.assertEquals("Tried to unwrapOk", ex.getMessage());
+ }
+
+ @Test
+ public void testUnwrapOnErrThrows() {
+ ResultOr<String, String> result = ResultOr.err("boom");
+ IllegalStateException ex =
Assertions.assertThrows(IllegalStateException.class, result::unwrap);
+ Assertions.assertEquals("Tried to unwrap Err: boom", ex.getMessage());
+ }
+}
diff --git
a/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/BitUtilTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/BitUtilTest.java
new file mode 100644
index 00000000000..5adb873d1f2
--- /dev/null
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/BitUtilTest.java
@@ -0,0 +1,47 @@
+// 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.
+
+package org.apache.doris.foundation.util;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class BitUtilTest {
+
+ @Test
+ public void testLog2Ceiling() {
+ Assertions.assertEquals(0, BitUtil.log2Ceiling(1));
+ Assertions.assertEquals(1, BitUtil.log2Ceiling(2));
+ Assertions.assertEquals(2, BitUtil.log2Ceiling(3));
+ Assertions.assertEquals(3, BitUtil.log2Ceiling(8));
+ }
+
+ @Test
+ public void testRoundUpToPowerOf2() {
+ Assertions.assertEquals(1, BitUtil.roundUpToPowerOf2(1));
+ Assertions.assertEquals(4, BitUtil.roundUpToPowerOf2(3));
+ Assertions.assertEquals(8, BitUtil.roundUpToPowerOf2(8));
+ Assertions.assertEquals(16, BitUtil.roundUpToPowerOf2(9));
+ }
+
+ @Test
+ public void testRoundUpToPowerOf2Factor() {
+ Assertions.assertEquals(16, BitUtil.roundUpToPowerOf2Factor(13, 8));
+ Assertions.assertEquals(16, BitUtil.roundUpToPowerOf2Factor(16, 8));
+ Assertions.assertEquals(24, BitUtil.roundUpToPowerOf2Factor(17, 8));
+ }
+}
diff --git
a/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/ByteBufferUtilTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/ByteBufferUtilTest.java
new file mode 100644
index 00000000000..4b333ca87ae
--- /dev/null
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/ByteBufferUtilTest.java
@@ -0,0 +1,50 @@
+// 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.
+
+package org.apache.doris.foundation.util;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.nio.ByteBuffer;
+
+public class ByteBufferUtilTest {
+
+ @Test
+ public void testGetUnsignedByte() {
+ ByteBuffer buffer = ByteBuffer.wrap(new byte[] {(byte) 0xFF});
+ Assertions.assertEquals(255, ByteBufferUtil.getUnsignedByte(buffer));
+ Assertions.assertEquals(1, buffer.position());
+ }
+
+ @Test
+ public void testGetUnsignedShort() {
+ ByteBuffer buffer = ByteBuffer.wrap(new byte[] {(byte) 0xFF, (byte)
0xFE});
+ Assertions.assertEquals(65534,
ByteBufferUtil.getUnsignedShort(buffer));
+ Assertions.assertEquals(2, buffer.position());
+ }
+
+ @Test
+ public void testGetUnsignedInt() {
+ ByteBuffer buffer = ByteBuffer.allocate(Integer.BYTES);
+ buffer.putInt(0x89ABCDEF);
+ buffer.flip();
+
+ Assertions.assertEquals(2309737967L,
ByteBufferUtil.getUnsignedInt(buffer));
+ Assertions.assertEquals(Integer.BYTES, buffer.position());
+ }
+}
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/common/util/PathUtilsTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/PathUtilsTest.java
similarity index 89%
rename from
fe/fe-core/src/test/java/org/apache/doris/common/util/PathUtilsTest.java
rename to
fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/PathUtilsTest.java
index 86a007e9b4c..c239b47b95a 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/common/util/PathUtilsTest.java
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/PathUtilsTest.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common.util;
+package org.apache.doris.foundation.util;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.Test;
public class PathUtilsTest {
@Test
- public void testEqualsIgnoreScheme_sameHostAndPath() {
+ public void testEqualsIgnoreSchemeSameHostAndPath() {
Assertions.assertTrue(PathUtils.equalsIgnoreSchemeIfOneIsS3(
"s3://my-bucket/data/file.txt",
"cos://my-bucket/data/file.txt"
@@ -45,7 +45,7 @@ public class PathUtilsTest {
}
@Test
- public void testEqualsIgnoreScheme_differentHost() {
+ public void testEqualsIgnoreSchemeDifferentHost() {
Assertions.assertFalse(PathUtils.equalsIgnoreSchemeIfOneIsS3(
"s3://bucket-a/data/file.txt",
"cos://bucket-b/data/file.txt"
@@ -58,7 +58,7 @@ public class PathUtilsTest {
}
@Test
- public void testEqualsIgnoreScheme_trailingSlash() {
+ public void testEqualsIgnoreSchemeTrailingSlash() {
Assertions.assertFalse(PathUtils.equalsIgnoreSchemeIfOneIsS3(
"oss://bucket/data/",
"oss://bucket/data"
@@ -71,8 +71,7 @@ public class PathUtilsTest {
}
@Test
- public void testEqualsIgnoreScheme_invalidURI() {
- // Special characters that break URI parsing
+ public void testEqualsIgnoreSchemeInvalidUri() {
Assertions.assertFalse(PathUtils.equalsIgnoreSchemeIfOneIsS3(
"s3://bucket/data file.txt",
"cos://bucket/data file.txt"
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/common/util/SerializationUtilsTest.java
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/SerializationUtilsTest.java
similarity index 91%
rename from
fe/fe-core/src/test/java/org/apache/doris/common/util/SerializationUtilsTest.java
rename to
fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/SerializationUtilsTest.java
index 345fa4c5060..1fb899aed60 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/common/util/SerializationUtilsTest.java
+++
b/fe/fe-foundation/src/test/java/org/apache/doris/foundation/util/SerializationUtilsTest.java
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-package org.apache.doris.common.util;
+package org.apache.doris.foundation.util;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -26,7 +26,6 @@ import java.util.Objects;
public class SerializationUtilsTest {
-
private final HashMap<String, Object> sampleMap = new HashMap<>();
private final String sampleString = "sampleString";
private final Integer sampleInteger = 456;
@@ -38,12 +37,12 @@ public class SerializationUtilsTest {
@Test
public void testClone() {
- final Object clonedObject = SerializationUtils.clone(sampleMap);
+ Object clonedObject = SerializationUtils.clone(sampleMap);
Assertions.assertNotNull(clonedObject);
Assertions.assertTrue(clonedObject instanceof HashMap<?, ?>);
Assertions.assertNotSame(clonedObject, sampleMap);
- final HashMap<?, ?> clonedMap = (HashMap<?, ?>) clonedObject;
+ HashMap<?, ?> clonedMap = (HashMap<?, ?>) clonedObject;
Assertions.assertEquals(sampleString, clonedMap.get("KEY_ONE"));
Assertions.assertNotSame(sampleString, clonedMap.get("KEY_ONE"));
Assertions.assertEquals(sampleInteger, clonedMap.get("KEY_TWO"));
@@ -53,8 +52,7 @@ public class SerializationUtilsTest {
@Test
public void testCloneNull() {
- final Object clonedObject = SerializationUtils.clone(null);
- Assertions.assertNull(clonedObject);
+ Assertions.assertNull(SerializationUtils.clone(null));
}
@Test
@@ -68,6 +66,7 @@ public class SerializationUtilsTest {
static class Parent implements Serializable {
private static final long serialVersionUID = 1L;
+
protected boolean status;
Parent(boolean status) {
diff --git a/fe/pom.xml b/fe/pom.xml
index 934c3a97eb6..391d32998b7 100644
--- a/fe/pom.xml
+++ b/fe/pom.xml
@@ -240,6 +240,7 @@ under the License.
</extensions>
</build>
<modules>
+ <module>fe-foundation</module>
<module>fe-common</module>
<module>fe-catalog</module>
<module>fe-extension-spi</module>
@@ -789,6 +790,11 @@ under the License.
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>fe-foundation</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fe-common</artifactId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]