GitHub user ravipesala opened a pull request:

    https://github.com/apache/carbondata/pull/1654

    [CARBONDATA-1856] Support insert/load data for partition table

    This PR depends on PR https://github.com/apache/carbondata/pull/1642
    
    Changed carbonrelation to HadoopFSRelation during load in case of the 
partition table. 
    Implement sparks Fileformat interface for carbon and use carbonoutputformat 
inside.
    Create partition.map file inside each segment for mapping between partition 
and index file.
    
    The following syntax is supported now.
    ```
    CREATE TABLE partitiontwo (empno int, designation String,
      workgroupcategory int, workgroupcategoryname String, deptno int, deptname 
String,
      projectcode int, projectjoindate Timestamp, projectenddate 
Timestamp,attendance int,
      utilization int,salary int)
     PARTITIONED BY (doj Timestamp, empname String)
     STORED BY 'org.apache.carbondata.format'
    
    LOAD DATA local inpath '$resourcesPath/data.csv' INTO TABLE partitiontwo 
OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '"')
    
    insert into insertpartitionthree select 
empno,doj,workgroupcategoryname,deptno,deptname,projectcode,projectjoindate,projectenddate,attendance,utilization,salary,workgroupcategory,empname,designation
 from originTable
    
    LOAD DATA local inpath '$resourcesPath/data.csv' INTO TABLE 
singlepasspartitionone OPTIONS('DELIMITER'= ',', 'QUOTECHAR'= '"', 
'SINGLE_PASS'='true')
    
    ```
    
    Be sure to do all of the following checklist to help us incorporate 
    your contribution quickly and easily:
    
     - [ ] Any interfaces changed?
     
     - [ ] Any backward compatibility impacted?
     
     - [ ] Document update required?
    
     - [ ] Testing done
            Please provide details on 
            - Whether new unit test cases have been added or why no new tests 
are required?
            - How it is tested? Please attach test report.
            - Is it a performance related change? Please attach the performance 
test report.
            - Any additional information to help reviewers in testing this 
change.
           
     - [ ] For large changes, please consider breaking it into sub-tasks under 
an umbrella JIRA. 
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ravipesala/incubator-carbondata fileformat

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/1654.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1654
    
----
commit 62d0007585cbe5609f99abe3fcf485cdaf35ccfc
Author: ravipesala <ravi.pes...@gmail.com>
Date:   2017-12-04T10:37:03Z

    Added outputformat for carbon

commit 80d8f662c53f97dd0379b3d9762b96a6e439a739
Author: ravipesala <ravi.pes...@gmail.com>
Date:   2017-12-12T06:12:45Z

    Added fileformat in carbon

----


---

Reply via email to