Skip to content

Commit

Permalink
MONDRIAN: Fixes some issues with the Greenplum dialect and the test s…
Browse files Browse the repository at this point in the history
…uite when running it over Greenplum.

[git-p4: depot-paths = "//open/mondrian/": change = 14667]
  • Loading branch information
lucboudreau committed Oct 5, 2011
1 parent bc58c52 commit d8b2cbd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/mondrian/rolap/SqlMemberSource.java
Expand Up @@ -638,7 +638,7 @@ Pair<String, List<SqlStatement.Type>> makeChildMemberSql(
hierarchy.addToFrom(sqlQuery, exp);
}
final String s = exp.getExpression(sqlQuery);
String alias = sqlQuery.addSelect(s, null, null);
String alias = sqlQuery.addSelect(s, null);
// Some dialects allow us to eliminate properties from the
// group by that are functionally dependent on the level value
if (!sqlQuery.getDialect().allowsSelectNotInGroupBy()
Expand Down
12 changes: 10 additions & 2 deletions src/main/mondrian/spi/impl/GreenplumDialect.java
Expand Up @@ -54,14 +54,22 @@ public boolean supportsGroupingSets() {
return true;
}

public boolean allowsCountDistinct() {
public boolean requiresGroupByAlias() {
return true;
}

public boolean requiresAliasForFromQuery() {
return false;
}

public boolean allowsFromQuery() {
public boolean allowsCountDistinct() {
return true;
}

public boolean allowsFromQuery() {
return false;
}

public DatabaseProduct getDatabaseProduct() {
return DatabaseProduct.GREENPLUM;
}
Expand Down
2 changes: 2 additions & 0 deletions testsrc/main/mondrian/rolap/BatchTestCase.java
Expand Up @@ -498,6 +498,8 @@ protected String dialectize(Dialect.DatabaseProduct d, String sql) {
switch (d) {
case ORACLE:
return sql.replaceAll(" =as= ", " ");
case GREENPLUM:
case POSTGRESQL:
case TERADATA:
return sql.replaceAll(" =as= ", " as ");
case DERBY:
Expand Down
3 changes: 3 additions & 0 deletions testsrc/main/mondrian/rolap/FastBatchingCellReaderTest.java
Expand Up @@ -167,6 +167,7 @@ Dialect getDialect() {
case DB2:
case DB2_AS400:
case DB2_OLD_AS400:
case GREENPLUM:
assertTrue(fbcr.doesDBSupportGroupingSets());
break;
default:
Expand Down Expand Up @@ -1206,6 +1207,8 @@ public void testLoadDistinctSqlMeasure() {
case NETEZZA:
// Netezza gives an "ERROR: Correlated Subplan expressions not
// supported"
case GREENPLUM:
// Greenplum says 'Does not support yet that query'
return;
}

Expand Down

0 comments on commit d8b2cbd

Please sign in to comment.