Skip to content

Commit d3c5dcf

Browse files
authored
[refactor](Expr) move Expr and its related class to fe-catalog module (#62440)
### What problem does this PR solve? Problem Summary: This pull request makes several important changes to the `fe-catalog` module, primarily focused on dependency management, build configuration, and refactoring code from `fe-core` to `fe-catalog`. The changes also simplify exception messages and update method signatures for better clarity and maintainability. **Dependency and Build Configuration Updates:** * Added new dependencies to `fe-catalog/pom.xml`, including `fe-foundation`, `fe-type`, `commons-collections4`, and `antlr4-runtime`, to support parsing and type utilities. * Introduced the `antlr4-maven-plugin` to the build plugins in `pom.xml` for automatic ANTLR grammar processing during the build. **Code Refactoring and Cleanup:** * Moved several analysis classes (`CompoundPredicate`, `DecimalLiteral`, `EncryptKeyName`) from `fe-core` to `fe-catalog`, and updated their package references accordingly. [[1]](diffhunk://#diff-948d0b0d5c53081ca071883defe825b2e61237bd06a9ed74c2dde034fc47ea36L112-R116) [[2]](diffhunk://#diff-aadad556e434b3d4f441ea9a15daddc5e021934d2d3a61629029cc8a4b056f8bL188-R188) [[3]](diffhunk://#diff-8fde91d35b6b3c4a25cdae6a87af1a7f955148dc79321ff349a0b97f753fa783L21-L24) **Code Simplification and Error Handling Improvements:** * Simplified exception messages in `DecimalLiteral` and `CompoundPredicate` by removing the use of `ExprToSqlVisitor` and instead using the object's `toString()` representation. [[1]](diffhunk://#diff-948d0b0d5c53081ca071883defe825b2e61237bd06a9ed74c2dde034fc47ea36L112-R116) [[2]](diffhunk://#diff-aadad556e434b3d4f441ea9a15daddc5e021934d2d3a61629029cc8a4b056f8bL188-R188) * Changed the `analyze` method in `EncryptKeyName` to accept a `String defaultDb` instead of a `ConnectContext`, and replaced usage of `ErrorReport` with direct exception throwing for missing database selection. ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [x] No need to test or manual test. Explain why: - [x] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
1 parent 52a0fdf commit d3c5dcf

File tree

279 files changed

+1230
-865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+1230
-865
lines changed

fe/fe-catalog/pom.xml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,31 @@ under the License.
3333

3434
<dependencies>
3535
<!-- Only depend on fe-common for basic types and utilities -->
36+
<dependency>
37+
<groupId>${project.groupId}</groupId>
38+
<artifactId>fe-foundation</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
3641
<dependency>
3742
<groupId>${project.groupId}</groupId>
3843
<artifactId>fe-common</artifactId>
3944
<version>${project.version}</version>
4045
</dependency>
46+
<dependency>
47+
<groupId>${project.groupId}</groupId>
48+
<artifactId>fe-type</artifactId>
49+
<version>${project.version}</version>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>org.apache.commons</groupId>
54+
<artifactId>commons-collections4</artifactId>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.antlr</groupId>
58+
<artifactId>antlr4-runtime</artifactId>
59+
<version>${antlr4.version}</version>
60+
</dependency>
4161

4262
<!-- Test dependencies -->
4363
<dependency>
@@ -51,6 +71,26 @@ under the License.
5171
<finalName>doris-fe-catalog</finalName>
5272
<directory>${project.basedir}/target/</directory>
5373
<plugins>
74+
<!--antlr-->
75+
<plugin>
76+
<groupId>org.antlr</groupId>
77+
<artifactId>antlr4-maven-plugin</artifactId>
78+
<version>${antlr4.version}</version>
79+
<executions>
80+
<execution>
81+
<id>antlr</id>
82+
<goals>
83+
<goal>antlr4</goal>
84+
</goals>
85+
</execution>
86+
</executions>
87+
<configuration>
88+
<visitor>true</visitor>
89+
<sourceDirectory>src/main/antlr4</sourceDirectory>
90+
<treatWarningsAsErrors>true</treatWarningsAsErrors>
91+
<libDirectory>src/main/antlr4/org/apache/doris/parser</libDirectory>
92+
</configuration>
93+
</plugin>
5494
<!-- Build source jar -->
5595
<plugin>
5696
<groupId>org.apache.maven.plugins</groupId>

fe/fe-core/src/main/antlr4/org/apache/doris/analysis/SearchLexer.g4 renamed to fe/fe-catalog/src/main/antlr4/org/apache/doris/analysis/SearchLexer.g4

File renamed without changes.

fe/fe-core/src/main/antlr4/org/apache/doris/analysis/SearchParser.g4 renamed to fe/fe-catalog/src/main/antlr4/org/apache/doris/analysis/SearchParser.g4

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/AnalyzerSelector.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/AnalyzerSelector.java

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/ArithmeticExpr.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/ArithmeticExpr.java

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/ArrayLiteral.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/ArrayLiteral.java

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/BetweenPredicate.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/BetweenPredicate.java

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/BinaryPredicate.java

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/BoolLiteral.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/BoolLiteral.java

File renamed without changes.

fe/fe-core/src/main/java/org/apache/doris/analysis/CaseExpr.java renamed to fe/fe-catalog/src/main/java/org/apache/doris/analysis/CaseExpr.java

File renamed without changes.

0 commit comments

Comments
 (0)