Sketching preprocessor