Skip to content

[fix](build) Exclude javax.resource:connector from BDB JE dependency - #5

Closed
RoanHeNaN wants to merge 1 commit into
masterfrom
fix/je-connector-exclusion
Closed

RoanHeNaN wants to merge 1 commit into
masterfrom
fix/je-connector-exclusion

Conversation

@RoanHeNaN

Copy link
Copy Markdown
Owner

What

Exclude javax.resource:connector from the org.apache.doris:je dependency in fe/pom.xml.

Why

org.apache.doris:je transitively pulls in javax.resource:connector:1.0, whose jar was never published to Maven Central (only the .pom is there), and whose historical host (repo.grails.org) is frequently unreachable. The FE build then fails:

Could not find artifact javax.resource:connector:jar:1.0 in central (...)
Could not transfer artifact javax.resource:connector:jar:1.0 from/to Grails Core
  (https://repo.grails.org/grails/core/): status code: 403, reason phrase: Forbidden

BDB JE only references javax.resource in its optional JCA resource adapter (com.sleepycat.je.jca.ra), which the embedded FE never uses — so the artifact is needed neither at compile nor at runtime.

How

Add a <exclusion> for javax.resource:connector to the existing je <exclusions> block (next to the current ant / checker exclusions).

Testing

Full sh build.sh --fe reaches and completes fe-core compilation (4681 sources) and BUILD SUCCESS without the connector jar present.

🤖 Generated with Claude Code

org.apache.doris:je transitively pulls in javax.resource:connector:1.0, whose
jar was never published to Maven Central (only the pom is there) and whose
historical host (repo.grails.org) is frequently unreachable. As a result the
FE build fails resolving the artifact in many environments:

  Could not find artifact javax.resource:connector:jar:1.0 in central ...

BDB JE only references javax.resource in its optional JCA resource adapter
(com.sleepycat.je.jca.ra), which the embedded FE never uses, so the artifact
is not needed at compile or runtime. Exclude it from the je dependency
management entry, alongside the existing ant/checker exclusions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RoanHeNaN RoanHeNaN closed this Aug 7, 2026
@RoanHeNaN
RoanHeNaN deleted the fix/je-connector-exclusion branch August 7, 2026 06:48
RoanHeNaN pushed a commit that referenced this pull request Aug 21, 2026
…projects (apache#66531)

### What problem does this PR solve?

Related PR: apache#63690

Problem Summary:

Eager aggregation pushdown may fail when different aggregate functions
become
the same expression after passing through a Project. report error:

```text
2026-08-06 04:26:54,285 INFO (mysql-nio-pool-14|325) [PushDownAggregation.visitLogicalAggregate():280] PushDownAggregation failed: Cannot invoke "org.apache.doris.nereids.trees.expressions.NamedExpression.toSlot()" because "namedExpression" is null
        at org.apache.doris.nereids.rules.rewrite.eageraggregation.EagerAggRewriter.visitLogicalProject(EagerAggRewriter.java:718)
        at org.apache.doris.nereids.rules.rewrite.eageraggregation.EagerAggRewriter.visitLogicalProject(EagerAggRewriter.java:90)
        at org.apache.doris.nereids.trees.plans.logical.LogicalProject.accept(LogicalProject.java:160)
        at org.apache.doris.nereids.rules.rewrite.eageraggregation.EagerAggRewriter.visitLogicalUnion(EagerAggRewriter.java:582)
        at org.apache.doris.nereids.rules.rewrite.eageraggregation.EagerAggRewriter.visitLogicalUnion(EagerAggRewriter.java:90)
        at org.apache.doris.nereids.trees.plans.logical.LogicalUnion.accept(LogicalUnion.java:155)
```

For example:

```text
Aggregate: SUM(x)#4, SUM(y)#5
  Union All
    Project: 0 AS x, 0 AS y
      Join
```

After pushing the aggregates through the Project, both functions
become`SUM(0)`:

```text
functions: [SUM(0), SUM(0)]
aliasMap:  SUM(0) -> #5
```

Because `aliasMap` uses expression equality, only one entry is retained.
The Project still tries to read both `#4` and `#5` from
`BilateralState`,
causing a null lookup.

This PR deduplicates the child aggregate and records the ExprId mapping:

```text
child aggregate: SUM(0) -> apache#8
ExprId mapping:  #4 -> apache#8, #5 -> apache#8
```

The Project then restores both required outputs:

```text
slot#8 AS slot#4
slot#8 AS slot#5
```

When no aggregate functions are merged, the original ExprIds are reused
to
avoid unnecessary aliases.

The same fix also covers cases such as:

```text
Project: a#1 AS x, a#1 AS y
```

where `SUM(x)` and `SUM(y)` both become `SUM(a#1)` after pushdown.

### Release note

None


### Check List (For Author)

- Test
    - [x] Regression test
        - `query_p0/eager_agg/bilateral_eager_agg`
- Covers two aggregate functions that become the same function after
          Project pushdown.
    - [ ] Unit Test
    - [ ] Manual test
    - [ ] No need to test or manual test.

- Behavior changed:
    - [x] Yes.
        - Prevents eager aggregation pushdown from failing when multiple
          aggregate functions become identical after Project rewriting.
- `eager_aggregation_mode=1` can force eligible pushdown after a UNION.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
RoanHeNaN pushed a commit that referenced this pull request Sep 11, 2026
Problem Summary: Streaming `ROWS` window aggregates retain state across
frame evaluations. The eviction path previously considered only whether
buffered blocks had been emitted, so it could erase either the outgoing
row needed by a bounded sliding frame or the next unread row needed by
an `UNBOUNDED PRECEDING ... N PRECEDING` frame. After rebasing, negative
partition and outgoing positions could allow a nullable aggregate to
access its null map out of bounds. Evicting either kind of required row
could also produce incorrect aggregate results.

Root cause: `_remove_unused_rows()` did not account for the earliest row
required by the next ROWS frame evaluation, and
`BoundaryPose::remove_unused_rows()` allowed retained-column coordinates
to become negative.

This change defers block-aligned eviction when the candidate prefix
contains either `frame_start - 1`, the outgoing row required by a
bounded sliding update, or the next unread row required by an `UNBOUNDED
PRECEDING ... N PRECEDING` frame. It also rebases partition and order
boundaries to nonnegative physical-column coordinates. The BE unit
coverage exercises both ROWS executors across eviction boundaries and
verifies boundary rebasing.

Observed ASAN failure before this change (`output/be/log/be.out`):

```text
ERROR: AddressSanitizer: heap-buffer-overflow
READ of size 1
    #0 doris::AggregateFunctionNullUnaryInlineV2<...>::execute_function_with_incremental(...)
       be/src/exprs/aggregate/aggregate_function_null_v2.h:595
    #1 doris::AggFnEvaluator::execute_function_with_incremental(...)
       be/src/exprs/vectorized_agg_fn.cpp:334
    #2 doris::AnalyticSinkLocalState::_execute_for_function<true>(...)
       be/src/exec/operator/analytic_sink_operator.cpp:385
    #3 doris::AnalyticSinkLocalState::_get_next_for_sliding_rows(...)
       be/src/exec/operator/analytic_sink_operator.cpp:203
    #4 doris::AnalyticSinkLocalState::_execute_impl(...)
       be/src/exec/operator/analytic_sink_operator.cpp:358
    #5 doris::AnalyticSinkOperatorX::sink_impl(...)
       be/src/exec/operator/analytic_sink_operator.cpp:757
SUMMARY: AddressSanitizer: heap-buffer-overflow in
doris::AggregateFunctionNullUnaryInlineV2<...>::execute_function_with_incremental(...)
```


### 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)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant