Rewrite the main queries in lda_train and lda_pred to be correctly executed when ORCA is on