Skip to content

Commit

Permalink
Update TableConfigTaskVisitor.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Caideyipi committed Nov 29, 2024
1 parent 54f7a59 commit 2203d98
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.StopPipe;
import org.apache.iotdb.db.queryengine.plan.relational.sql.ast.Use;
import org.apache.iotdb.db.queryengine.plan.relational.type.TypeNotFoundException;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.DatabaseSchemaStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowClusterStatement;
import org.apache.iotdb.db.queryengine.plan.statement.metadata.ShowRegionStatement;
import org.apache.iotdb.db.queryengine.plan.statement.sys.FlushStatement;
Expand Down Expand Up @@ -191,11 +192,15 @@ protected IConfigTask visitCreateOrAlterDB(
final String key = property.getName().getValue().toLowerCase(Locale.ENGLISH);
if (property.isSetToDefault()) {
switch (key) {
case TTL_KEY:
case TIME_PARTITION_INTERVAL_KEY:
case SCHEMA_REGION_GROUP_NUM_KEY:
case DATA_REGION_GROUP_NUM_KEY:
break;
case TTL_KEY:
if (node.getType() == DatabaseSchemaStatement.DatabaseSchemaStatementType.ALTER) {
schema.setTTL(Long.MAX_VALUE);
}
break;
default:
throw new SemanticException("Unsupported database property key: " + key);
}
Expand All @@ -212,6 +217,9 @@ protected IConfigTask visitCreateOrAlterDB(
throw new SemanticException(
"ttl value must be 'INF' or a long literal, but now is: " + value);
}
if (node.getType() == DatabaseSchemaStatement.DatabaseSchemaStatementType.ALTER) {
schema.setTTL(Long.MAX_VALUE);
}
break;
}
schema.setTTL(parseLongFromLiteral(value, TTL_KEY));
Expand Down

0 comments on commit 2203d98

Please sign in to comment.