[ 
https://issues.apache.org/jira/browse/CARBONDATA-4227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17392772#comment-17392772
 ] 

Nihal kumar ojha commented on CARBONDATA-4227:
----------------------------------------------

Hi,

   Based on the current carbon SDK implementation, when you execute 
`CarbonWriter.builder()` that time we create an instance of CarbonWriterBuilder 
and then we keep changing the other property based on other exposed APIs in the 
same instance. Now when we trigger build() then we consider all the property of 
instance as final and make use of that for creating the CarbonWriter. Now 
suppose after performing build() if we will allow change other property of the 
same instance and perform build() again then it will overwrite the previous 
build() instance and that again leads to confusion.

    So I will suggest if you want to use another build() instance then please 
create a new builder() instance first otherwise it won't behave as expected.

Please post your reply if any other confusion related to this.

> SDK CarbonWriterBuilder cannot execute `build()` several times with different 
> output path
> -----------------------------------------------------------------------------------------
>
>                 Key: CARBONDATA-4227
>                 URL: https://issues.apache.org/jira/browse/CARBONDATA-4227
>             Project: CarbonData
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.1.1
>            Reporter: ChenKai
>            Priority: Major
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Sometimes we want to reuse CarbonWriterBuilder object to build CarbonWriter 
> with different output paths, but it does not work.
> For example: 
> {code:scala}
> val builder = CarbonWriter.builder().withCsvInput(...).writtenBy(...)
> // 1. first writing with path1
> val writer1 = builder.outputPath(path1).build()
> // write data, it works 
> // 2. second writing with path2
> val writer2 = builder.outputPath(path2).build()
> // write data, it does not work. It still writes data to path1
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to