Github user debugger87 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18900#discussion_r132377142
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala 
---
    @@ -986,6 +986,7 @@ private[hive] object HiveClientImpl {
         tpart.setTableName(ht.getTableName)
         tpart.setValues(partValues.asJava)
         tpart.setSd(storageDesc)
    +    tpart.setCreateTime((System.currentTimeMillis() / 1000).toInt)
    --- End diff --
    
    We just need to use API of hive_metastore like `get_partition` to fetch 
related information of Hive Partition.
    
    * Partition in hive_metastore.thrift
    
    ```
    struct Partition {
      1: list<string> values // string value is converted to appropriate 
partition key type
      2: string       dbName,
      3: string       tableName,
      4: i32          createTime,
      5: i32          lastAccessTime,
      6: StorageDescriptor   sd,
      7: map<string, string> parameters,
      8: optional PrincipalPrivilegeSet privileges
    }
    ```
    
    * get_partition in hive_metastore.thrit
    ```
    Partition get_partition(1:string db_name, 2:string tbl_name, 3:list<string> 
part_vals)
                           throws(1:MetaException o1, 2:NoSuchObjectException 
o2)
    ```
    We will set TTL as kv into parameters of `Table` and fetch `createTime` 
from `Partition` to decide if we can drop a partition in Hive.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to