As part of meta data for table, there are fields named 'lastAccessTime' and 'createTime'.[ Both are of int type also]. But as of now we are not maintaining any values in these fields and always will be zero only.[ default value].
When I checked the code DDLTask.writeFileSystemStats () contains code to display the lastaccesstime by getting the last access time from the underlying file system. So in case of command, show table extended like <TN>, this method is getting used and the last access time is getting displayed. In case of command describe exteneded <TN> the last access time is getting dispalyed from
In org.apache.hadoop.hive.metastore.api.Table, the
private int lastAccessTime; will always be default value ( 0 ) only and no one updates this also.
I have 2 points here.
1. Why we are not making use of the fields in tbls meta data table for storing the last access time, create time?
2. Why is the dat type for lastAccessTime in org.apache.hadoop.hive.metastore.api.Table is int and not long? In order to capture the access time with values of System.currentTimeMillis() this type to be long. Also pls refer that in case of org.apache.hadoop.fs.FileStatus the access_time is having long data type rather than int.