moved translate query code to libsdb