private static StringBuilder getBaseDDSelectForDimTable(DDTable ddTableForDimTable) {
    StringBuilder baseSelectBuilder = new StringBuilder();

    baseSelectBuilder.append(WhConstants.SELECT_OP);

    int i = 0;
    List<DDTableColumn> ddTableColumnList = ddTableForDimTable.getColumns();
    for (DDTableColumn ddTableColumn : ddTableColumnList) {
      baseSelectBuilder.append(ddTableColumn.getColumnName());
      if (i != ddTableColumnList.size() - 1) {
        baseSelectBuilder.append(WhConstants.COMMA);
      }
      i++;
    }

    baseSelectBuilder.append(WhConstants.FROM).append(ddTableForDimTable.getQualifiedName()).append(" ");

    if (StringUtils.isNotBlank(ddTableForDimTable.getAlias())) {
      baseSelectBuilder.append(ddTableForDimTable.getAlias()).append(" ");
    }

    List<DDTableJoin> ddTableJoins = ddTableForDimTable.getJoins();

    for (DDTableJoin ddTableJoin : ddTableJoins) {
      if (StringUtils.isBlank(ddTableJoin.getJoinType())) {
        baseSelectBuilder.append(WhConstants.INNER_JOIN);
      } else {
        baseSelectBuilder.append(ddTableJoin.getJoinType());
      }

      baseSelectBuilder.append(ddTableJoin.getJoinTableQualifiedName());
      if (StringUtils.isNotBlank(ddTableJoin.getJoinTableAlias())) {
        baseSelectBuilder.append(ddTableJoin.getJoinTableAlias()).append(" ");
      }

      baseSelectBuilder.append(WhConstants.ON);
      baseSelectBuilder.append(ddTableJoin.getLhsCol());
      baseSelectBuilder.append(" = ");
      baseSelectBuilder.append(ddTableJoin.getRhsCol());
    }

    baseSelectBuilder.append(getDefaultWhereForDDSelect(ddTableForDimTable));


    return baseSelectBuilder;
  }