starrocks
starrocks copied to clipboard
The materialized view partition ttl property has being lost after restarting fe
-
create materialized view CREATE MATERIALIZED VIEW
mv_hive_order(dt,product_id,gmv) PARTITION BY (str2date(dt, '%Y-%m-%d')) DISTRIBUTED BY HASH(product_id) REFRESH MANUAL PROPERTIES ( "replicated_storage" = "true", "partition_refresh_number" = "1", "session.enable_spill" = "true", "replication_num" = "1", "session.query_timeout" = "3600", "partition_ttl" = "2 DAY", "storage_medium" = "HDD" ) AS SELECThive_order.dt,hive_order.product_id, sum(hive_order.price) ASgmvFROMhive_hms_catalog.ods.hive_order -
restart fe
-
show create materialized view | mv_hive_order | CREATE MATERIALIZED VIEW
mv_hive_order(dt,product_id,gmv) PARTITION BY (str2date(dt, '%Y-%m-%d')) DISTRIBUTED BY HASH(product_id) REFRESH MANUAL PROPERTIES ( "replicated_storage" = "true", "partition_refresh_number" = "1", "session.enable_spill" = "true", "replication_num" = "1", "session.query_timeout" = "3600", "storage_medium" = "HDD" ) AS SELECThive_order.dt,hive_order.product_id, sum(hive_order.price) ASgmvFROMhive_hms_catalog.ods.hive_orderGROUP BYhive_order.dt,hive_order.product_id;
fix partition ttl lost url : https://github.com/StarRocks/starrocks/pull/51194 It was removed when calling the PropertyAnalyzer.analyzePartitionTTL method. Therefore, the properties need to be copied before calling the method and the copied object is used as a parameter. such code : Map<String, String> props = new HashMap(properties); Pair<String, PeriodDuration> ttlDuration = PropertyAnalyzer.analyzePartitionTTL(props);
@guanxianchun this is fixed as part of PR https://github.com/StarRocks/starrocks/pull/51028 it seems your version does not have the fix.
@guanxianchun this is fixed as part of PR #51028 it seems your version does not have the fix.
I am using the latest code from branch 3.1, which already includes the bug fix code. This is a new issue that arose after using the analyzePartitionTTL method.
It was removed when calling the PropertyAnalyzer.analyzePartitionTTL method:
public static Pair<String, PeriodDuration> analyzePartitionTTL(Map<String, String> properties) { if (properties != null && properties.containsKey(PROPERTIES_PARTITION_TTL)) { String ttlStr = properties.get(PROPERTIES_PARTITION_TTL); PeriodDuration duration; try { duration = TimeUtils.parseHumanReadablePeriodOrDuration(ttlStr); } catch (NumberFormatException e) { throw new SemanticException(String.format("illegal %s: %s", PROPERTIES_PARTITION_TTL, e.getMessage())); } properties.remove(PROPERTIES_PARTITION_TTL); return Pair.create(ttlStr, duration); } return Pair.create(null, PeriodDuration.ZERO); }
In the analyzePartitionTTL method, the PROPERTIES_PARTITION_TTL property was removed from properties. the code as follow:
properties.remove(PROPERTIES_PARTITION_TTL);
@rohitrs1983
We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!