/** * Verify that the call to updateTableStatsSlow() removes DO_NOT_UPDATE_STATS from table params. */ @Test public void testUpdateTableStatsSlow_removesDoNotUpdateStats() throws TException { // Create database and table Table tbl = new TableBuilder() .setDbName(DB_NAME) .setTableName(TABLE_NAME) .addCol("id", "int") .addTableParam(StatsSetupConst.DO_NOT_UPDATE_STATS, "true") .build(null); Table tbl1 = new TableBuilder() .setDbName(DB_NAME) .setTableName(TABLE_NAME) .addCol("id", "int") .addTableParam(StatsSetupConst.DO_NOT_UPDATE_STATS, "false") .build(null); Warehouse wh = mock(Warehouse.class); MetaStoreServerUtils.updateTableStatsSlow(db, tbl, wh, false, true, null); assertThat(tbl.getParameters(), is(Collections.emptyMap())); verify(wh, never()).getFileStatusesForUnpartitionedTable(db, tbl); MetaStoreServerUtils.updateTableStatsSlow(db, tbl1, wh, true, false, null); assertThat(tbl.getParameters(), is(Collections.emptyMap())); verify(wh, never()).getFileStatusesForUnpartitionedTable(db, tbl1); }
MetaStoreServerUtils.updateTableStatsSlow(db, tbl, wh, madeDir, false, envContext);
Warehouse wh = mock(Warehouse.class); MetaStoreServerUtils.updateTableStatsSlow(db, tbl, wh, true, false, null); verify(wh, never()).getFileStatusesForUnpartitionedTable(db, tbl); .setPartCols(cols) .build(null); MetaStoreServerUtils.updateTableStatsSlow(db, tbl1, wh, false, false, null); verify(wh, never()).getFileStatusesForUnpartitionedTable(db, tbl1); .setTableParams(paramsWithStats) .build(null); MetaStoreServerUtils.updateTableStatsSlow(db, tbl2, wh, false, false, null); verify(wh, never()).getFileStatusesForUnpartitionedTable(db, tbl2);
Database db = msdb.getDatabase(catName, newDbName); MetaStoreServerUtils.updateTableStatsSlow(db, newt, wh, false, true, environmentContext);
NUM_ERASURE_CODED_FILES, "1" ); MetaStoreServerUtils.updateTableStatsSlow(db, tbl, wh, false, false, null); assertThat(tbl.getParameters(), is(expected)); .build(null); when(wh.getFileStatusesForUnpartitionedTable(db, tbl1)).thenReturn(fileStatus); MetaStoreServerUtils.updateTableStatsSlow(db, tbl1, wh, false, true, null); assertThat(tbl1.getParameters(), is(expected)); .build(null); when(wh.getFileStatusesForUnpartitionedTable(db, tbl2)).thenReturn(fileStatus); MetaStoreServerUtils.updateTableStatsSlow(db, tbl2, wh, false, true, null); assertThat(tbl2.getParameters(), is(expected)); .build(null); when(wh.getFileStatusesForUnpartitionedTable(db, tbl3)).thenReturn(fileStatus); MetaStoreServerUtils.updateTableStatsSlow(db, tbl3, wh, false, true, context);