Interface Queryable
-
Method Summary
Modifier and TypeMethodDescriptiondefault QueryResultexecuteQuery(String statement) Executes a query statement using default options (no query parameters, etc.), and buffers all result rows in memory.executeQuery(String statement, Consumer<QueryOptions> options) Executes a query statement using the specified options (query parameters, etc.), and buffers all result rows in memory.default QueryMetadataexecuteStreamingQuery(String statement, Consumer<Row> rowAction) Executes a query statement and passes result rows to the givenrowActioncallback, one by one as they arrive from the server.executeStreamingQuery(String statement, Consumer<Row> rowAction, Consumer<QueryOptions> options) Executes a query statement using the specified options, (query parameters, etc.), and passes result rows to the givenrowActioncallback, one by one as they arrive from the server.
-
Method Details
-
executeQuery
Executes a query statement using the specified options (query parameters, etc.), and buffers all result rows in memory.If the results are not known to fit in memory, consider using the streaming version that takes a row action callback:
executeStreamingQuery(String, Consumer, Consumer).- Parameters:
statement- The Analytics SQL++ statement to execute.options- A callback for specifying custom query options.- Returns:
- A query result consisting of metadata and a list of rows.
- Throws:
QueryException- if the server response indicates an error occurred.InvalidCredentialException- if the server rejects the user credentials.AnalyticsTimeoutException- if the query does not complete before the timeout expires.CancellationException- if the calling thread is interrupted.
-
executeQuery
Executes a query statement using default options (no query parameters, etc.), and buffers all result rows in memory.If the statement has parameters, use the overload that takes options:
executeQuery(String, Consumer).If the results are not known to fit in memory, consider using the streaming version that takes a row action callback:
executeStreamingQuery(String, Consumer).- Parameters:
statement- The Analytics SQL++ statement to execute.- Returns:
- A query result consisting of metadata and a list of rows.
- Throws:
QueryException- if the server response indicates an error occurred.InvalidCredentialException- if the server rejects the user credentials.AnalyticsTimeoutException- if the query does not complete before the timeout expires.CancellationException- if the calling thread is interrupted.
-
executeStreamingQuery
QueryMetadata executeStreamingQuery(String statement, Consumer<Row> rowAction, Consumer<QueryOptions> options) Executes a query statement using the specified options, (query parameters, etc.), and passes result rows to the givenrowActioncallback, one by one as they arrive from the server.The callback action is guaranteed to execute in the same thread (or virtual thread) that called this method. If the callback throws an exception, the query is cancelled and the exception is re-thrown by this method.
- Parameters:
statement- The Analytics SQL++ statement to execute.options- A callback for specifying custom query options.- Returns:
- Query metadata.
- Throws:
QueryException- if the server response indicates an error occurred.InvalidCredentialException- if the server rejects the user credentials.AnalyticsTimeoutException- if the query does not complete before the timeout expires.CancellationException- if the calling thread is interrupted.RuntimeException- if the row action callback throws an exception.
-
executeStreamingQuery
Executes a query statement and passes result rows to the givenrowActioncallback, one by one as they arrive from the server.The callback action is guaranteed to execute in the same thread (or virtual thread) that called this method. If the callback throws an exception, the query is cancelled and the exception is re-thrown by this method.
If the statement has parameters, use the overload that takes options:
executeStreamingQuery(String, Consumer, Consumer).- Parameters:
statement- The Analytics SQL++ statement to execute.- Returns:
- Query metadata.
- Throws:
QueryException- if the server response indicates an error occurred.InvalidCredentialException- if the server rejects the user credentials.AnalyticsTimeoutException- if the query does not complete before the timeout expires.CancellationException- if the calling thread is interrupted.RuntimeException- if the row action callback throws an exception.
-