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

    https://github.com/apache/carbondata/pull/2254#discussion_r185432739
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datamap/dev/DataMapWriter.java ---
    @@ -36,25 +41,39 @@
     @InterfaceStability.Evolving
     public abstract class DataMapWriter {
     
    -  protected AbsoluteTableIdentifier identifier;
    +  protected String tablePath;
     
       protected String segmentId;
     
    -  protected String writeDirectoryPath;
    +  protected String dataMapPath;
     
    -  public DataMapWriter(AbsoluteTableIdentifier identifier, Segment segment,
    -      String writeDirectoryPath) {
    -    this.identifier = identifier;
    +  private List<CarbonColumn> indexColumns;
    +
    +  public DataMapWriter(CarbonTable carbonTable, DataMapSchema 
dataMapSchema, Segment segment,
    +      String shardName) throws MalformedDataMapCommandException {
    +    this(carbonTable.getTablePath(), dataMapSchema.getDataMapName(),
    +        carbonTable.getIndexedColumns(dataMapSchema), segment, shardName);
    +  }
    +
    +  public DataMapWriter(String tablePath, String dataMapName, 
List<CarbonColumn> indexColumns,
    +      Segment segment, String shardName) {
    +    this.tablePath = tablePath;
         this.segmentId = segment.getSegmentNo();
    -    this.writeDirectoryPath = writeDirectoryPath;
    +    this.dataMapPath = CarbonTablePath.getDataMapStorePathOnShardName(
    +        tablePath, segmentId, dataMapName, shardName);
    +    this.indexColumns = indexColumns;
    +  }
    +
    +  protected final List<CarbonColumn> getIndexColumns() {
    +    return indexColumns;
       }
     
       /**
        * Start of new block notification.
        *
        * @param blockId file name of the carbondata file
        */
    -  public abstract void onBlockStart(String blockId, String indexShardName) 
throws IOException;
    +  public abstract void onBlockStart(String blockId) throws IOException;
    --- End diff --
    
    Currently IOException is enough, since all datamap implementation will 
write some data into files


---

Reply via email to