As discussed in CALCITE-3250, we should always derive data type from SqlValidator instead of RelDataTypeFactory.
GitHub Pull Request #1392