Skip to content

[#8656] Improvement: Validate empty table updates in TableUpdatesRequest#10201

Merged
justinmclean merged 20 commits intoapache:mainfrom
A0R0P0I7T:validate-empty-table-updates
Mar 4, 2026
Merged

[#8656] Improvement: Validate empty table updates in TableUpdatesRequest#10201
justinmclean merged 20 commits intoapache:mainfrom
A0R0P0I7T:validate-empty-table-updates

Conversation

@A0R0P0I7T
Copy link
Contributor

What changes were proposed in this pull request?

Adds validation in TableUpdatesRequest.validate() to ensure that the updates list is not empty before applying table updates.
If the list is empty, an IllegalArgumentException is thrown.\

Additionally, a unit test (testValidateEmptyUpdates) is added to verify that the validation correctly throws an exception when an empty updates list is provided.

Why are the changes needed?

Currently,
TableUpdatesRequest.validate() only checks that updates is not null.
However, an empty list of updates is also invalid because a table update request without any updates should not be allowed.
This change ensures stronger validation and prevents invalid request from being processed.

Fix: #8656

Does this PR introduce any user-facing change?

No

How was this patch tested?

(Please test your changes, and provide instructions on how to test it:
Added a new unit test

  1. testValidateEmptyUpdates in TestTableUpdatesRequest.
  2. The test verifies that IllegalArgumentException is thrown when updates is empty.
  3. Existing tests were run to ensure no regressions.

@justinmclean
Copy link
Member

Hi @A0R0P0I7T we use spotless to make sure code is consistently formatted. You'll need to run spotless and push your changes to fix the CI issue.

@A0R0P0I7T
Copy link
Contributor Author

A0R0P0I7T commented Mar 4, 2026

Hi @A0R0P0I7T we use spotless to make sure code is consistently formatted. You'll need to run spotless and push your changes to fix the CI issue.

Yes absolutely my apologies I didn't notice I had changed the version of my java which might have affected the spotlessApply. I have applied spotless correctly now and it has been tested too I will be pushing in a few minutes.
Thank you for the advice.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Code Coverage Report

Overall Project 65.19% 🟢
Files changed 66.67% 🟢

Module Coverage
aliyun 1.73% 🔴
api 46.15% 🟢
authorization-common 85.96% 🟢
aws 1.1% 🔴
azure 2.6% 🔴
catalog-common 10.0% 🔴
catalog-fileset 80.02% 🟢
catalog-hive 80.98% 🟢
catalog-jdbc-clickhouse 77.71% 🟢
catalog-jdbc-common 36.84% 🔴
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 57.71% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 81.22% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.07% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 87.15% 🟢
catalog-lakehouse-paimon 77.71% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.73% 🟢
common 49.23% +0.04% 🟢
core 81.2% 🟢
filesystem-hadoop3 76.97% 🟢
flink 38.86% 🔴
flink-runtime 0.0% 🔴
gcp 14.2% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 45.82% 🟢
iceberg-common 50.21% 🟢
iceberg-rest-server 66.35% 🟢
integration-test-common 0.0% 🔴
jobs 62.55% 🟢
lance-common 23.78% 🔴
lance-rest-server 57.84% 🟢
lineage 53.02% 🟢
optimizer 82.61% 🟢
server 85.76% 🟢
server-common 68.6% 🟢
spark 35.09% 🔴
spark-common 39.88% 🔴
trino-connector 31.62% 🔴
Files
Module File Coverage
common TableUpdatesRequest.java 66.67% 🟢

Copy link
Member

@justinmclean justinmclean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for that

@justinmclean justinmclean merged commit d23c046 into apache:main Mar 4, 2026
26 checks passed
@A0R0P0I7T
Copy link
Contributor Author

Looks good to me, thanks for that

Thank you for the review and merge.

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.

[Improvement] In TableUpdatesRequest.java validate updates

2 participants