Skip to content

Commit

Permalink
[hive] Pass 'partition.expiration-time' prop to hms. (#4416)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanZhangN authored Oct 31, 2024
1 parent 2f8f874 commit 1f5e36c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
import static org.apache.hadoop.hive.conf.HiveConf.ConfVars.METASTOREWAREHOUSE;
import static org.apache.hadoop.hive.serde.serdeConstants.FIELD_DELIM;
import static org.apache.paimon.CoreOptions.FILE_FORMAT;
import static org.apache.paimon.CoreOptions.PARTITION_EXPIRATION_TIME;
import static org.apache.paimon.CoreOptions.TYPE;
import static org.apache.paimon.TableType.FORMAT_TABLE;
import static org.apache.paimon.hive.HiveCatalogLock.acquireTimeout;
Expand Down Expand Up @@ -721,6 +722,13 @@ private Table createHiveTable(Identifier identifier, TableSchema tableSchema, Pa
tblProperties.putAll(convertToPropertiesTableKey(tableSchema));
} else {
tblProperties = convertToPropertiesPrefixKey(tableSchema.options(), HIVE_PREFIX);
if (tableSchema.options().containsKey(PARTITION_EXPIRATION_TIME.key())) {
// This property will be stored in the 'table_params' table of the HMS database for
// querying by other engines or products.
tblProperties.put(
PARTITION_EXPIRATION_TIME.key(),
tableSchema.options().get(PARTITION_EXPIRATION_TIME.key()));
}
}

Table table = newHmsTable(identifier, tblProperties, provider);
Expand Down

0 comments on commit 1f5e36c

Please sign in to comment.