Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/263#discussion_r87123336
  
    --- Diff: 
processing/src/main/java/org/apache/carbondata/processing/newflow/steps/DataConverterProcessorStepImpl.java
 ---
    @@ -47,20 +58,109 @@ public 
DataConverterProcessorStepImpl(CarbonDataLoadConfiguration configuration,
     
       @Override
       public void initialize() throws CarbonDataLoadingException {
    -    encoder = new RowConverterImpl(child.getOutput(), configuration);
    -    child.initialize();
    +    super.initialize();
    +    BadRecordslogger badRecordLogger = createBadRecordLogger();
    +    converter = new RowConverterImpl(child.getOutput(), configuration, 
badRecordLogger);
    +    converter.initialize();
    +  }
    +
    +  /**
    +   * Create the iterator using child iterator.
    +   *
    +   * @param childIter
    +   * @return new iterator with step specific processing.
    +   */
    +  @Override
    +  protected Iterator<CarbonRowBatch> getIterator(final 
Iterator<CarbonRowBatch> childIter) {
    +    return new CarbonIterator<CarbonRowBatch>() {
    +      RowConverter localConverter = converter.createCopyForNewThread();
    +      @Override public boolean hasNext() {
    +        return childIter.hasNext();
    +      }
    +
    +      @Override public CarbonRowBatch next() {
    +        return processRowBatch(childIter.next(), localConverter);
    +      }
    +    };
    +  }
    +
    +  /**
    +   * Process the batch of rows as per the step logic.
    +   *
    +   * @param rowBatch
    +   * @return processed row.
    +   */
    +  protected CarbonRowBatch processRowBatch(CarbonRowBatch rowBatch, 
RowConverter localConverter) {
    +    CarbonRowBatch newBatch = new CarbonRowBatch();
    +    Iterator<CarbonRow> batchIterator = rowBatch.getBatchIterator();
    +    while (batchIterator.hasNext()) {
    +      newBatch.addRow(localConverter.convert(batchIterator.next()));
    +    }
    +    return newBatch;
       }
     
       @Override
       protected CarbonRow processRow(CarbonRow row) {
    -    return encoder.convert(row);
    +    // Not implemented
    +    return null;
    --- End diff --
    
    throw UnsupportedOperationException here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to