RunningDB opened a new pull request, #9355:
URL: https://github.com/apache/paimon/pull/9355

   <!--
   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.
   -->
   
   ### Purpose
   Close #6718
   
   In Apache Paimon, `first-row` merge engine only retains the very first 
inserted row for a given primary key and inherently ignores subsequent row 
modifications.
   
   Previously:
   - `Update` and `MergeInto` already excluded `MergeEngine.FIRST_ROW` from 
`supportedMergeEngine` in `RowLevelOp.scala`.
   - However, `Delete.supportedMergeEngine` mistakenly included 
`MergeEngine.FIRST_ROW`, and `DeleteFromPaimonTableCommand` introduced an 
execution-time workaround (`ignorePreviousFiles=true`). This caused 
inconsistency between analysis validation and actual table semantics.
   
   This PR fixes this behavior by:
   1. Removing `MergeEngine.FIRST_ROW` from `Delete.supportedMergeEngine` so 
that `DELETE` queries on `first-row` tables are rejected with 
`UnsupportedOperationException` during Catalyst analysis/planning.
   2. Cleaning up the redundant workaround in `DeleteFromPaimonTableCommand` 
and removing unused helper parameters (`ignorePreviousFiles`).
   3. Updating unit tests to assert `UnsupportedOperationException` for 
unsupported merge engines across row-level operations (`DELETE`, `MERGE INTO`).
   
   ### Tests
   - Updated `DeleteFromTableTestBase` (`test delete with merge engine 
$mergeEngine`, `Paimon Delete: first-row table`, `test delete with lookup, 
$mergeEngine`).
   - Added test coverage in `MergeIntoTableTestBase` for merge engine 
validation.
   - All Spark row-level test suites passed locally:
     - `DeleteFromTableTest`: 30/30 passed
     - `UpdateTableTest`: 24/24 passed
     - `MergeIntoPrimaryKeyBucketedTableTest`: 58/58 passed
   
   ### API and Format
   No user-facing API or storage format changes.
   
   ### Documentation
   Does not require documentation updates.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to