How to extend Spark Catalyst optimizer with custom rules?
<p>I want to use Catalyst rules to transform star-schema (<a href="https://en.wikipedia.org/wiki/Star_schema" rel="nofollow">https://en.wikipedia.org/wiki/Star_schema</a>) SQL query to SQL query to denormalized star-schema where some fields from dimensions tables are represented in facts table. 
I tried to find some extension points to add own rules to make a transformation described above. But I didn't find any extension points. So there are the following questions: </p>

<ol>
<li>How can I add own rules to catalyst optimizer? </li>
<li>Is there another solution to implement a functionality described above?</li>
</ol>