> On April 15, 2015, 6:41 p.m., Francis Page wrote: > > flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java, > > line 64 > > <https://reviews.apache.org/r/33215/diff/1/?file=929718#file929718line64> > > > > You don't have to create a tmp builder. To make sure the JSON is valid, > > you just have to do: > > while(parser.nextToken() != null) { }
True, cause that's exactly what copyCurrentStructure does under the hood (recursively). > On April 15, 2015, 6:41 p.m., Francis Page wrote: > > flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java, > > line 44 > > <https://reviews.apache.org/r/33215/diff/1/?file=929718#file929718line44> > > > > This should not only check if it's null, but also if it's a json > > content type. Not sure about this one, if it's JSON/YAML/SMILE, then contentType is not going to be null and the data can be parsed as a complex field. IMHO this does the job well. - Benjamin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33215/#review80205 ----------------------------------------------------------- On April 15, 2015, 11:56 a.m., Benjamin Fiorini wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/33215/ > ----------------------------------------------------------- > > (Updated April 15, 2015, 11:56 a.m.) > > > Review request for Flume. > > > Repository: flume-git > > > Description > ------- > > Elasticsearch sink fails to index malformed nested JSON > > > Diffs > ----- > > > flume-ng-sinks/flume-ng-elasticsearch-sink/src/main/java/org/apache/flume/sink/elasticsearch/ContentBuilderUtil.java > de0acf4 > > flume-ng-sinks/flume-ng-elasticsearch-sink/src/test/java/org/apache/flume/sink/elasticsearch/AbstractElasticSearchSinkTest.java > 2f8fd6d > > flume-ng-sinks/flume-ng-elasticsearch-sink/src/test/java/org/apache/flume/sink/elasticsearch/TestElasticSearchSink.java > 78e1665 > > Diff: https://reviews.apache.org/r/33215/diff/ > > > Testing > ------- > > > Thanks, > > Benjamin Fiorini > >