This is an automated email from the ASF dual-hosted git repository.

palashc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/master by this push:
     new 4455038df7 PHOENIX-7777 : Disable default configuration for View TTL 
(#2387)
4455038df7 is described below

commit 4455038df71a8c383d1e59ae1b9a4e51f9d9d0f8
Author: Palash Chauhan <[email protected]>
AuthorDate: Wed Mar 4 18:45:45 2026 -0800

    PHOENIX-7777 : Disable default configuration for View TTL (#2387)
    
    Co-authored-by: Palash Chauhan 
<[email protected]>
---
 .../apache/phoenix/query/QueryServicesOptions.java    |  2 +-
 .../phoenix/end2end/IndexRepairRegionScannerIT.java   |  1 +
 .../org/apache/phoenix/end2end/TTLAsPhoenixTTLIT.java | 19 ++++++++++++++++++-
 .../src/it/java/org/apache/phoenix/end2end/TTLIT.java | 18 +++++++++++++++++-
 .../phoenix/schema/ConditionalTTLExpressionTest.java  | 10 ++++++++++
 5 files changed, 47 insertions(+), 3 deletions(-)

diff --git 
a/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
 
b/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index 75e55a389f..ba344af5b1 100644
--- 
a/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++ 
b/phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -479,7 +479,7 @@ public class QueryServicesOptions {
   public static final boolean DEFAULT_APPLY_TIME_ZONE_DISPLACMENT = false;
   public static final boolean DEFAULT_PHOENIX_TABLE_TTL_ENABLED = true;
   public static final boolean DEFAULT_PHOENIX_COMPACTION_ENABLED = true;
-  public static final boolean DEFAULT_PHOENIX_VIEW_TTL_ENABLED = true;
+  public static final boolean DEFAULT_PHOENIX_VIEW_TTL_ENABLED = false;
   public static final int DEFAULT_PHOENIX_VIEW_TTL_TENANT_VIEWS_PER_SCAN_LIMIT 
= 100;
 
   public static final int DEFAULT_MAX_REGION_LOCATIONS_SIZE_EXPLAIN_PLAN = 5;
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexRepairRegionScannerIT.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexRepairRegionScannerIT.java
index f514c772ef..5c76bb4089 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexRepairRegionScannerIT.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexRepairRegionScannerIT.java
@@ -139,6 +139,7 @@ public class IndexRepairRegionScannerIT extends 
ParallelStatsDisabledIT {
     // to force multiple verification tasks to be spawned so that we can 
exercise the page splitting
     // logic
     
props.put(GlobalIndexRegionScanner.INDEX_VERIFY_ROW_COUNTS_PER_TASK_CONF_KEY, 
Long.toString(2));
+    props.put(QueryServices.PHOENIX_VIEW_TTL_ENABLED, Boolean.toString(true));
     props.put("hbase.procedure.remote.dispatcher.delay.msec", "0");
     setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
   }
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLAsPhoenixTTLIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLAsPhoenixTTLIT.java
index 6f89e876d2..a2d5e26521 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLAsPhoenixTTLIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLAsPhoenixTTLIT.java
@@ -33,6 +33,7 @@ import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.TableName;
@@ -40,7 +41,9 @@ import org.apache.hadoop.hbase.client.Admin;
 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
 import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants;
 import org.apache.phoenix.jdbc.PhoenixConnection;
+import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.ColumnFamilyNotFoundException;
 import org.apache.phoenix.schema.ColumnNotFoundException;
 import org.apache.phoenix.schema.PName;
@@ -50,13 +53,17 @@ import org.apache.phoenix.schema.TTLExpression;
 import org.apache.phoenix.schema.TTLExpressionFactory;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.TestUtil;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-@Category(ParallelStatsDisabledTest.class)
+import org.apache.phoenix.thirdparty.com.google.common.collect.Maps;
+
+@Category(NeedsOwnMiniClusterTest.class)
 @RunWith(Parameterized.class)
 public class TTLAsPhoenixTTLIT extends ParallelStatsDisabledIT {
 
@@ -81,6 +88,16 @@ public class TTLAsPhoenixTTLIT extends 
ParallelStatsDisabledIT {
   private TTLExpression alterTTL;
   private String alterTTLDDLOption;
 
+  @BeforeClass
+  public static synchronized void doSetup() throws Exception {
+    Map<String, String> props = Maps.newHashMapWithExpectedSize(1);
+    
props.put(BaseScannerRegionObserverConstants.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY,
+      Integer.toString(60 * 60)); // An hour
+    props.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, 
Boolean.toString(false));
+    props.put(QueryServices.PHOENIX_VIEW_TTL_ENABLED, Boolean.toString(true));
+    setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
+  }
+
   public TTLAsPhoenixTTLIT(boolean useExpression) {
     this.useExpression = useExpression;
     this.defaultTTL = useExpression
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLIT.java
index aff1e25fbb..1bf6a21a1a 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/TTLIT.java
@@ -27,24 +27,30 @@ import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
+import java.util.Map;
+import org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants;
 import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.PhoenixTestBuilder;
 import org.apache.phoenix.query.PhoenixTestBuilder.SchemaBuilder;
 import org.apache.phoenix.query.PhoenixTestBuilder.SchemaBuilder.TableOptions;
+import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.schema.LiteralTTLExpression;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.util.PhoenixRuntime;
+import org.apache.phoenix.util.ReadOnlyProps;
 import org.apache.phoenix.util.TestUtil;
 import org.junit.Assert;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
 import org.apache.phoenix.thirdparty.com.google.common.collect.Lists;
+import org.apache.phoenix.thirdparty.com.google.common.collect.Maps;
 
-@Category(ParallelStatsDisabledTest.class)
+@Category(NeedsOwnMiniClusterTest.class)
 @RunWith(Parameterized.class)
 public class TTLIT extends ParallelStatsDisabledIT {
 
@@ -56,6 +62,16 @@ public class TTLIT extends ParallelStatsDisabledIT {
   private static final int DEFAULT_TEST_TTL_VALUE_AT_TENANT = 200000;
   public static final String SKIP_ASSERT = "SKIP_ASSERT";
 
+  @BeforeClass
+  public static synchronized void doSetup() throws Exception {
+    Map<String, String> props = Maps.newHashMapWithExpectedSize(1);
+    
props.put(BaseScannerRegionObserverConstants.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY,
+      Integer.toString(60 * 60)); // An hour
+    props.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, 
Boolean.toString(false));
+    props.put(QueryServices.PHOENIX_VIEW_TTL_ENABLED, Boolean.toString(true));
+    setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
+  }
+
   public TTLIT(boolean isMultiTenant) {
     this.isMultiTenant = isMultiTenant;
   }
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/schema/ConditionalTTLExpressionTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/schema/ConditionalTTLExpressionTest.java
index a0079999b8..6303541de3 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/schema/ConditionalTTLExpressionTest.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/schema/ConditionalTTLExpressionTest.java
@@ -48,13 +48,23 @@ import 
org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixPreparedStatement;
 import org.apache.phoenix.query.BaseConnectionlessQueryTest;
+import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.util.EnvironmentEdgeManager;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.apache.phoenix.thirdparty.com.google.common.collect.Lists;
 
 public class ConditionalTTLExpressionTest extends BaseConnectionlessQueryTest {
 
+  @BeforeClass
+  public static void enableViewTTL() throws Exception {
+    try (Connection conn = DriverManager.getConnection(getUrl())) {
+      
conn.unwrap(PhoenixConnection.class).getQueryServices().getConfiguration()
+        .setBoolean(QueryServices.PHOENIX_VIEW_TTL_ENABLED, true);
+    }
+  }
+
   public static void assertConditionTTL(Connection conn, String tableName, 
String ttlExpr)
     throws SQLException {
     TTLExpression expected = new ConditionalTTLExpression(ttlExpr);

Reply via email to