Commit Graph

7385 Commits

Author SHA1 Message Date
Nik Everett a7728e5caa SQL: wrap remaining long lines (elastic/x-pack-elasticsearch#3458)
Wrap all remaining lines over 140 characters in sql for easier
readability.

Original commit: elastic/x-pack-elasticsearch@e0bc04a049
2018-01-01 13:42:38 -05:00
Nik Everett 1cc64f4ca1 SQL: Break long lines in planner package (elastic/x-pack-elasticsearch#3457)
Break lines longer than 140 characters in the planner package to make
them a bit easier to read and make checkstyle happy. It'll make some
merge conflicts but we should be able to deal with them easilly enough.

Original commit: elastic/x-pack-elasticsearch@de8c116f33
2018-01-01 11:09:28 -05:00
Jason Tedor ce366a731d Remove JDK 9 flag on CI builds
The special JDK 9 flags are no longer needed after the JDK maintainers
decided at the last minute to permit illegal access by default.

Relates elastic/x-pack-elasticsearch#3250

Original commit: elastic/x-pack-elasticsearch@a4cfcd8d1b
2017-12-31 09:55:27 -05:00
Nik Everett bc8103e268 SQL: Break long lines in expression package (elastic/x-pack-elasticsearch#3456)
Break lines over 140 characters in the expression package to make them a
bit easier to read and to make checkstyle happy.

Original commit: elastic/x-pack-elasticsearch@89487a79cc
2017-12-30 20:21:51 -05:00
Nik Everett c52b3350ef SQL: Break long lines in the analyzer package (elastic/x-pack-elasticsearch#3455)
Break lines longer than 140 characters in the analyzer package into
multiple lines so they are easier to read and to appease checkstyle.

Original commit: elastic/x-pack-elasticsearch@74c4c6e4ad
2017-12-30 19:09:55 -05:00
Nik Everett 16f996da92 SQL: Fix long lines in querydsl package (elastic/x-pack-elasticsearch#3454)
Break the lines longer than 140 characters in the querydsl package into
multiple lines to make them easier to read. And to make checkstyle
happy.

Original commit: elastic/x-pack-elasticsearch@cffef88490
2017-12-29 17:59:23 -05:00
Nik Everett c2527ed0f6 SQL: Break long lines in execution package (elastic/x-pack-elasticsearch#3453)
Fixes lines longer than 140 characters to be shorter.

Original commit: elastic/x-pack-elasticsearch@517ed6cde9
2017-12-29 17:05:25 -05:00
Nik Everett f7159ce56f SQL: Break long lines in parse tree walker (elastic/x-pack-elasticsearch#3451)
SQL's parse tree visitors had some lines longer than 140 characters.
This break them into multiple lines.

Original commit: elastic/x-pack-elasticsearch@58310b02f8
2017-12-29 16:52:15 -05:00
Nik Everett f5ff5a94a0 SQL: Fix long lines in function package (elastic/x-pack-elasticsearch#3452)
Adds line breaks in long lines in SQL's function package. Rewrites one
line to use `string + string` style instead of `String.format` style
because that is "more normal" in Elasticsearch.

Original commit: elastic/x-pack-elasticsearch@2f4d0358af
2017-12-29 16:52:08 -05:00
Nik Everett e45ec84a03 SQL: Fix long lines in tests (elastic/x-pack-elasticsearch#3450)
We had three tests with lines > 140 characters. This reflows those
lines.

Original commit: elastic/x-pack-elasticsearch@71b2e5fa08
2017-12-29 16:51:59 -05:00
Nik Everett 27ee786cb6 SQL: Reflow package-info.java (elastic/x-pack-elasticsearch#3448)
Reflows all the text so it wraps around 75 columns for pleasing reading.
And fixes checkstyle errors for the lines that wrap after 140!

Original commit: elastic/x-pack-elasticsearch@9630c8c32e
2017-12-29 15:26:21 -05:00
Nik Everett 45d2446ce7 SQL: Replace blanket checkstyle suppression (elastic/x-pack-elasticsearch#3449)
Replace SQL's blanket suppression of the line length check with targeted
suppressions for each currently violating file.

Original commit: elastic/x-pack-elasticsearch@f96172f4ec
2017-12-29 15:18:12 -05:00
Nik Everett b99c27ba45 SQL: Collapse FunctionRegistry class hierarchy (elastic/x-pack-elasticsearch#3443)
Collapses the interface `FunctionRegistry`, and the classes
`AbstractFunctionRegistry` and `DefaultFunctionRegistry` into a single
class, `FunctionRegistry` and adds some tests for the ctor referencing
behavior inroduced in elastic/x-pack-elasticsearch#3442.

Original commit: elastic/x-pack-elasticsearch@52a697e9b8
2017-12-29 14:59:03 -05:00
Nik Everett 5dcde97fdf SQL: Fix checkstyle in sql/rule package (elastic/x-pack-elasticsearch#3446)
* Replaces long line comment with rewritten javadoc with nice line feeds
* Adds some line breaks in a few log lines

Original commit: elastic/x-pack-elasticsearch@00dc7cc9c8
2017-12-29 14:44:21 -05:00
Nik Everett 92a55df8e6 SQL: Fix checkstyle in VerificationException (elastic/x-pack-elasticsearch#3447)
Rewrite a very long line into a few shorter lines.

Original commit: elastic/x-pack-elasticsearch@72f1f98f65
2017-12-29 14:44:09 -05:00
Nik Everett 5c7395f7fc SQL: Drop unused methods from Rows (elastic/x-pack-elasticsearch#3445)
We may as well not keep unused code around. It violated checkstyle too.

Original commit: elastic/x-pack-elasticsearch@2c77b3df76
2017-12-29 14:43:50 -05:00
Nik Everett 758d16d57f SQL: Drop equals and hashCode from FunctionDefinition (elastic/x-pack-elasticsearch#3444)
They aren't used and they don't look right.

Original commit: elastic/x-pack-elasticsearch@4d07f66f0f
2017-12-29 14:43:15 -05:00
Nik Everett dbf1fc00ce SQL: Remove reflection from constructing Functions (elastic/x-pack-elasticsearch#3442)
This replaces the marker interfaces and reflection that we once used to
construct functions with method references to constructors. It uses a
few overloaded methods to build the `FunctionDefinition`s from the
method references that adapt the various forms of `Function`
constructors that we have into
`BiFunction<UnresolvedFunction, DateTimeZone, Function>` so that the
compiler can do the complex task of picking the appropriate adapter. It
is good at that sort of thing.

Many of these overloaded functions have `@SuppressWarnings("overloads")`
because they are ambiguous if you wrote one as a lambda without type
parameters. Since we always use constructor references this isn't a
problem.

It does not remove the reflection from function naming or from function
type derivation. This is big enough and these seemed significantly less
fraught.

Original commit: elastic/x-pack-elasticsearch@528d05754b
2017-12-29 12:36:09 -05:00
Igor Motov 9f71100bac SQL: Fix CLI tests with security on Windows
We test on Windows with the terminal in unix mode, so we need to make sure we send `\n` instead of `\r\n`. In this case the extra `\n` after password was causing an extra new line in tests breaking them on Windows.

Original commit: elastic/x-pack-elasticsearch@721ba32bd6
2017-12-28 21:40:03 -05:00
Nik Everett 4df10bbd78 SQL: Drop Node superclass from Query (elastic/x-pack-elasticsearch#3414)
SQL's `Node` class is a utility for performing tree traversal and
rewrites using reflection. We're not big fans of the reflection part of
that we feel that, where possible, the tree traversal should be done
explicitly.

In this case `Query`'s tree is traversed for three things:
1. To generate the Elasticsearch `QueryBuilder`s. This uses explict tree
traversal and I left it that way.
2. To ehance sorts on nested fields with the filter in the nested field.
I added `enrichNestedSort` to `Query` so each query can implement this
on its own.
3. To add inner hits that are not explicitly mentioned in the query
already when they need to be fetched. I added `containsNestedField` and
`addNestedField` to `Query` to support this.

Note: The nested field code is somewhat dead because we don't support
nested fields at the moment but SQL once did. I've tried to keep it
mostly intact but it is difficult to know for sure if it is still
functioning the same way that it has always functioned.

Original commit: elastic/x-pack-elasticsearch@5d8a8d687a
2017-12-28 17:16:55 -05:00
Igor Motov 178d6ca6b3 SQL: Move shared REST client methods to shared-client (elastic/x-pack-elasticsearch#3428)
* SQL: Move shared REST client methods to shared-client

This commit is a preliminary step for moving JDBC to the REST client. It extracts the common REST clients from CLI and moves it to shared-client. This will allow us to move to the 5 project setup: rest-proto, shared-client, server, jdbc, cli with the following dependencies:

server <-- rest-proto
shared-client <-- rest-proto
jdbc <-- shared-client
cli <-- shared-client

Relates to elastic/x-pack-elasticsearch#3419

Original commit: elastic/x-pack-elasticsearch@2e6a134de0
2017-12-28 11:10:18 -05:00
Michael Basnight 4d392dec96 Increase gradle heap to 2048m
The BWC tests on 6.x need to test both 6.1 and 5.6, so the theory here
is that they just need more memories. This bumps it to ensure the tests
dont OOM.

This bumps it from the previous 1536m, which was already bumped from the
default of 1024m.

Original commit: elastic/x-pack-elasticsearch@cf5700ef47
2017-12-28 09:57:49 -05:00
Nik Everett c6c81c940e SQL: Switch attribute resolution to OO (elastic/x-pack-elasticsearch#3433)
Switch attribute resolution from tree matching to OO. Adds
`ProcessorDefinition#resolveAttributes` which subclasess implement to
rewrite themselves against a query. `AttributeInput`s use this to
replace themselves with `ReferenceInput`s.

Original commit: elastic/x-pack-elasticsearch@97270d2ea4
2017-12-28 08:15:25 -05:00
David Kyle 08ff3914fd [DOCS] Correct over field usage for freq rare function (elastic/x-pack-elasticsearch#3435)
Original commit: elastic/x-pack-elasticsearch@2b315610b9
2017-12-28 10:50:20 +00:00
Costin Leau f8da04dd3a SQL: don't catch Errors in the parser
Original commit: elastic/x-pack-elasticsearch@9e4324a268
2017-12-28 11:58:10 +02:00
Costin Leau cc7e11f45e SQL: document usage of parameterized type on AbstractBuilder parser (elastic/x-pack-elasticsearch#3425)
Original commit: elastic/x-pack-elasticsearch@c807f9dd40
2017-12-28 11:50:44 +02:00
Costin Leau c6760a932f SQL: Rework handling of unsupported types (elastic/x-pack-elasticsearch#3418)
Instead of ignoring or throwing an exception, unsupported types are read
If accessed, an error is returned (nicer than the mapping error).
When using * just like with object fields, they are filtered out.

Original commit: elastic/x-pack-elasticsearch@dd244f931c
2017-12-28 11:44:58 +02:00
Igor Motov 292506526e Merge remote-tracking branch 'elastic/master' into feature/sql_2
Original commit: elastic/x-pack-elasticsearch@79e7b1b953
2017-12-27 21:46:00 -05:00
Tim Vernum e8985f4455 [Security] has_privileges.has_all_requested should respect cluster privileges (elastic/x-pack-elasticsearch#3379)
The has_all_requested field in the has_privileges response was not taking the cluster privileges into account

relates elastic/x-pack-elasticsearch#3366

Original commit: elastic/x-pack-elasticsearch@68d2b98670
2017-12-28 08:38:41 +10:00
Nik Everett e989f465bb SQL: Switch is aggs only to OO (elastic/x-pack-elasticsearch#3432)
Switches the "is this query aggs only?" question from pattern matching
on the column tree to an OO-style "ask the columns if they can be aggs
only" method.

I expect this could have been less code if I was willing to define
`supportedByAggsOnlyQuery` as `true` at the top of the
`ProcessorDefinition` object tree and override it only on nodes
`ReferenceInput` and `ScoreProcessorDefinition` but this feels dirty to
me. I tend to think of a superclass as a list of questions that all the
subclasses have to answer rather than a list of behaviors to share.
Pulling the `return true` up saves a few lines of code but breaks my
ability to reason about subclasses.


Original commit: elastic/x-pack-elasticsearch@b1338543cb
2017-12-27 14:16:22 -05:00
Albert Zaharovits 3ecc433f43 AD authn: never clear passwords on Bind connections (elastic/x-pack-elasticsearch#3351)
It is unsafe to clear passwords of bind requests if the connection is live
and might be used latter (for eg for group searches). This is a temporary
fix that exposes passwords in memory.

Original commit: elastic/x-pack-elasticsearch@e2e1f1a358
2017-12-27 19:17:07 +02:00
Michael Basnight 220aa734ee Migrate actions to plugin core (elastic/x-pack-elasticsearch#3424)
This commit hacks up the xpack repo in such a way that it moves all
actions that the transport client uses to plugin core. It also moves
any classes that those actions use to plugin core, with a few
exceptions. I tried to split up any classes that pulled in server side
logic into the client, but that was not always 100% possible. Consider
this commit a guide, and since I do not know the codebase for each
plugin, consider it a best guess for what should be moved. A few other
things were merged in below.

This commit extracts the parts of Condition and AlwaysCondition that are
needed by classes that will be moved into the client package. The only
odd thing here is that since there are two parent classes (Condition and
AlwaysCondition) it was not possible to make AlwaysConditionInteral
extend from AlwaysCondition and still parse a ConditionInternal object,
which is what the ConditionFactory expects.

This commit removes the use of internal users in the User class, and
instead moves them to Authentication, where they are used.

[insert obligatory chuck norris karate image here]

ref elastic/x-pack-elasticsearch#2925

Original commit: elastic/x-pack-elasticsearch@42d0b72209
2017-12-27 11:31:16 -05:00
Hendrik Muhs f8d62d0ade [ML] wait for validation of forecast request and send error in case (elastic/x-pack-elasticsearch#3399)
change the forecast API to wait for the validation and return an error if validation fails.

fixes elastic/machine-learning-cpp#489

Original commit: elastic/x-pack-elasticsearch@5c0553b284
2017-12-27 11:25:26 +01:00
Jason Tedor 31839b2748 Increase Gradle heap space to 1536m
This commit increases the heap space for the Gradle processes to
1536m. Note that the default is 1024m.

Original commit: elastic/x-pack-elasticsearch@3b5cdc30b2
2017-12-26 19:22:07 -05:00
Igor Motov 3892da7a3d SQL: Suppress testShowTablesWorksAsAdmin() tests
These tests are relying on existence of an internal index that might or might not be present when we run this test.

Tracked by elastic/x-pack-elasticsearch#3423

Original commit: elastic/x-pack-elasticsearch@26a7795759
2017-12-26 12:53:21 -05:00
Costin Leau 3e7eca6f2e SQL: Improve generics usage inside Parser (elastic/x-pack-elasticsearch#3417)
Original commit: elastic/x-pack-elasticsearch@814e476b6f
2017-12-23 22:47:51 +02:00
Costin Leau 5a25213db9 Update security tests
Original commit: elastic/x-pack-elasticsearch@732a4c5850
2017-12-23 15:44:27 +02:00
Costin Leau b437341ddc Remove old class
Original commit: elastic/x-pack-elasticsearch@e075c3b972
2017-12-23 13:35:42 +02:00
Costin Leau 368099dcbd SQL: Add support for object/inner/dotted fields (elastic/x-pack-elasticsearch#3368)
* SQL: Add support for object/inner/dotted fields

Improve validation when selecting compound fields
Improve fallback to exact field for text fields
Consolidate various field attributes into one
Consolidate various field HitExtractors into one
Improve grammar for column declaration
Update response of embedded server
Improve index validation to allow use of internal indices
Add clean-up of scroll in case of server errors
By default thrown an exception on multi-valued fields

Original commit: elastic/x-pack-elasticsearch@45b73fe0dc
2017-12-23 13:19:54 +02:00
Igor Motov e18c7e92fa SQL: Switch CLI to REST protocol (elastic/x-pack-elasticsearch#3342)
Removes custom binary protocol used for CLI communication and switches CLI to REST.

relates elastic/x-pack-elasticsearch#3063

Original commit: elastic/x-pack-elasticsearch@b42bdcdc35
2017-12-22 20:42:13 -10:00
Nik Everett 2b11f8b3ba SQL: Preserve field order in response again
We accidentally stopped returning fields in the same order that the
user asked for them in but some docs tests caught it.

Original commit: elastic/x-pack-elasticsearch@586e3cf207
2017-12-22 17:16:15 -05:00
Costin Leau 1003cf3829 Fix formatting
Original commit: elastic/x-pack-elasticsearch@65f17636db
2017-12-22 21:09:43 +02:00
Costin Leau 2856050af9 SQL: Add javadoc and package description (elastic/x-pack-elasticsearch#3406)
SQL: Add project description as package javadoc

Original commit: elastic/x-pack-elasticsearch@106150d1e6
2017-12-22 20:29:36 +02:00
Nik Everett 5b30bc6c7a Merge branch 'master' into feature/sql_2
Original commit: elastic/x-pack-elasticsearch@5b23edc3ef
2017-12-22 09:49:25 -05:00
Lee Hinman 97eef004de SQL: Remove instanceof checks for field retrieval (elastic/x-pack-elasticsearch#3402)
* SQL: Remove instanceof checks for field retrieval

This removes the `instanceof` checks iterating through the columns determining
what fields need to be retrieved from the ES document. It adds an interface
`FieldExtraction` that collects the fields needed in a builder. The builder can
then build the fields necessary from a `SearchSourceBuilder`.

* Remove default implementation in favor of pushing down exception throwing

Original commit: elastic/x-pack-elasticsearch@11d3d69eb1
2017-12-21 17:11:31 -07:00
lcawley 648a4d9cd1 [DOCS] Fixed forecasting links
Original commit: elastic/x-pack-elasticsearch@42c326c3ce
2017-12-21 08:39:49 -08:00
Lisa Cawley b35f1909cc [DOCS] Add forecasting overview (elastic/x-pack-elasticsearch#3263)
* [DOCS] Restructure ML overview

* [DOCS] Added forecasting limitations

* [DOCS] Merged changes to ML overview

* [DOCS] Added forecasting screenshot

* [DOCS] Removed incorrect results info from forecast API

* [DOCS] Addressed feedback about forecasts

* [DOCS] Clarified default forecast duration

Original commit: elastic/x-pack-elasticsearch@1403f2cd2e
2017-12-21 08:14:52 -08:00
Chris Earle 01e3db3740 [Monitoring] Add Cluster Alert Blacklist (elastic/x-pack-elasticsearch#3326)
This adds a traditional blacklist that can be set [dynamically] at the exporter level to block specific cluster alerts (watches) from being created. It goes further and actually removes any watch that has been created already for the current cluster.

Original commit: elastic/x-pack-elasticsearch@1f67bb9501
2017-12-21 11:04:56 -05:00
Chris Earle 76cfdfcef7 [Logstash] Index Management should use auto_expand_replicas (elastic/x-pack-elasticsearch#3373)
This modifies the default template to use auto_expand_replicas so that a one node cluster can stay green, even while using the Logstash management feature.

Original commit: elastic/x-pack-elasticsearch@b1ddf3af6f
2017-12-21 10:58:12 -05:00
David Kyle b98706183e Fix Java 9 & 10 test failures comparing ZonedDateTimes
Original commit: elastic/x-pack-elasticsearch@2767bb3f16
2017-12-21 15:48:05 +00:00