Thanks Julian. I found a similar problem with ModifiableViewTable storing ModifiableViewTableInitializerExpressionFactory which extends NullInitializerExpressionFactory and stores RexBuilder.typeFactory. I modified the interface for InitializerExpressionFactory to use a type factory per statement since InitializerExpressionFactory is typically stored in a Table. The PR has been updated with these changes.
I will add more test cases in SqlParserTest, test cases for case sensitivity on extended columns, and for handling the case where an extended column (of a table, and of a view) has the same name but differing data-type from a column of the base table as discussed in: https://lists.apache.org/thread.html/a2a882b327368d052d074eeb433be794f8d58a31c18fe05a32fae43d@<dev.calcite.apache.org>
Support for qualified column names (nested columns or column families) for extended columns will likely be deferred to a second JIRA as it looks to involve more changes to the parser and I don't want to create a monolithic pull request.