Skip to content

Conversation

@palashc
Copy link
Contributor

@palashc palashc commented Jan 23, 2026

No description provided.

@palashc palashc marked this pull request as draft January 23, 2026 23:34
@virajjasani virajjasani self-requested a review January 24, 2026 04:50
@palashc palashc marked this pull request as ready for review January 29, 2026 01:40
@palashc palashc requested a review from tkhurana January 29, 2026 01:40
Copy link
Contributor

@virajjasani virajjasani left a comment

Choose a reason for hiding this comment

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

+1, do we already have test where creation of uncovered index fails on strict conditional TTL? if not, let's add such test

boolean isStrictTTL =
metaProperties.isStrictTTL() != null ? metaProperties.isStrictTTL : table.isStrictTTL();
if (!(newTTL instanceof ConditionalTTLExpression) || isStrictTTL) {
newTTL.validateTTLOnAlter(connection, table);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better if you pass the isStrictTTL to the validateTTLOnAlter function and then in the specific implementation of conditional ttl expression skip the checks for uncovered index if the ttl is not strict.

@palashc
Copy link
Contributor Author

palashc commented Jan 29, 2026

do we already have test where creation of uncovered index fails on strict conditional TTL

@virajjasani Yes we do. https://github.com/apache/phoenix/blob/master/phoenix-core/src/test/java/org/apache/phoenix/schema/ConditionalTTLExpressionTest.java#L538

@@ -2529,7 +2530,14 @@ private PTable createTableInternal(CreateTableStatement statement, byte[][] spli
} else {
ttlFromHierarchy = checkAndGetTTLFromHierarchy(parent, tableName);
Copy link
Contributor

Choose a reason for hiding this comment

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

@palashc I think it would be better if we can enhance the API checkAndGetTTLFromHierarchy itself to return TTL_EXPRESSION_NOT_DEFINED in this case.

}
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add a test case where the table has uncovered index and a literal TTL. Now you alter the ttl to conditional with IS_STRICT_TTL set to false. Then verify that the table has conditional ttl and the uncovered index has ttl undefined. I am suspecting that while you skipped checking for uncovered indexes during the ttl validation on alter, I am not seeing that you are actually updating the ttl on uncovered index to undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tkhurana should we update the uncovered index ttl from the client or should we handle it on the server side when building the ptable for the uncovered index?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think for CDC index we handle it when building the PTable. You can do something similar.

Copy link
Contributor

@tkhurana tkhurana left a comment

Choose a reason for hiding this comment

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

Left some more comments

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.

3 participants