You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/08/28 11:36:00 UTC
[jira] [Commented] (PHOENIX-7022) Add new columns TTL and ROW_KEY_PREFIX
[ https://issues.apache.org/jira/browse/PHOENIX-7022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17759551#comment-17759551 ]
ASF GitHub Bot commented on PHOENIX-7022:
-----------------------------------------
haridsv commented on code in PR #1660:
URL: https://github.com/apache/phoenix/pull/1660#discussion_r1307285500
##########
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java:
##########
@@ -3661,7 +3681,7 @@ private MutationCode processMutationResult(String schemaName, String tableName,
.setSchemaName(schemaName).setTableName(tableName).setFamilyName(familyName).setColumnName(columnName).setMessage(msg).build().buildException();
case UNALLOWED_SCHEMA_MUTATION:
throw new SQLExceptionInfo.Builder(
- SQLExceptionCode.CANNOT_SET_OR_ALTER_PHOENIX_TTL)
+ SQLExceptionCode.CANNOT_SET_OR_ALTER_TTL)
Review Comment:
Just curious, why is `UNALLOWED_SCHEMA_MUTATION` unconditionally mapped to `CANNOT_SET_OR_ALTER_TTL`?
##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -4186,19 +4185,30 @@ protected PhoenixConnection upgradeSystemCatalogIfRequired(PhoenixConnection met
}
if (currentServerSideTableTimeStamp < MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0) {
metaConnection = addColumnsIfNotExists(metaConnection,
- PhoenixDatabaseMetaData.SYSTEM_CATALOG, MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 -3,
+ PhoenixDatabaseMetaData.SYSTEM_CATALOG, MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 - 5,
PhoenixDatabaseMetaData.PHYSICAL_TABLE_NAME
+ " " + PVarchar.INSTANCE.getSqlTypeName());
metaConnection = addColumnsIfNotExists(metaConnection, PhoenixDatabaseMetaData.SYSTEM_CATALOG,
- MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 -2,
+ MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 - 4,
PhoenixDatabaseMetaData.SCHEMA_VERSION + " " + PVarchar.INSTANCE.getSqlTypeName());
metaConnection = addColumnsIfNotExists(metaConnection, PhoenixDatabaseMetaData.SYSTEM_CATALOG,
- MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 -1,
+ MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 - 3,
PhoenixDatabaseMetaData.EXTERNAL_SCHEMA_ID + " " + PVarchar.INSTANCE.getSqlTypeName());
metaConnection = addColumnsIfNotExists(metaConnection, PhoenixDatabaseMetaData.SYSTEM_CATALOG,
- MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0,
+ MIN_SYSTEM_TABLE_TIMESTAMP_5_2_0 - 2,
PhoenixDatabaseMetaData.STREAMING_TOPIC_NAME + " " + PVarchar.INSTANCE.getSqlTypeName());
+ /**
+ * TODO: Provide a path to copy existing data from PHOENIX_TTL to TTL column and then
+ * to DROP PHOENIX_TTL Column. See PHOENIX-7023
Review Comment:
Doesn't this mean that only new tables created or existing tables altered will recognize this new property? But we are dropping support for `PHOENIX_TTL` property in several places, so with no manual intervention the existing PHOENIX_TTL value would stop working between the period till PHOENIX-7023 is done and rolled out. Is this the expected behavior?
From the description of PHOENIX-7023, I got the sense that PHOENIX_TTL will be deprecated with this feature, but the support will still be there, but that is not going to be the reality.
##########
phoenix-core/src/main/java/org/apache/phoenix/mapreduce/util/PhoenixMultiInputUtil.java:
##########
@@ -31,19 +31,19 @@
import java.util.Properties;
+import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_LEVEL_TTL_NOT_DEFINED;
import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME;
import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_TTL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_TTL_NOT_DEFINED;
+import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TTL;
import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_TYPE;
public class PhoenixMultiInputUtil {
public static final String SELECT_ALL_VIEW_METADATA_FROM_SYSCAT_QUERY =
"SELECT TENANT_ID, TABLE_SCHEM, TABLE_NAME, PHOENIX_TTL FROM " +
Review Comment:
?
```suggestion
"SELECT TENANT_ID, TABLE_SCHEM, TABLE_NAME, TTL FROM " +
```
> Add new columns TTL and ROW_KEY_PREFIX
> --------------------------------------
>
> Key: PHOENIX-7022
> URL: https://issues.apache.org/jira/browse/PHOENIX-7022
> Project: Phoenix
> Issue Type: Sub-task
> Reporter: Jacob Isaac
> Assignee: Lokesh Khurana
> Priority: Major
>
> When a view statement is defined by the constraints articulated in PHOENIX-4555, all rows created by the view will be prefixed by a KeyRange. The view thus can simply be represented by the prefixed KeyRange generated by the expression representing the view statement. In other words, there exists a one-to-one mapping between the view (defined by tenant, schema, tablename) and PREFIXED KeyRange.
> For lookup on the PREFIXED KeyRange we will create a new column ROW_KEY_PREFIX in SYSTEM.CATALOG. This new column will be populated during view creation when TTL is specified.
>
> The TTL column (INTEGER) will store the TTL when specified in line with the HBase spec (which uses an int). The PHOENIX_TTL-related columns and code will be deprecated in a separate jira.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)