Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MONDRIAN: Integrating change #13038, added Vertica dialect, fix for M…
…ONDRIAN-617 contributed by Pedro Alves, Vertica doesn't support ORDER BY.. NULLS LAST type of queries. Invalid sql [git-p4: depot-paths = "//open/mondrian-release/3.1/": change = 13039]
- Loading branch information
Will Gorman
committed
Sep 11, 2009
1 parent
3f28ed5
commit 02feb91
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
// This software is subject to the terms of the Eclipse Public License v1.0 | ||
// Agreement, available at the following URL: | ||
// http://www.eclipse.org/legal/epl-v10.html. | ||
// Copyright (C) 2009 Julian Hyde | ||
// All Rights Reserved. | ||
// You must accept the terms of that agreement to use this software. | ||
*/ | ||
package mondrian.spi.impl; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* Implementation of {@link mondrian.spi.Dialect} for the Vertica database. | ||
* | ||
* @author Pedro Alves | ||
* @version $Id$ | ||
* @since Sept 11, 2009 | ||
*/ | ||
public class VerticaDialect extends JdbcDialectImpl { | ||
|
||
public static final JdbcDialectFactory FACTORY = | ||
new JdbcDialectFactory( | ||
VerticaDialect.class, | ||
DatabaseProduct.VERTICA); | ||
|
||
/** | ||
* Creates a VerticaDialect. | ||
* | ||
* @param connection Connection | ||
*/ | ||
public VerticaDialect(Connection connection) throws SQLException { | ||
super(connection); | ||
} | ||
|
||
public boolean requiresAliasForFromQuery() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String generateOrderItem( | ||
String expr, | ||
boolean nullable, | ||
boolean ascending) | ||
{ | ||
if (ascending) { | ||
return expr + " ASC"; | ||
} else { | ||
return expr + " DESC"; | ||
} | ||
} | ||
|
||
} | ||
|
||
// End VerticaDialect.java |