-
Notifications
You must be signed in to change notification settings - Fork 3.8k
discover nested columns when using nested column indexer for schemaless ingestion #13672
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
Changes from all commits
02bdd39
3f410a9
b785c3b
7def946
eec9bd8
185dd2c
4ccd6a6
38a15ca
55e27f0
922a3b1
a830c10
514bd3b
430c66e
2b32878
04d5d66
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 |
|---|---|---|
|
|
@@ -57,15 +57,23 @@ public class JSONFlattenerMaker implements ObjectFlatteners.FlattenerMaker<JsonN | |
| private final CharsetEncoder enc = StandardCharsets.UTF_8.newEncoder(); | ||
| private final boolean keepNullValues; | ||
|
|
||
| private final boolean discoverNestedFields; | ||
|
|
||
| public JSONFlattenerMaker(boolean keepNullValues) | ||
|
|
||
| public JSONFlattenerMaker(boolean keepNullValues, boolean discoverNestedFields) | ||
| { | ||
| this.keepNullValues = keepNullValues; | ||
| this.discoverNestedFields = discoverNestedFields; | ||
| } | ||
|
|
||
| @Override | ||
| public Iterable<String> discoverRootFields(final JsonNode obj) | ||
| { | ||
| // if discovering nested fields, just return all root fields since we want everything | ||
| // else, we filter for literals and arrays of literals | ||
| if (discoverNestedFields) { | ||
|
Contributor
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 you drop a one line comment here? I am assuming its like this since each top-level field is a field of its own if we are allowing nested columns.
Member
Author
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. do you want similar comments for all the other FlattenerMaker implementations?
Member
Author
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. went ahead and added comments to all |
||
| return obj::fieldNames; | ||
| } | ||
| return FluentIterable.from(obj::fields) | ||
| .filter( | ||
| entry -> { | ||
|
|
||
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.
how about a shorter name?
"discoverNested"?