🔎 Open source distributed and RESTful search engine.
Go to file
Costin Leau e5d18ad45c SQL: GROUP BY use composite instead of terms aggregation (elastic/x-pack-elasticsearch#4282)
Rewrote the GROUP BY to use composite aggregation instead of terms 
(and everything that comes with it) but instead rely on composite aggregation

This not only works better but simplifies the code complexity since
composite is a straight, two-level tree:

1. root/group-by/composite-keys
2. (metric) aggregations

This removes a lot of complexity from all stages that involve creating,
assembling and especially parsing the results.
By moving to composite agg, the aggregation/GROUP BY are now pageable
so the consumer/listener had to be extended to include a dedicated
cursor and specific (bucket) extractors inline with the scroll requests.

While at it, also improved the support for implicit GROUP BY by
formalizing it (previously it supported only counts and no other
agg).

In addition:
Fixed a JDBC bug that caused incorrect timeout to be passed
Improved the returned RowSet a bit and add better naming
Pick up @Nullable move from core
Make sure to specify the TimeZone for DateTimeHistogram extraction
Add missing javadoc
To avoid delegating NamedWriteableRegistry (NWR) and to keep the scope
clean, SQL writeables now handle their own serialization, keeping the
boundary between the Elasticsearch's NWR in place.
Pass NamedWriteableRegistry only when looking at the next page
To keep in line with the existing patter and simplify the code
bureaucracy, the deserialization happens directly.
Since the SearchSourceBuilder deserialization happens explicitly (and
it's otherwise opaque), the declarative invocation isn't necessary
anymore.
Add a bit more randomization in tests

Original commit: elastic/x-pack-elasticsearch@f5af046386
2018-04-12 20:20:10 +03:00
.ci Java versions for ci (elastic/x-pack-elasticsearch#4268) 2018-04-02 16:50:43 -04:00
.github Add issue template 2017-03-19 16:37:21 -04:00
buildSrc Rename x-pack project names to new names with split repo 2017-02-10 11:02:42 -08:00
dev-tools Add packagingTestSample option to dev-tools/ci script (elastic/x-pack-elasticsearch#4266) 2018-04-02 16:04:44 +02:00
docs [DOCS] Updated terms re wildcard support 2018-04-12 09:59:17 -07:00
gradle/wrapper Bump Gradle to version 4.5 2018-01-31 23:18:58 -05:00
license-tools Decouple XContentBuilder from BytesReference (elastic/x-pack-elasticsearch#4119) 2018-03-14 13:48:05 -06:00
plugin SQL: GROUP BY use composite instead of terms aggregation (elastic/x-pack-elasticsearch#4282) 2018-04-12 20:20:10 +03:00
qa SQL: GROUP BY use composite instead of terms aggregation (elastic/x-pack-elasticsearch#4282) 2018-04-12 20:20:10 +03:00
test Run active directory tests against a samba4 fixture (elastic/x-pack-elasticsearch#4067) 2018-03-16 10:44:23 -06:00
transport-client Build: Remove x-pack-api jar (elastic/x-pack-elasticsearch#3864) 2018-02-07 19:21:43 -08:00
.dir-locals.el Update .dir-locals.el for enforced line length 2016-02-04 14:55:41 -07:00
.gitignore SQL: Ignore directory made by text editor (elastic/x-pack-elasticsearch#3391) 2017-12-20 18:48:54 -05:00
.projectile Add .dir-locals.el and .projectile 2015-10-30 11:16:29 -06:00
LICENSE.txt Initial X-Pack commit 2018-04-20 14:16:58 -07:00
NOTICE.txt Build: Enable notice generation for x-pack (elastic/x-pack-elasticsearch#695) 2017-03-02 19:06:15 -08:00
README.asciidoc [ML] Adjust the name of the ML C++ repo (elastic/x-pack-elasticsearch#4020) 2018-03-09 22:53:38 +00:00
build.gradle Pull snapshots prior to 6.3 from elastic maven (elastic/x-pack-elasticsearch#3900) 2018-02-10 09:52:36 -06:00
gradle.properties Increase gradle heap to 2048m 2017-12-28 09:57:49 -05:00
gradlew Introduce Gradle wrapper 2018-01-04 16:42:12 -05:00
gradlew.bat Introduce Gradle wrapper 2018-01-04 16:42:12 -05:00
settings.gradle Rename x-pack project names to new names with split repo 2017-02-10 11:02:42 -08:00

README.asciidoc

= Elasticsearch X-Pack

A set of Elastic's commercial plugins for Elasticsearch:

- License
- Security
- Watcher
- Monitoring
- Machine Learning
- Graph

= Setup

You must checkout `x-pack-elasticsearch` and `elasticsearch` with a specific directory structure. The
`elasticsearch` checkout will be used when building `x-pack-elasticsearch`. The structure is:

- /path/to/elastic/elasticsearch
- /path/to/elastic/elasticsearch-extra/x-pack-elasticsearch

== Vault Secret

The build requires a Vault Secret ID. You can use a GitHub token by following these steps:

1. Go to https://github.com/settings/tokens
2. Click *Generate new token*
3. Set permissions to `read:org`
4. Copy the token into `~/.elastic/github.token`
5. Set the token's file permissions to `600`

```
$ mkdir ~/.elastic
$ vi ~/.elastic/github.token
# Add your_token exactly as it is into the file and save it
$ chmod 600 ~/.elastic/github.token
```

If you do not create the token, then you will see something along the lines of this as the failure when trying to build X-Pack:

```
* What went wrong:
Missing ~/.elastic/github.token file or VAULT_SECRET_ID environment variable, needed to authenticate with vault for secrets
```

=== Offline Mode

When running the build in offline mode (`--offline`), it will not required to have the vault secret setup.

== Native Code

**This is mandatory as tests depend on it**

Machine Learning requires platform specific binaries, built from https://github.com/elastic/ml-cpp via CI servers.

= Build

- Run unit tests:
+
[source, txt]
-----
gradle clean test
-----

- Run all tests:
+
[source, txt]
-----
gradle clean check
-----

- Run integration tests:
+
[source, txt]
-----
gradle clean integTest
-----

- Package X-Pack (without running tests)
+
[source, txt]
-----
gradle clean assemble
-----

- Install X-Pack (without running tests)
+
[source, txt]
-----
gradle clean install
-----

= Building documentation

The source files in this repository can be included in either the X-Pack
Reference or the Elasticsearch Reference.

NOTE: In 5.4 and later, the Elasticsearch Reference includes X-Pack-specific
content that is pulled from this repo.

To build the Elasticsearch Reference on your local machine, use the `docbldes` 
or `docbldesx` build commands defined in
https://github.com/elastic/docs/blob/master/doc_build_aliases.sh

== Adding Images

When you include an image in the documentation, specify the path relative to the
location of the asciidoc file. By convention, we put images in an `images`
subdirectory.

For example to insert `watcher-ui-edit-watch.png` in `watcher/limitations.asciidoc`:

. Add an `images` subdirectory to the watcher directory if it doesn't already exist.
. In `limitations.asciidoc` specify:
+
[source, txt]
-----
 image::images/watcher-ui-edit-watch.png["Editing a watch"]
-----

Please note that image names and anchor IDs must be unique within the book, so
do not use generic identifiers.