cherry-pick 'Small fix to table sample' from 5-trunk