-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Handle missing values in painless #30975
Changes from 1 commit
ca9f0a5
3d571d2
58beb2a
99b353d
7c55d12
25c0a57
220a8e9
ef5ec96
75e7bb9
c8a8490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
* under the License. | ||
*/ | ||
|
||
import org.apache.tools.ant.types.Path | ||
import org.elasticsearch.gradle.test.RestIntegTestTask | ||
|
||
esplugin { | ||
description 'An easy, safe and fast scripting language for Elasticsearch' | ||
|
@@ -28,6 +28,15 @@ integTestCluster { | |
module project.project(':modules:mapper-extras') | ||
} | ||
|
||
Task additionalClusterTest = tasks.create( | ||
name: "additionalClusterTest", type: RestIntegTestTask) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use a less generic name? Something specific to testing doc values missing values? |
||
additionalClusterTestCluster { | ||
systemProperty 'es.script.exception_for_missing_value', 'true' | ||
distribution = 'integ-test-zip' | ||
module project // add the lang-painless module itself | ||
module project.project(':modules:mapper-extras') | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What tests is this actually running? It seems like this is running all the same rest tests. I would expect a test with in this PR which checks a deprecation message is emitted when the sysprop is false. |
||
|
||
dependencies { | ||
compile 'org.antlr:antlr4-runtime:4.5.3' | ||
compile 'org.ow2.asm:asm-debug-all:5.1' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,14 +88,13 @@ setup: | |
|
||
--- | ||
"Scripted Field with a null safe dereference (null)": | ||
# Change this to ?: once we have it implemented | ||
- do: | ||
search: | ||
body: | ||
script_fields: | ||
bar: | ||
script: | ||
source: "(doc['missing'].value?.length() ?: 0) + params.x;" | ||
source: "(doc['missing'].size() == 0 ? 0 : doc['missing'].value?.length()) + params.x;" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the |
||
params: | ||
x: 5 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,6 @@ esplugin { | |
description 'Adds advanced field mappers' | ||
classname 'org.elasticsearch.index.mapper.MapperExtrasPlugin' | ||
} | ||
test.configure { | ||
systemProperty 'es.script.exception_for_missing_value', 'true' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it would be better to set this for all tests (eg in BuildPlugin), and override it for one test to check the bwc behavior? |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to note somewhere here that the user can call
doc['field'].size() == 0
to check if values are missing.