Skip to content

PHOENIX-7955 CREATE TABLE IF NOT EXISTS should not mutate existing HBase table properties#2569

Draft
PDavid wants to merge 2 commits into
apache:masterfrom
PDavid:PHOENIX-7955-create-existing-table-hbase-properties
Draft

PHOENIX-7955 CREATE TABLE IF NOT EXISTS should not mutate existing HBase table properties#2569
PDavid wants to merge 2 commits into
apache:masterfrom
PDavid:PHOENIX-7955-create-existing-table-hbase-properties

Conversation

@PDavid

@PDavid PDavid commented Jul 7, 2026

Copy link
Copy Markdown

Why are the changes needed?

Problem

When CREATE TABLE IF NOT EXISTS was executed against an already-existing table, Phoenix would overwrite the HBase-level table and column family properties (e.g. REGION_REPLICATION, VERSIONS, TTL) with the values from the new DDL statement. This is unexpected - IF NOT EXISTS should be a no-op if the table already exists.

(Please see the ticket about reproduction steps.)

Fix

TODO

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added new test in CreateTableIT which reproduces the problem and verifies the fix.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.6 noreply@anthropic.com

…ase table properties

Problem:
When CREATE TABLE IF NOT EXISTS was executed against an already-existing table, Phoenix would overwrite the HBase-level table and column family properties (e.g. REGION_REPLICATION, VERSIONS, TTL) with the values from the new DDL statement. This is unexpected - IF NOT EXISTS should be a no-op if the table already exists.

Fix:
In ConnectionQueryServicesImpl changed ensureTableCreated call for TABLE types - passes modifyExistingMetaData = false when the table type is TABLE, so existing properties are not overwritten.

Testing:
Added new test in CreateTableIT which reproduces the problem and verifies the fix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PDavid PDavid force-pushed the PHOENIX-7955-create-existing-table-hbase-properties branch from da941d5 to 2419cbe Compare July 7, 2026 14:31
@PDavid PDavid marked this pull request as draft July 10, 2026 09:10
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