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

    https://github.com/apache/incubator-carbondata/pull/263#discussion_r87122331
  
    --- Diff: 
processing/src/main/java/org/apache/carbondata/processing/newflow/converter/impl/RowConverterImpl.java
 ---
    @@ -43,35 +45,58 @@
     
       private CarbonDataLoadConfiguration configuration;
     
    +  private DataField[] fields;
    +
       private FieldConverter[] fieldConverters;
     
    -  public RowConverterImpl(DataField[] fields, CarbonDataLoadConfiguration 
configuration) {
    +  private BadRecordslogger badRecordLogger;
    +
    +  private BadRecordLogHolder logHolder;
    +
    +  public RowConverterImpl(DataField[] fields, CarbonDataLoadConfiguration 
configuration,
    +      BadRecordslogger badRecordLogger) {
    +    this.fields = fields;
         this.configuration = configuration;
    +    this.badRecordLogger = badRecordLogger;
    +  }
    +
    +  @Override
    +  public void initialize() {
         CacheProvider cacheProvider = CacheProvider.getInstance();
         Cache<DictionaryColumnUniqueIdentifier, Dictionary> cache =
             cacheProvider.createCache(CacheType.REVERSE_DICTIONARY,
                 configuration.getTableIdentifier().getStorePath());
    +    String nullFormat =
    +        
configuration.getDataLoadProperty(DataLoadProcessorConstants.SERIALIZATION_NULL_FORMAT)
    +            .toString();
         List<FieldConverter> fieldConverterList = new ArrayList<>();
     
         long lruCacheStartTime = System.currentTimeMillis();
     
         for (int i = 0; i < fields.length; i++) {
           FieldConverter fieldConverter = FieldEncoderFactory.getInstance()
               .createFieldEncoder(fields[i], cache,
    -              
configuration.getTableIdentifier().getCarbonTableIdentifier(), i);
    -      if (fieldConverter != null) {
    -        fieldConverterList.add(fieldConverter);
    -      }
    +              
configuration.getTableIdentifier().getCarbonTableIdentifier(), i, nullFormat);
    +      fieldConverterList.add(fieldConverter);
         }
         CarbonTimeStatisticsFactory.getLoadStatisticsInstance()
             .recordLruCacheLoadTime((System.currentTimeMillis() - 
lruCacheStartTime) / 1000.0);
         fieldConverters = fieldConverterList.toArray(new 
FieldConverter[fieldConverterList.size()]);
    +    logHolder = new BadRecordLogHolder();
       }
     
       @Override
       public CarbonRow convert(CarbonRow row) throws 
CarbonDataLoadingException {
    +    CarbonRow copy = row.getCopy();
    --- End diff --
    
    Why copy it every time? Copy it only if it is bad record


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to