1. To ensure compatibility with the original optimizer, expose the non-lambda signature of highorder function externally. 2. fix some bugs in toSql function in the original optimizer