jpisaac commented on code in PR #2130:
URL: https://github.com/apache/phoenix/pull/2130#discussion_r2080244769
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/TTLRegionScanner.java:
##########
@@ -77,20 +79,25 @@ public TTLRegionScanner(final RegionCoprocessorEnvironment
env, final Scan scan,
currentTime = scan.getTimeRange().getMax() ==
HConstants.LATEST_TIMESTAMP
? EnvironmentEdgeManager.currentTimeMillis() :
scan.getTimeRange().getMax();
byte[] isSystemTable =
scan.getAttribute(IS_PHOENIX_TTL_SCAN_TABLE_SYSTEM);
- if (isPhoenixTableTTLEnabled(env.getConfiguration()) && (isSystemTable
== null
- || !Bytes.toBoolean(isSystemTable))) {
- ttlExpression = ScanUtil.getTTLExpression(this.scan);
+ CompiledTTLExpression scanTTLExpression =
ScanUtil.getTTLExpression(scan);
Review Comment:
Need to handle 5.2 client
##########
phoenix-core-server/src/main/java/org/apache/phoenix/mapreduce/index/IndexScrutinyMapper.java:
##########
@@ -343,10 +345,12 @@ private int getTableTTL(Configuration configuration)
throws SQLException, IOExce
cqsi =
connection.unwrap(PhoenixConnection.class).getQueryServices();
String physicalTable = getSourceTableName(pSourceTable,
SchemaUtil.isNamespaceMappingEnabled(null, cqsi.getProps()));
- if (configuration.getBoolean(QueryServices.PHOENIX_TABLE_TTL_ENABLED,
- QueryServicesOptions.DEFAULT_PHOENIX_TABLE_TTL_ENABLED)) {
- return
pSourceTable.getTTLExpression().equals(TTL_EXPRESSION_NOT_DEFINED) ? DEFAULT_TTL
- : ((LiteralTTLExpression)
pSourceTable.getTTLExpression()).getTTLValue(); // TODO
+ TTLExpression ttlExpression = pSourceTable.getTTLExpression();
+ if (ttlExpression == null) return DEFAULT_TTL;
+ if (!ttlExpression.equals(TTL_EXPRESSION_DEFINED_IN_TABLE_DESCRIPTOR))
{
+ return ttlExpression.equals(TTL_EXPRESSION_NOT_DEFINED) ?
DEFAULT_TTL
+ // TODO What happens in the case of Conditional TTL
+ : ((LiteralTTLExpression) ttlExpression).getTTLValue(); //
TODO
Review Comment:
Check whether can be convert to TTLExpression
--
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]