001/*
002// This software is subject to the terms of the Eclipse Public License v1.0
003// Agreement, available at the following URL:
004// http://www.eclipse.org/legal/epl-v10.html.
005// You must accept the terms of that agreement to use this software.
006//
007// Copyright (C) 2009-2011 Pentaho
008// All Rights Reserved.
009*/
010package mondrian.spi.impl;
011
012import java.sql.Connection;
013import java.sql.SQLException;
014import java.util.List;
015
016/**
017 * Implementation of {@link mondrian.spi.Dialect} for the Vertica database.
018 *
019 * @author Pedro Alves
020 * @since Sept 11, 2009
021 */
022public class VerticaDialect extends JdbcDialectImpl {
023
024    public static final JdbcDialectFactory FACTORY =
025        new JdbcDialectFactory(
026            VerticaDialect.class,
027            DatabaseProduct.VERTICA);
028
029    /**
030     * Creates a VerticaDialect.
031     *
032     * @param connection Connection
033     */
034    public VerticaDialect(Connection connection) throws SQLException {
035        super(connection);
036    }
037
038    public boolean requiresAliasForFromQuery() {
039        return true;
040    }
041
042    public boolean allowsFromQuery() {
043        return true;
044    }
045
046    @Override
047    public DatabaseProduct getDatabaseProduct() {
048        return DatabaseProduct.VERTICA;
049    }
050
051    @Override
052    public boolean supportsResultSetConcurrency(int type, int concurrency) {
053        return false;
054    }
055
056    public String generateInline(
057        List<String> columnNames,
058        List<String> columnTypes,
059        List<String[]> valueList)
060    {
061        return generateInlineGeneric(
062            columnNames, columnTypes, valueList, null, false);
063    }
064}
065
066// End VerticaDialect.java