dengzhhu653 commented on PR #5929: URL: https://github.com/apache/hive/pull/5929#issuecomment-3060469072
> > UPDATE TBS > > SET last_updated = NOW() > > WHERE TBL_ID = AND last_updated = ''; -- The exact timestamp you originally read > > As far as I know in MySQL this will block others for the same row(the same for update), if the 0 row returns, means we have acquired the X `tblId` row lock, why do we need to retry again? > > But this inspires me we can alter the table during the updating the column statistics, so we don't ask for the row lock explicitly, I will try and test this approach. Thank you! After some reach, I found it's hard to use DataNucleus without the pure "UPDATE" query, ```java mTable.setLastAccessTime((int) (System.currentTimeMillis()/1000)); pm.flush(); // here might flush the old MTable into data store pm.refresh(mTable); ``` In `pm.flush()` the old state of the table can get overwritten the one in data store, resulting to some columns missing in COLUMN_STATS_ACCURATE, for example: `{"COLUMN_STATS":{"col_0":"true","col_1":"true","col_2":"true","col_3":"true","col_5":"true","col_6":"true","col_7":"true","col_8":"true"}}` `col_4` and `col_9` are missing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org