Search in sources :

Example 1 with SQLDialect

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect in project elide by yahoo.

the class SQLQueryEngine method executeQuery.

@Override
public QueryResult executeQuery(Query query, Transaction transaction) {
    SqlTransaction sqlTransaction = (SqlTransaction) transaction;
    ConnectionDetails details = query.getConnectionDetails();
    DataSource dataSource = details.getDataSource();
    SQLDialect dialect = details.getDialect();
    Query expandedQuery = expandMetricQueryPlans(query);
    // Translate the query into SQL.
    NativeQuery sql = toSQL(expandedQuery, dialect);
    String queryString = sql.toString();
    QueryResult.QueryResultBuilder resultBuilder = QueryResult.builder();
    NamedParamPreparedStatement stmt;
    Pagination pagination = query.getPagination();
    if (returnPageTotals(pagination)) {
        resultBuilder.pageTotals(getPageTotal(expandedQuery, sql, query, sqlTransaction));
    }
    log.debug("SQL Query: " + queryString);
    stmt = sqlTransaction.initializeStatement(queryString, dataSource);
    // Supply the query parameters to the query
    supplyFilterQueryParameters(query, stmt, dialect);
    // Run the primary query and log the time spent.
    ResultSet resultSet = runQuery(stmt, queryString, Function.identity());
    resultBuilder.data(new EntityHydrator(resultSet, query, metadataDictionary));
    return resultBuilder.build();
}
Also used : NativeQuery(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.NativeQuery) Query(com.yahoo.elide.datastores.aggregation.query.Query) VersionQuery(com.yahoo.elide.datastores.aggregation.queryengines.sql.annotation.VersionQuery) DataSource(javax.sql.DataSource) Pagination(com.yahoo.elide.core.request.Pagination) QueryResult(com.yahoo.elide.datastores.aggregation.query.QueryResult) NativeQuery(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.NativeQuery) SQLDialect(com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect) ResultSet(java.sql.ResultSet)

Example 2 with SQLDialect

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect in project elide by yahoo.

the class SQLQueryEngine method toPageTotalSQL.

/**
 * Takes a SQLQuery and creates a new clone that instead returns the total number of records of the original
 * query.
 *
 * @param query The client query
 * @param sql The generated SQL query
 * @param sqlDialect the SQL dialect
 * @return A new query that returns the total number of records.
 */
private NativeQuery toPageTotalSQL(Query query, NativeQuery sql, SQLDialect sqlDialect) {
    // TODO: refactor this method
    String groupByDimensions = query.getAllDimensionProjections().stream().map(SQLColumnProjection.class::cast).filter(SQLColumnProjection::isProjected).map((column) -> column.toSQL(query, metaDataStore)).collect(Collectors.joining(", "));
    if (groupByDimensions.isEmpty()) {
        // Metric projection without group by dimension will return onely 1 record.
        return null;
    }
    NativeQuery innerQuery = NativeQuery.builder().projectionClause(groupByDimensions).fromClause(sql.getFromClause()).joinClause(sql.getJoinClause()).whereClause(sql.getWhereClause()).groupByClause(String.format("GROUP BY %s", groupByDimensions)).havingClause(sql.getHavingClause()).build();
    return NativeQuery.builder().projectionClause("COUNT(*)").fromClause(QueryTranslator.getFromClause("(" + innerQuery + ")", applyQuotes("pagination_subquery", sqlDialect), sqlDialect)).build();
}
Also used : PredicateExtractionVisitor(com.yahoo.elide.core.filter.expression.PredicateExtractionVisitor) SQLColumnProjection(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.SQLColumnProjection) FilterPredicate(com.yahoo.elide.core.filter.predicates.FilterPredicate) Arrays(java.util.Arrays) Connection(java.sql.Connection) Dimension(com.yahoo.elide.datastores.aggregation.metadata.models.Dimension) NativeQuery(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.NativeQuery) Argument(com.yahoo.elide.core.request.Argument) EnumType(javax.persistence.EnumType) TimedFunction(com.yahoo.elide.core.utils.TimedFunction) Time(com.yahoo.elide.datastores.aggregation.timegrains.Time) NamespacePackage(com.yahoo.elide.datastores.aggregation.dynamic.NamespacePackage) Namespace(com.yahoo.elide.datastores.aggregation.metadata.models.Namespace) ResultSet(java.sql.ResultSet) Map(java.util.Map) Enumerated(javax.persistence.Enumerated) MetricProjection(com.yahoo.elide.datastores.aggregation.query.MetricProjection) DefaultQueryPlanMerger(com.yahoo.elide.datastores.aggregation.query.DefaultQueryPlanMerger) QueryPlanMerger(com.yahoo.elide.datastores.aggregation.query.QueryPlanMerger) Collection(java.util.Collection) ValueType(com.yahoo.elide.datastores.aggregation.metadata.enums.ValueType) Set(java.util.Set) QueryResult(com.yahoo.elide.datastores.aggregation.query.QueryResult) FromTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.annotation.FromTable) ColumnContext.applyQuotes(com.yahoo.elide.datastores.aggregation.metadata.ColumnContext.applyQuotes) QueryValidator(com.yahoo.elide.datastores.aggregation.QueryValidator) CoerceUtil(com.yahoo.elide.core.utils.coerce.CoerceUtil) Collectors(java.util.stream.Collectors) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) Query(com.yahoo.elide.datastores.aggregation.query.Query) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) TimeDimension(com.yahoo.elide.datastores.aggregation.metadata.models.TimeDimension) Annotation(java.lang.annotation.Annotation) Table(com.yahoo.elide.datastores.aggregation.metadata.models.Table) Optimizer(com.yahoo.elide.datastores.aggregation.query.Optimizer) TimeDimensionProjection(com.yahoo.elide.datastores.aggregation.query.TimeDimensionProjection) MetaDataStore(com.yahoo.elide.datastores.aggregation.metadata.MetaDataStore) SQLDimensionProjection(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.SQLDimensionProjection) VersionQuery(com.yahoo.elide.datastores.aggregation.queryengines.sql.annotation.VersionQuery) Getter(lombok.Getter) ColumnArgumentValidator(com.yahoo.elide.datastores.aggregation.validator.ColumnArgumentValidator) TableArgumentValidator(com.yahoo.elide.datastores.aggregation.validator.TableArgumentValidator) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) SQLException(java.sql.SQLException) SQLDialect(com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect) QueryTranslator(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.QueryTranslator) Column(com.yahoo.elide.datastores.aggregation.metadata.models.Column) DataSource(javax.sql.DataSource) SQLTimeDimensionProjection(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.SQLTimeDimensionProjection) QueryEngine(com.yahoo.elide.datastores.aggregation.QueryEngine) DimensionProjection(com.yahoo.elide.datastores.aggregation.query.DimensionProjection) FromSubquery(com.yahoo.elide.datastores.aggregation.queryengines.sql.annotation.FromSubquery) DefaultQueryValidator(com.yahoo.elide.datastores.aggregation.DefaultQueryValidator) QueryPlan(com.yahoo.elide.datastores.aggregation.query.QueryPlan) QueryPlanTranslator(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.QueryPlanTranslator) FormulaValidator(com.yahoo.elide.datastores.aggregation.metadata.FormulaValidator) Pagination(com.yahoo.elide.core.request.Pagination) SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) Type(com.yahoo.elide.core.type.Type) Preconditions(com.google.common.base.Preconditions) Metric(com.yahoo.elide.datastores.aggregation.metadata.models.Metric) SQLColumnProjection(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.SQLColumnProjection) NativeQuery(com.yahoo.elide.datastores.aggregation.queryengines.sql.query.NativeQuery)

Example 3 with SQLDialect

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect in project elide by yahoo.

the class JoinExpressionExtractor method visitJoinReference.

@Override
public Set<String> visitJoinReference(JoinReference reference) {
    JoinPath joinPath = reference.getPath();
    List<PathElement> pathElements = joinPath.getPathElements();
    ColumnContext currentCtx = this.context;
    for (int i = 0; i < pathElements.size() - 1; i++) {
        PathElement pathElement = pathElements.get(i);
        Type<?> joinClass = pathElement.getFieldType();
        String joinFieldName = pathElement.getFieldName();
        SQLJoin sqlJoin = currentCtx.getQueryable().getJoin(joinFieldName);
        ColumnContext joinCtx;
        String onClause;
        JoinType joinType;
        String fullExpression;
        if (sqlJoin != null) {
            joinType = sqlJoin.getJoinType();
            joinCtx = (ColumnContext) currentCtx.get(joinFieldName);
            if (joinType.equals(JoinType.CROSS)) {
                onClause = EMPTY;
            } else {
                onClause = ON + currentCtx.resolve(sqlJoin.getJoinExpression());
            }
        } else {
            joinType = JoinType.LEFT;
            SQLTable table = metaDataStore.getTable(joinClass);
            joinCtx = ColumnContext.builder().queryable(table).alias(appendAlias(currentCtx.getAlias(), joinFieldName)).metaDataStore(currentCtx.getMetaDataStore()).column(currentCtx.getColumn()).tableArguments(mergedArgumentMap(table.getArguments(), currentCtx.getTableArguments())).build();
            onClause = ON + String.format("%s.%s = %s.%s", currentCtx.getAlias(), dictionary.getAnnotatedColumnName(pathElement.getType(), joinFieldName), joinCtx.getAlias(), dictionary.getAnnotatedColumnName(joinClass, dictionary.getIdFieldName(joinClass)));
        }
        SQLDialect sqlDialect = currentCtx.getQueryable().getDialect();
        String joinAlias = applyQuotes(joinCtx.getAlias(), sqlDialect);
        String joinKeyword = currentCtx.getQueryable().getDialect().getJoinKeyword(joinType);
        String joinSource = constructTableOrSubselect(joinCtx, joinClass);
        if (sqlDialect.useASBeforeTableAlias()) {
            fullExpression = String.format("%s %s AS %s %s", joinKeyword, joinSource, joinAlias, onClause);
        } else {
            fullExpression = String.format("%s %s %s %s", joinKeyword, joinSource, joinAlias, onClause);
        }
        joinExpressions.add(fullExpression);
        /**
         * If this `for` loop runs more than once, context should be switched to join context.
         */
        currentCtx = joinCtx;
    }
    // If reference within current join reference is of type PhysicalReference, then below visitor doesn't matter.
    // If it is of type LogicalReference, then visitLogicalReference method will recreate visitor with correct
    // value of ColumnProjection in context.
    JoinExpressionExtractor visitor = new JoinExpressionExtractor(currentCtx);
    joinExpressions.addAll(reference.getReference().accept(visitor));
    return joinExpressions;
}
Also used : JoinPath(com.yahoo.elide.datastores.aggregation.core.JoinPath) PathElement(com.yahoo.elide.core.Path.PathElement) SQLDialect(com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect) SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) ColumnContext(com.yahoo.elide.datastores.aggregation.metadata.ColumnContext) SQLJoin(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLJoin) JoinType(com.yahoo.elide.datastores.aggregation.annotation.JoinType)

Example 4 with SQLDialect

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect in project elide by yahoo.

the class SQLUnitTest method init.

public static void init(SQLDialect sqlDialect, Set<Optimizer> optimizers, MetaDataStore metaDataStore) {
    Properties properties = new Properties();
    properties.put("driverClassName", "org.h2.Driver");
    String jdbcUrl = "jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1" + ";NON_KEYWORDS=VALUE,USER" + ";DATABASE_TO_UPPER=FALSE" + getCompatabilityMode(sqlDialect.getDialectType());
    properties.put("jdbcUrl", jdbcUrl);
    HikariConfig config = new HikariConfig(properties);
    DataSource dataSource = new HikariDataSource(config);
    try (Connection h2Conn = dataSource.getConnection()) {
        h2Conn.createStatement().execute("RUNSCRIPT FROM 'classpath:prepare_tables.sql'");
    } catch (SQLException e) {
        ((HikariDataSource) dataSource).close();
        throw new IllegalStateException(e);
    }
    SQLUnitTest.metaDataStore = metaDataStore;
    dictionary = EntityDictionary.builder().build();
    dictionary.bindEntity(PlayerStatsWithView.class);
    dictionary.bindEntity(PlayerStatsView.class);
    dictionary.bindEntity(PlayerStats.class);
    dictionary.bindEntity(Country.class);
    dictionary.bindEntity(SubCountry.class);
    dictionary.bindEntity(Player.class);
    dictionary.bindEntity(CountryView.class);
    dictionary.bindEntity(CountryViewNested.class);
    dictionary.bindEntity(Continent.class);
    dictionary.bindEntity(GameRevenue.class);
    filterParser = RSQLFilterDialect.builder().dictionary(dictionary).build();
    // Manually register the serdes because we are not running a complete Elide service.
    CoerceUtil.register(Day.class, new Day.DaySerde());
    CoerceUtil.register(Hour.class, new Hour.HourSerde());
    CoerceUtil.register(ISOWeek.class, new ISOWeek.ISOWeekSerde());
    CoerceUtil.register(Minute.class, new Minute.MinuteSerde());
    CoerceUtil.register(Month.class, new Month.MonthSerde());
    CoerceUtil.register(Quarter.class, new Quarter.QuarterSerde());
    CoerceUtil.register(Second.class, new Second.SecondSerde());
    CoerceUtil.register(Week.class, new Week.WeekSerde());
    CoerceUtil.register(Year.class, new Year.YearSerde());
    metaDataStore.populateEntityDictionary(dictionary);
    // Need to provide details for connections used by all available models.
    Map<String, ConnectionDetails> connectionDetailsMap = new HashMap<>();
    connectionDetailsMap.put("mycon", new ConnectionDetails(dataSource, sqlDialect));
    connectionDetailsMap.put("SalesDBConnection", new ConnectionDetails(DUMMY_DATASOURCE, sqlDialect));
    Function<String, ConnectionDetails> connectionLookup = (name) -> connectionDetailsMap.getOrDefault(name, new ConnectionDetails(dataSource, sqlDialect));
    engine = new SQLQueryEngine(metaDataStore, connectionLookup, optimizers, new DefaultQueryPlanMerger(metaDataStore), new DefaultQueryValidator(metaDataStore.getMetadataDictionary()));
    playerStatsTable = (SQLTable) metaDataStore.getTable("playerStats", NO_VERSION);
    videoGameTable = (SQLTable) metaDataStore.getTable("videoGame", NO_VERSION);
    playerStatsViewTable = (SQLTable) metaDataStore.getTable("playerStatsView", NO_VERSION);
    playerStatsViewTableArgs = new HashMap<>();
    playerStatsViewTableArgs.put("rating", Argument.builder().name("overallRating").value("Great").build());
    playerStatsViewTableArgs.put("minScore", Argument.builder().name("minScore").value("0").build());
}
Also used : Quarter(com.yahoo.elide.datastores.aggregation.timegrains.Quarter) Year(com.yahoo.elide.datastores.aggregation.timegrains.Year) BeforeEach(org.junit.jupiter.api.BeforeEach) FilterPredicate(com.yahoo.elide.core.filter.predicates.FilterPredicate) Arrays(java.util.Arrays) Path(com.yahoo.elide.core.Path) Connection(java.sql.Connection) Provider(javax.inject.Provider) Include(com.yahoo.elide.annotation.Include) ParseException(com.yahoo.elide.core.filter.dialect.ParseException) SortingImpl(com.yahoo.elide.core.sort.SortingImpl) ClassType(com.yahoo.elide.core.type.ClassType) Argument(com.yahoo.elide.core.request.Argument) RSQLFilterDialect(com.yahoo.elide.core.filter.dialect.RSQLFilterDialect) Continent(example.dimensions.Continent) ISOWeek(com.yahoo.elide.datastores.aggregation.timegrains.ISOWeek) OrFilterExpression(com.yahoo.elide.core.filter.expression.OrFilterExpression) Map(java.util.Map) MetricProjection(com.yahoo.elide.datastores.aggregation.query.MetricProjection) DefaultQueryPlanMerger(com.yahoo.elide.datastores.aggregation.query.DefaultQueryPlanMerger) SQLDialectFactory(com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialectFactory) STRING_TYPE(com.yahoo.elide.core.type.ClassType.STRING_TYPE) DefaultClassScanner(com.yahoo.elide.core.utils.DefaultClassScanner) Set(java.util.Set) CoerceUtil(com.yahoo.elide.core.utils.coerce.CoerceUtil) Collectors(java.util.stream.Collectors) EntityDictionary(com.yahoo.elide.core.dictionary.EntityDictionary) PlayerStats(example.PlayerStats) ConnectionDetails(com.yahoo.elide.datastores.aggregation.queryengines.sql.ConnectionDetails) Query(com.yahoo.elide.datastores.aggregation.query.Query) List(java.util.List) Hour(com.yahoo.elide.datastores.aggregation.timegrains.Hour) ImmutablePagination(com.yahoo.elide.datastores.aggregation.query.ImmutablePagination) TypeHelper.getClassType(com.yahoo.elide.core.utils.TypeHelper.getClassType) HikariDataSource(com.zaxxer.hikari.HikariDataSource) AndFilterExpression(com.yahoo.elide.core.filter.expression.AndFilterExpression) Optimizer(com.yahoo.elide.datastores.aggregation.query.Optimizer) Pattern(java.util.regex.Pattern) MetaDataStore(com.yahoo.elide.datastores.aggregation.metadata.MetaDataStore) Assertions.assertDoesNotThrow(org.junit.jupiter.api.Assertions.assertDoesNotThrow) Attribute(com.yahoo.elide.core.request.Attribute) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) SQLQueryEngine(com.yahoo.elide.datastores.aggregation.queryengines.sql.SQLQueryEngine) CountryViewNested(example.dimensions.CountryViewNested) Day(com.yahoo.elide.datastores.aggregation.timegrains.Day) Quarter(com.yahoo.elide.datastores.aggregation.timegrains.Quarter) SubCountry(example.dimensions.SubCountry) Second(com.yahoo.elide.datastores.aggregation.timegrains.Second) Week(com.yahoo.elide.datastores.aggregation.timegrains.Week) HashMap(java.util.HashMap) TimeGrain(com.yahoo.elide.datastores.aggregation.metadata.enums.TimeGrain) CountryView(example.dimensions.CountryView) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) SQLException(java.sql.SQLException) SQLDialect(com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect) Month(com.yahoo.elide.datastores.aggregation.timegrains.Month) DataSource(javax.sql.DataSource) NO_VERSION(com.yahoo.elide.core.dictionary.EntityDictionary.NO_VERSION) StreamSupport(java.util.stream.StreamSupport) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) FilterExpression(com.yahoo.elide.core.filter.expression.FilterExpression) LinkedHashSet(java.util.LinkedHashSet) PlayerStatsView(example.PlayerStatsView) QueryEngine(com.yahoo.elide.datastores.aggregation.QueryEngine) DimensionProjection(com.yahoo.elide.datastores.aggregation.query.DimensionProjection) Properties(java.util.Properties) Sorting(com.yahoo.elide.core.request.Sorting) GameRevenue(example.GameRevenue) Minute(com.yahoo.elide.datastores.aggregation.timegrains.Minute) DefaultQueryValidator(com.yahoo.elide.datastores.aggregation.DefaultQueryValidator) Player(example.Player) HikariConfig(com.zaxxer.hikari.HikariConfig) AfterEach(org.junit.jupiter.api.AfterEach) Country(example.dimensions.Country) TreeMap(java.util.TreeMap) SQLTable(com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable) Type(com.yahoo.elide.core.type.Type) Operator(com.yahoo.elide.core.filter.Operator) PlayerStatsWithView(example.PlayerStatsWithView) SQLQueryEngine(com.yahoo.elide.datastores.aggregation.queryengines.sql.SQLQueryEngine) HikariDataSource(com.zaxxer.hikari.HikariDataSource) SQLException(java.sql.SQLException) HashMap(java.util.HashMap) ConnectionDetails(com.yahoo.elide.datastores.aggregation.queryengines.sql.ConnectionDetails) DefaultQueryPlanMerger(com.yahoo.elide.datastores.aggregation.query.DefaultQueryPlanMerger) Properties(java.util.Properties) DefaultQueryValidator(com.yahoo.elide.datastores.aggregation.DefaultQueryValidator) Month(com.yahoo.elide.datastores.aggregation.timegrains.Month) Minute(com.yahoo.elide.datastores.aggregation.timegrains.Minute) Hour(com.yahoo.elide.datastores.aggregation.timegrains.Hour) Connection(java.sql.Connection) HikariConfig(com.zaxxer.hikari.HikariConfig) HikariDataSource(com.zaxxer.hikari.HikariDataSource) DataSource(javax.sql.DataSource) ISOWeek(com.yahoo.elide.datastores.aggregation.timegrains.ISOWeek) Second(com.yahoo.elide.datastores.aggregation.timegrains.Second) Year(com.yahoo.elide.datastores.aggregation.timegrains.Year) Day(com.yahoo.elide.datastores.aggregation.timegrains.Day) ISOWeek(com.yahoo.elide.datastores.aggregation.timegrains.ISOWeek) Week(com.yahoo.elide.datastores.aggregation.timegrains.Week)

Example 5 with SQLDialect

use of com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect in project elide by yahoo.

the class AggregationDataStoreIntegrationTest method createHarness.

@Override
protected DataStoreTestHarness createHarness() {
    HikariConfig config = new HikariConfig(File.separator + "jpah2db.properties");
    DataSource defaultDataSource = new HikariDataSource(config);
    SQLDialect defaultDialect = SQLDialectFactory.getDefaultDialect();
    ConnectionDetails defaultConnectionDetails = new ConnectionDetails(defaultDataSource, defaultDialect);
    Properties prop = new Properties();
    prop.put("javax.persistence.jdbc.driver", config.getDriverClassName());
    prop.put("javax.persistence.jdbc.url", config.getJdbcUrl());
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("aggregationStore", prop);
    Map<String, ConnectionDetails> connectionDetailsMap = new HashMap<>();
    // Add an entry for "mycon" connection which is not from hjson
    connectionDetailsMap.put("mycon", defaultConnectionDetails);
    // Add connection details fetched from hjson
    VALIDATOR.getElideSQLDBConfig().getDbconfigs().forEach(dbConfig -> connectionDetailsMap.put(dbConfig.getName(), new ConnectionDetails(getDataSource(dbConfig, getDBPasswordExtractor()), SQLDialectFactory.getDialect(dbConfig.getDialect()))));
    return new AggregationDataStoreTestHarness(emf, defaultConnectionDetails, connectionDetailsMap, VALIDATOR);
}
Also used : AggregationDataStoreTestHarness(com.yahoo.elide.datastores.aggregation.framework.AggregationDataStoreTestHarness) HikariDataSource(com.zaxxer.hikari.HikariDataSource) HashMap(java.util.HashMap) SQLDialect(com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect) EntityManagerFactory(javax.persistence.EntityManagerFactory) ConnectionDetails(com.yahoo.elide.datastores.aggregation.queryengines.sql.ConnectionDetails) HikariConfig(com.zaxxer.hikari.HikariConfig) Properties(java.util.Properties) HikariDataSource(com.zaxxer.hikari.HikariDataSource) DataSource(javax.sql.DataSource)

Aggregations

SQLDialect (com.yahoo.elide.datastores.aggregation.queryengines.sql.dialects.SQLDialect)9 DataSource (javax.sql.DataSource)6 MetaDataStore (com.yahoo.elide.datastores.aggregation.metadata.MetaDataStore)4 Query (com.yahoo.elide.datastores.aggregation.query.Query)4 List (java.util.List)4 Set (java.util.Set)4 Collectors (java.util.stream.Collectors)4 Argument (com.yahoo.elide.core.request.Argument)3 MetricProjection (com.yahoo.elide.datastores.aggregation.query.MetricProjection)3 ConnectionDetails (com.yahoo.elide.datastores.aggregation.queryengines.sql.ConnectionDetails)3 SQLTable (com.yahoo.elide.datastores.aggregation.queryengines.sql.metadata.SQLTable)3 NativeQuery (com.yahoo.elide.datastores.aggregation.queryengines.sql.query.NativeQuery)3 HikariConfig (com.zaxxer.hikari.HikariConfig)3 HikariDataSource (com.zaxxer.hikari.HikariDataSource)3 Arrays (java.util.Arrays)3 HashMap (java.util.HashMap)3 LinkedHashSet (java.util.LinkedHashSet)3 Map (java.util.Map)3 Properties (java.util.Properties)3 EntityDictionary (com.yahoo.elide.core.dictionary.EntityDictionary)2