Originally, the code ensures checks "(partitionParam == null) && (inferSP);" to decide whether the query is cacheable or not.