OpenSearch/modules
Nik Everett d03b8e4abb Implement reading from null safe dereferences
Null safe dereferences make handling null or missing values shorter.
Compare without:
```
if (ctx._source.missing != null && ctx._source.missing.foo != null) {
  ctx._source.foo_length = ctx.source.missing.foo.length()
}
```

To with:
```
Integer length = ctx._source.missing?.foo?.length();
if (length != null) {
  ctx._source.foo_length = length
}
```

Combining this with the as of yet unimplemented elvis operator allows
for very concise defaults for nulls:
```
ctx._source.foo_length = ctx._source.missing?.foo?.length() ?: 0;
```

Since you have to start somewhere, we started with null safe dereferenes.

Anyway, this is a feature borrowed from groovy. Groovy allows writing to
null values like:
```
def v = null
v?.field = 'cat'
```
And the writes are simply ignored. Painless doesn't support this at this
point because it'd be complex to implement and maybe not all that useful.

There is no runtime cost for this feature if it is not used. When it is
used we implement it fairly efficiently, adding a jump rather than a
temporary variable.

This should also work fairly well with doc values.
2016-11-09 07:20:11 -05:00
..
aggs-matrix-stats Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
ingest-common Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-expression Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-groovy Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-mustache Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
lang-painless Implement reading from null safe dereferences 2016-11-09 07:20:11 -05:00
percolator Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
reindex Switch reindex with slices error to IAE 2016-11-08 11:42:07 -05:00
transport-netty3 Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
transport-netty4 Test: Remove multi process support from rest test runner (#21391) 2016-11-07 15:07:34 -08:00
build.gradle Build: Change `gradle run` to use zip distribution (#21001) 2016-10-18 11:48:58 -07:00