use rsplit in resource_sql