Skip to content

Reinterpret dots in field names as object structure #79922

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

Merged
merged 22 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2e96997
Reinterpret dots in field names as object structure
romseygeek Oct 27, 2021
2a00aa1
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 2, 2021
56aeafa
fixup
romseygeek Nov 2, 2021
56b9315
skip rest-api-bwc test because error message has changed
romseygeek Nov 2, 2021
7d7a2f7
adjust bwc test versions
romseygeek Nov 3, 2021
16435ea
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 3, 2021
b4c7413
tify
romseygeek Nov 3, 2021
118e3fb
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 3, 2021
a41f3b9
copy_to should use the same path as standard parsing
romseygeek Nov 4, 2021
94aae5c
error message
romseygeek Nov 4, 2021
cc29e95
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 4, 2021
ef84ad4
precommit
romseygeek Nov 4, 2021
f134a7e
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 5, 2021
3866763
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 8, 2021
41fe0c6
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 10, 2021
a8a00c0
Add test for flattened fields with dotted inputs
romseygeek Nov 10, 2021
bd25aa3
Wrap entire parser, not just at certain field names
romseygeek Nov 11, 2021
ece1193
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 11, 2021
4fa20bd
nit
romseygeek Nov 11, 2021
cc1f0c0
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 22, 2021
daf74fb
Merge remote-tracking branch 'origin/master' into mapper/fold-dots-in…
romseygeek Nov 23, 2021
1ebd2e6
stack -> deque
romseygeek Nov 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

package org.elasticsearch.xcontent;

import org.elasticsearch.core.CheckedFunction;
import org.elasticsearch.core.RestApiVersion;

import java.io.IOException;
import java.nio.CharBuffer;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

public abstract class DelegatingXContentParser implements XContentParser {

protected abstract XContentParser delegate();

@Override
public XContentType contentType() {
return delegate().contentType();
}

@Override
public void allowDuplicateKeys(boolean allowDuplicateKeys) {
delegate().allowDuplicateKeys(allowDuplicateKeys);
}

@Override
public Token nextToken() throws IOException {
return delegate().nextToken();
}

@Override
public void skipChildren() throws IOException {
delegate().skipChildren();
}

@Override
public Token currentToken() {
return delegate().currentToken();
}

@Override
public String currentName() throws IOException {
return delegate().currentName();
}

@Override
public Map<String, Object> map() throws IOException {
return delegate().map();
}

@Override
public Map<String, Object> mapOrdered() throws IOException {
return delegate().mapOrdered();
}

@Override
public Map<String, String> mapStrings() throws IOException {
return delegate().mapStrings();
}

@Override
public <T> Map<String, T> map(Supplier<Map<String, T>> mapFactory, CheckedFunction<XContentParser, T, IOException> mapValueParser)
throws IOException {
return delegate().map(mapFactory, mapValueParser);
}

@Override
public List<Object> list() throws IOException {
return delegate().list();
}

@Override
public List<Object> listOrderedMap() throws IOException {
return delegate().listOrderedMap();
}

@Override
public String text() throws IOException {
return delegate().text();
}

@Override
public String textOrNull() throws IOException {
return delegate().textOrNull();
}

@Override
public CharBuffer charBufferOrNull() throws IOException {
return delegate().charBufferOrNull();
}

@Override
public CharBuffer charBuffer() throws IOException {
return delegate().charBuffer();
}

@Override
public Object objectText() throws IOException {
return delegate().objectText();
}

@Override
public Object objectBytes() throws IOException {
return delegate().objectBytes();
}

@Override
public boolean hasTextCharacters() {
return delegate().hasTextCharacters();
}

@Override
public char[] textCharacters() throws IOException {
return delegate().textCharacters();
}

@Override
public int textLength() throws IOException {
return delegate().textLength();
}

@Override
public int textOffset() throws IOException {
return delegate().textOffset();
}

@Override
public Number numberValue() throws IOException {
return delegate().numberValue();
}

@Override
public NumberType numberType() throws IOException {
return delegate().numberType();
}

@Override
public short shortValue(boolean coerce) throws IOException {
return delegate().shortValue(coerce);
}

@Override
public int intValue(boolean coerce) throws IOException {
return delegate().intValue(coerce);
}

@Override
public long longValue(boolean coerce) throws IOException {
return delegate().longValue(coerce);
}

@Override
public float floatValue(boolean coerce) throws IOException {
return delegate().floatValue(coerce);
}

@Override
public double doubleValue(boolean coerce) throws IOException {
return delegate().doubleValue(coerce);
}

@Override
public short shortValue() throws IOException {
return delegate().shortValue();
}

@Override
public int intValue() throws IOException {
return delegate().intValue();
}

@Override
public long longValue() throws IOException {
return delegate().longValue();
}

@Override
public float floatValue() throws IOException {
return delegate().floatValue();
}

@Override
public double doubleValue() throws IOException {
return delegate().doubleValue();
}

@Override
public boolean isBooleanValue() throws IOException {
return delegate().isBooleanValue();
}

@Override
public boolean booleanValue() throws IOException {
return delegate().booleanValue();
}

@Override
public byte[] binaryValue() throws IOException {
return delegate().binaryValue();
}

@Override
public XContentLocation getTokenLocation() {
return delegate().getTokenLocation();
}

@Override
public <T> T namedObject(Class<T> categoryClass, String name, Object context) throws IOException {
return delegate().namedObject(categoryClass, name, context);
}

@Override
public NamedXContentRegistry getXContentRegistry() {
return delegate().getXContentRegistry();
}

@Override
public boolean isClosed() {
return delegate().isClosed();
}

@Override
public RestApiVersion getRestApiVersion() {
return delegate().getRestApiVersion();
}

@Override
public DeprecationHandler getDeprecationHandler() {
return delegate().getDeprecationHandler();
}

@Override
public void close() throws IOException {
delegate().close();
}
}
Loading