A follow-up on #17297. This PR #18688 adds the feature to allow user to create a custom logical plan for DataFrame::cache by registering a logical plan transformation via CacheFactory. To translate that into a physical plan, user needs to have their own ExtensionPlanner and/or QueryPlanner. Add an example demonstrating how to do that.