You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2023/01/17 05:47:30 UTC
[GitHub] [druid] abhishekagarwal87 commented on a diff in pull request #13672: discover nested columns when using nested column indexer for schemaless ingestion
abhishekagarwal87 commented on code in PR #13672:
URL: https://github.com/apache/druid/pull/13672#discussion_r1071750165
##########
extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroFlattenerMaker.java:
##########
@@ -92,14 +92,22 @@ private static boolean isFieldPrimitive(Schema.Field field)
private final boolean fromPigAvroStorage;
private final boolean binaryAsString;
+ private final boolean discoverNestedFields;
+
/**
* @param fromPigAvroStorage boolean to specify the data file is stored using AvroStorage
* @param binaryAsString boolean to encode the byte[] as a string.
Review Comment:
javadocs need an update.
##########
core/src/main/java/org/apache/druid/java/util/common/parsers/JSONFlattenerMaker.java:
##########
@@ -57,15 +57,21 @@ 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 (discoverNestedFields) {
Review Comment:
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org