Skip to content

PHOENIX-7795 : Tenant TTL using Tenant Views on Multi-Tenant Table#2400

Draft
palashc wants to merge 9 commits intoapache:masterfrom
palashc:tenant_ttl
Draft

PHOENIX-7795 : Tenant TTL using Tenant Views on Multi-Tenant Table#2400
palashc wants to merge 9 commits intoapache:masterfrom
palashc:tenant_ttl

Conversation

@palashc
Copy link
Copy Markdown
Contributor

@palashc palashc commented Apr 6, 2026

No description provided.

@palashc palashc marked this pull request as draft April 6, 2026 22:32
@palashc palashc requested a review from jpisaac April 6, 2026 22:32
@palashc palashc marked this pull request as ready for review April 7, 2026 20:01
@palashc palashc changed the title PHOENIX-7795 : Tenant TTL using Global Views PHOENIX-7795 : Tenant TTL using Tenant Views on Multi-Tenant Table Apr 8, 2026
Copy link
Copy Markdown
Contributor

@jpisaac jpisaac 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, Few test suggestions

@@ -0,0 +1,520 @@
/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@palashc Looks good.
Maybe add a few more test cases -

  • tables with indexes,
  • view with same names and diff orgs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

this.operation = operation;
}

public MutationPlan compile(CreateTableStatement create) throws SQLException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should have checks for same tenant creating multiple views without where clauses.
It should not be allowed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jpisaac should this check be only for tenant views on multi tenant tables or any parent?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added check for allowing only one tenant view without where clause on a multi tenant base table

viewTypeToBe = visitor.isUpdatable() ? ViewType.UPDATABLE : ViewType.READ_ONLY;
boolean updatableViewRestrictionEnabled = connection.getQueryServices().getProps()
.getBoolean(PHOENIX_UPDATABLE_VIEW_RESTRICTION_ENABLED,
DEFAULT_PHOENIX_UPDATABLE_VIEW_RESTRICTION_ENABLED);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should have a test with PHOENIX_UPDATABLE_VIEW_RESTRICTION_ENABLED set to true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@palashc palashc requested a review from jpisaac April 21, 2026 18:31
Palash Chauhan added 2 commits April 21, 2026 14:23
@palashc palashc marked this pull request as draft April 23, 2026 06:36
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.

2 participants