Commit Graph

32 Commits

Author SHA1 Message Date
Nik Everett a8a6191428 Handle core's shading and fix some licenses
Original commit: elastic/x-pack-elasticsearch@962dd2c8b4
2017-07-25 09:41:52 -04:00
Costin Leau 04c9427596 Pass jdbc fetch size to the scroller
Original commit: elastic/x-pack-elasticsearch@2309a43980
2017-07-21 00:11:01 +03:00
Costin Leau 76b429bfe2 Introduce SqlSettings for handling per-client configuration
To avoid leaking client information across the entire code-base, client
settings like TimeZone or pagination are stored in
SqlSession>SqlSettings which are available as a ThreadLocal (during
analysis) so that components that need them, can pick them up.

Since ES internally uses Joda, the date/time functionality relies on Joda,
whenever possible to match the behavior.

Original commit: elastic/x-pack-elasticsearch@20f41e2bb3
2017-07-20 19:28:04 +03:00
Costin Leau 8acacc4f7d Add random fetchSize
Original commit: elastic/x-pack-elasticsearch@1f8197b04f
2017-07-18 23:15:40 +03:00
Costin Leau f33ae72712 Minor polishing
Make JDBC and CLI consistent with the rest of the plugin
Replace ResultPage with an interface

Original commit: elastic/x-pack-elasticsearch@c62249cc2e
2017-07-18 18:41:23 +03:00
Nik Everett cf29dea577 Huge protocol refactor
Too big. Sorry. Some good things though:
1. Share some code between CLI and JDBC. Probably a good thing
at this point, better as we go on, I think.
2. Add round trip tests for all of proto.
3. Remove the `data` member from `QueryInitResponse` and
`QueryPageResponse` so we response serialization is consistent with
everything else.

Original commit: elastic/x-pack-elasticsearch@c6940a32ed
2017-07-12 17:32:13 -04:00
Nik Everett 3d70d7b64e Remove some checkstyle suppressions
Original commit: elastic/x-pack-elasticsearch@a1d89e2916
2017-07-10 12:24:47 -04:00
Nik Everett cd1c78feaf toString tests
Original commit: elastic/x-pack-elasticsearch@c3eb1265a4
2017-07-10 12:13:50 -04:00
Nik Everett 3759349db8 Remove many NOCOMMITs from cli protocol
* Move read from a static method to a ctor to mirror core.
* Make read and writes read and write the same data.
* Instead of the "header" integer use a byte for the response
type.
* For responses that do not make their request type obvious
then serialize the request type.
* Remove the request type member from requests and responses and
replace with an abstract method. These type members have caused
us trouble in core in the past.
* Remove the Message superclass as it didn't have anything in it.
* Pass client version to the request reader and response writer.
* Add round trip tests for the protocol.
* Force Requests and Responses to provide good `toString`, `equals`,
and `hashCode`.

Original commit: elastic/x-pack-elasticsearch@653ed8c27f
2017-07-10 11:36:08 -04:00
Nik Everett 0fe1e4bb48 Clean serialization for cli's CommandResponse
* Switch `data` member from Object to `String`
* Compress packages on server so easier to build `data` as `String`
* Move write of `data` member into `encode` method
* Move read of `data` member into ctor

Original commit: elastic/x-pack-elasticsearch@e3a52e7493
2017-07-08 07:24:37 -04:00
Nik Everett f6fad00765 `cli`'s `gradle run` works!
Including proper tty support!

Original commit: elastic/x-pack-elasticsearch@a780a99d1b
2017-07-07 10:32:23 -04:00
Nik Everett edcc87e30e `gradle check -xforbiddenPatterns` passes!
Hurray! Now we just have to keep it that way!

Original commit: elastic/x-pack-elasticsearch@98b8ede44e
2017-07-06 16:24:19 -04:00
Nik Everett fc0bce0a3e Some more tests
Closer to `gradle check -xforbiddenPatterns` passing.

Original commit: elastic/x-pack-elasticsearch@fbce74a1f3
2017-07-06 15:58:12 -04:00
Nik Everett 527541a66e More build fixes
* A unit test for cli
* Licenses for cli
* Remove licenses for protos (no more deps)
* `SHOW TABLES` returns results in order (makes testing easier)
* Clean up embedded jdbc server
* Wire up embedded cli server

Original commit: elastic/x-pack-elasticsearch@b98aaf446b
2017-07-06 14:37:09 -04:00
Nik Everett d25c23c3b4 Fix some forbiddens in cli
Original commit: elastic/x-pack-elasticsearch@3dc96c7279
2017-07-06 10:54:41 -04:00
Nik Everett bc2f0fe7ff Get jdbc tests passing
`gradle check -xforbiddenPatterns` now passes in jdbc.

This makes running the embedded HTTP server slightly more difficult,
you now have to add the following to your jvm arguments.
```
-ea -Dtests.rest.cluster=localhost:9200 -Dtests.embed.sql=true -Dtests.security.manager=false
```

Depending on your environment the embedded jdbc connection may give
spurious failures that look like:
```
org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcException: RemoteTransportException[[node-0][127.0.0.1:9300][indices:data/read/search]]; nested: SearchPhaseExecutionException[]; nested: GeneralScriptException[Failed to compile inline script [( params.a0 > params.v0 ) && ( params.a1 > params.v1 )] using lang [painless]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting];
...
Caused by: Failed to execute phase [fetch],
..
Caused by: GeneralScriptException[Failed to compile inline script [( params.a0 > params.v0 ) && ( params.a1 > params.v1 )] using lang [painless]]; nested: CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting];
...
Caused by: CircuitBreakingException[[script] Too many dynamic script compilations within one minute, max: [15/min]; please use on-disk, indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_per_minute] setting]
```

`gradle check` works around this by setting `script.max_compilations_per_minute`
to `1000`.

Another change is that we no longer support loading the test data by
uncommenting some code. Instead we load the test data into Elaticsearch
before the first test and we deleted it after the last test. This is
so that tests that required different test data can interoperate with
eachother. The spec tests all use the same test data but the metadata
tests do not.

Original commit: elastic/x-pack-elasticsearch@8b8f684ac1
2017-07-06 10:24:59 -04:00
Nik Everett 18bc094dbc Remove LocalEsCluster
We aren't using it anymore.

Original commit: elastic/x-pack-elasticsearch@67f47c4f11
2017-07-05 08:21:35 -04:00
Nik Everett 9d83eccf27 Merge branch 'feature/sql' of github.com:elastic/x-pack-elasticsearch into feature/sql
Original commit: elastic/x-pack-elasticsearch@34d536c5e1
2017-07-05 08:15:11 -04:00
Costin Leau 12e12f7a94 Improve exception reporting
Add the source spec in the error stacktrace

Original commit: elastic/x-pack-elasticsearch@bc7ed6ac60
2017-07-04 19:25:03 +03:00
Costin Leau 6f670c8d8e Testing fixes
- simplify handling of timezone in H2
- fix leaking threadpool in HttpServer
- update Csv tests
- keep the dates as long in internal Page

Original commit: elastic/x-pack-elasticsearch@43a804607f
2017-07-04 19:05:09 +03:00
Costin Leau 83d73c9b3a More polishing
Original commit: elastic/x-pack-elasticsearch@043edf250b
2017-07-04 00:41:16 +03:00
Costin Leau 405b4a4166 Update test dataset name
Original commit: elastic/x-pack-elasticsearch@49951836c1
2017-07-04 00:00:11 +03:00
Nik Everett 56803bdd1b Port some of CLI's demos to tests
Original commit: elastic/x-pack-elasticsearch@5827c08268
2017-07-03 16:41:25 -04:00
Costin Leau 3eb1258b0d Add to CSV infra plus some refactoring of the JDBC one
Original commit: elastic/x-pack-elasticsearch@3e002c91c2
2017-07-03 21:01:29 +03:00
Costin Leau bc9c9a9151 Expanding the JDBC testing framework
Original commit: elastic/x-pack-elasticsearch@cc31f7b6a9
2017-07-01 17:20:48 +03:00
Costin Leau 16ea84defe Fix some checkstyles
Original commit: elastic/x-pack-elasticsearch@ff1c6a6e70
2017-07-01 17:19:46 +03:00
Nik Everett 4bb605d819 Fix licenses in server
Original commit: elastic/x-pack-elasticsearch@a3207814f8
2017-06-30 19:39:06 -04:00
Nik Everett 1a2cbea747 Checkstyle
Original commit: elastic/x-pack-elasticsearch@4d8e9b2a7a
2017-06-30 17:03:50 -04:00
Nik Everett 6de905c2e8 Enable more tests
And remove extra file

Original commit: elastic/x-pack-elasticsearch@aade36e030
2017-06-30 16:43:37 -04:00
Nik Everett 336980ec28 Add time zone support to the connection
Flows time zones through the `QueryInitRequest` and into the
`ExpressionBuilder` which attaches the time zones to date/time
expressions. Modifies the code that generates date aggs,
scripts, and extracts results to use the time zones.

Original commit: elastic/x-pack-elasticsearch@d6682580d1
2017-06-30 16:43:37 -04:00
Costin Leau be2153851c Synch more functionality
Original commit: elastic/x-pack-elasticsearch@093c275b85
2017-06-30 20:41:47 +03:00
Nik Everett 0e8ef06947 Move sql's server stuff into :x-pack-elasticsearch:sql:server
This should make it easier to run stuff for just sql.

Original commit: elastic/x-pack-elasticsearch@d68465edb0
2017-06-29 14:31:23 -04:00