-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Druid SQL queries #90
Comments
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- standard Druid SQL - parameterized queries - SQL context parameters - string interpolation - multi-line queries ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- updates logging calls in DruidHttpClient - updates documentation ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- drops standard string interpolation - uses a custom interpolator that unifies plain and parameterized queries - drops explicit parameterized queries - updates documentation and unit tests ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- adds supoort for Instant - adds configuration zone-id, in order to correctly convert Instant, Timestam, LocalDateTime and LocalDate to Druid SQL TIMESTAMP (y-MM-dd HH:mm:dd) - adds unit test to verify the creation of parameterized sql query - updates documentation (for zone-id) - moves SQLQuerySpec from package ing.wbaa.druid.sql to ing.wbaa.druid ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- standard Druid SQL - parameterized queries - SQL context parameters - string interpolation - multi-line queries ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- updates logging calls in DruidHttpClient - updates documentation ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- drops standard string interpolation - uses a custom interpolator that unifies plain and parameterized queries - drops explicit parameterized queries - updates documentation and unit tests ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- adds supoort for Instant - adds configuration zone-id, in order to correctly convert Instant, Timestam, LocalDateTime and LocalDate to Druid SQL TIMESTAMP (y-MM-dd HH:mm:dd) - adds unit test to verify the creation of parameterized sql query - updates documentation (for zone-id) - moves SQLQuerySpec from package ing.wbaa.druid.sql to ing.wbaa.druid ing-bankGH-90
anskarl
added a commit
to anskarl/scruid
that referenced
this issue
May 8, 2020
- adds supoort for Instant - adds configuration zone-id, in order to correctly convert Instant, Timestam, LocalDateTime and LocalDate to Druid SQL TIMESTAMP (y-MM-dd HH:mm:dd) - adds unit test to verify the creation of parameterized sql query - updates documentation (for zone-id) - moves SQLQuerySpec from package ing.wbaa.druid.sql to ing.wbaa.druid ing-bankGH-90
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache Druid supports two query languages, native JSON-based queries and SQL. At the moment native Druid API is more powerful compare to the SQL, perhaps this may change in the future and become equal. Internally, Druid uses a parser and planner based on Apache Calcite which translates to the native API.
So far Scruid performs queries on top the native API of Druid, either using the specialized case classes or the DQL. Additionally, Scruid uses Akka Http and Streams to provide a robust HTTP client for performing requests and handling of large payloads.
According to the documentation of Druid there are two client APIs for SQL, HTTP POST and JDBC. The non-JDBC JSON over HTTP API is stateless and does not require connection stickiness.
I think that SQL support it would be nice addition to Scruid and take advantage of the HTTP clients that it provides, as well as the bindings to case classes (via circe) regarding the results.
Druid SQL technical details
To perform SQL queries using HTTP, Druid provides the endpoint
/druid/v2/sql/
. An example query is given below:Druid also supports parameterized queries:
The structure of JSON object to perform SQL queries contains the
query
and optionally thecontext
,parameters
andresultFormat
. The latter controls the format of the resulting response, for Scruid settingresultFormat
toobject
is an option that can be directly supported in order to retain the case class mapping via circe.Implementation features
In https://github.com/anskarl/scruid/tree/feature/sql there is a full implementation of SQL in Scruid and supports the following:
Examples
SQL queries are expressed using the
sql
processed string function. The examples below demonstrate the functionality:Multi-line queries:
String interpolation:
Parameterized Queries:
Context parameters:
Akka Streams:
The text was updated successfully, but these errors were encountered: