Interface QueryProvider

All Known Subinterfaces:
CalciteConnection
All Known Implementing Classes:
JdbcQueryProvider, QueryProviderImpl

public interface QueryProvider
Defines methods to create and execute queries that are described by a Queryable object.

Analogous to LINQ's System.Linq.QueryProvider.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> Queryable<T>
    createQuery(Expression expression, Class<T> rowType)
    Constructs a Queryable object that can evaluate the query represented by a specified expression tree.
    <T> Queryable<T>
    createQuery(Expression expression, Type rowType)
    Constructs a Queryable object that can evaluate the query represented by a specified expression tree.
    <T> T
    execute(Expression expression, Class<T> type)
    Executes the query represented by a specified expression tree.
    <T> T
    execute(Expression expression, Type type)
    Executes the query represented by a specified expression tree.
    <T> Enumerator<T>
    executeQuery(Queryable<T> queryable)
    Executes a queryable, and returns an enumerator over the rows that it yields.
  • Method Details

    • createQuery

      <T> Queryable<T> createQuery(Expression expression, Class<T> rowType)
      Constructs a Queryable object that can evaluate the query represented by a specified expression tree.

      NOTE: The RawQueryable.getExpression() property of the returned Queryable object is equal to expression.

      Type Parameters:
      T - Row type
      Parameters:
      expression - Expression
      rowType - Row type
      Returns:
      Queryable
    • createQuery

      <T> Queryable<T> createQuery(Expression expression, Type rowType)
      Constructs a Queryable object that can evaluate the query represented by a specified expression tree. The row type may contain generic information.
      Type Parameters:
      T - Row type
      Parameters:
      expression - Expression
      rowType - Row type
      Returns:
      Queryable
    • execute

      <T> T execute(Expression expression, Class<T> type)
      Executes the query represented by a specified expression tree.

      This method executes queries that return a single value (instead of an enumerable sequence of values). Expression trees that represent queries that return enumerable results are executed when the Queryable object that contains the expression tree is enumerated.

      The Queryable standard query operator methods that return singleton results call execute. They pass it a MethodCallExpression that represents a linq4j query.

    • execute

      <T> T execute(Expression expression, Type type)
      Executes the query represented by a specified expression tree. The row type may contain type parameters.
    • executeQuery

      <T> Enumerator<T> executeQuery(Queryable<T> queryable)
      Executes a queryable, and returns an enumerator over the rows that it yields.
      Parameters:
      queryable - Queryable
      Returns:
      Enumerator over rows