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

    https://github.com/apache/carbondata/pull/2254#discussion_r185402546
  
    --- Diff: 
processing/src/main/java/org/apache/carbondata/processing/datamap/DataMapWriterListener.java
 ---
    @@ -62,25 +63,31 @@ public void registerAllWriter(CarbonTable carbonTable, 
String segmentId,
         if (tableIndices != null) {
           for (TableDataMap tableDataMap : tableIndices) {
             DataMapFactory factory = tableDataMap.getDataMapFactory();
    -        register(factory, segmentId, dataWritePath);
    +        register(factory, segmentId, taskNo);
           }
         }
       }
     
       /**
        * Register a DataMapWriter
        */
    -  private void register(DataMapFactory factory, String segmentId, String 
dataWritePath) {
    +  private void register(DataMapFactory factory, String segmentId, String 
taskNo) {
         assert (factory != null);
         assert (segmentId != null);
         DataMapMeta meta = factory.getMeta();
         if (meta == null) {
           // if data map does not have meta, no need to register
           return;
         }
    -    List<String> columns = factory.getMeta().getIndexedColumns();
    +    List<CarbonColumn> columns = factory.getMeta().getIndexedColumns();
         List<DataMapWriter> writers = registry.get(columns);
    -    DataMapWriter writer = factory.createWriter(new Segment(segmentId, 
null, null), dataWritePath);
    +    DataMapWriter writer = null;
    +    try {
    +      writer = factory.createWriter(new Segment(segmentId), taskNo);
    +    } catch (IOException e) {
    +      LOG.error(e);
    +      throw new RuntimeException(e);
    --- End diff --
    
    As I mentioned above, will we customize an exception that extends RTE to 
wrap the exceptions may be thrown during DataMapWriter?


---

Reply via email to