[GitHub] carbondata pull request #1654: [CARBONDATA-1856] Support insert/load data fo...

classic Classic list List threaded Threaded
57 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1654: [CARBONDATA-1856] Support insert/load data fo...

qiuchenjian-2
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 <[hidden email]>
Date:   2017-12-04T10:37:03Z

    Added outputformat for carbon

commit 80d8f662c53f97dd0379b3d9762b96a6e439a739
Author: ravipesala <[hidden email]>
Date:   2017-12-12T06:12:45Z

    Added fileformat in carbon

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856] Support insert/load data for parti...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/700/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856] Support insert/load data for parti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1929/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856] Support insert/load data for parti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2262/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856] Support insert/load data for parti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1939/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856] Support insert/load data for parti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/713/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856] Support insert/load data for parti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2268/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/731/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/1960/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2282/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    @ravipesala This PR implements Hive dynamic partition. Load into static partition is still pending?


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1654: [CARBONDATA-1856][PARTITION] Support insert/l...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1654#discussion_r157148797
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/PartitionFileStore.java ---
    @@ -0,0 +1,199 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.metadata;
    +
    +import java.io.BufferedReader;
    +import java.io.BufferedWriter;
    +import java.io.DataInputStream;
    +import java.io.DataOutputStream;
    +import java.io.IOException;
    +import java.io.InputStreamReader;
    +import java.io.OutputStreamWriter;
    +import java.io.Serializable;
    +import java.nio.charset.Charset;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.datastore.filesystem.CarbonFile;
    +import org.apache.carbondata.core.datastore.filesystem.CarbonFileFilter;
    +import org.apache.carbondata.core.datastore.impl.FileFactory;
    +import org.apache.carbondata.core.fileoperations.AtomicFileOperations;
    +import org.apache.carbondata.core.fileoperations.AtomicFileOperationsImpl;
    +import org.apache.carbondata.core.fileoperations.FileWriteOperation;
    +import org.apache.carbondata.core.util.CarbonUtil;
    +import org.apache.carbondata.core.util.path.CarbonTablePath;
    +
    +import com.google.gson.Gson;
    +
    +/**
    + * Reads and writes the partition mapper.
    + */
    +public class PartitionFileStore {
    --- End diff --
   
    Suggest to change to `PartitionMapFileStore`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1654: [CARBONDATA-1856][PARTITION] Support insert/l...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1654#discussion_r157148902
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/PartitionFileStore.java ---
    @@ -0,0 +1,199 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.carbondata.core.metadata;
    +
    +import java.io.BufferedReader;
    +import java.io.BufferedWriter;
    +import java.io.DataInputStream;
    +import java.io.DataOutputStream;
    +import java.io.IOException;
    +import java.io.InputStreamReader;
    +import java.io.OutputStreamWriter;
    +import java.io.Serializable;
    +import java.nio.charset.Charset;
    +import java.util.HashMap;
    +import java.util.List;
    +import java.util.Map;
    +
    +import org.apache.carbondata.core.constants.CarbonCommonConstants;
    +import org.apache.carbondata.core.datastore.filesystem.CarbonFile;
    +import org.apache.carbondata.core.datastore.filesystem.CarbonFileFilter;
    +import org.apache.carbondata.core.datastore.impl.FileFactory;
    +import org.apache.carbondata.core.fileoperations.AtomicFileOperations;
    +import org.apache.carbondata.core.fileoperations.AtomicFileOperationsImpl;
    +import org.apache.carbondata.core.fileoperations.FileWriteOperation;
    +import org.apache.carbondata.core.util.CarbonUtil;
    +import org.apache.carbondata.core.util.path.CarbonTablePath;
    +
    +import com.google.gson.Gson;
    +
    +/**
    + * Reads and writes the partition mapper.
    --- End diff --
   
    Suggest to change to `Provide read and write support for partition mapping file in each segment`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1654: [CARBONDATA-1856][PARTITION] Support insert/l...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1654#discussion_r157149342
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/partition/PartitionType.java ---
    @@ -23,5 +23,6 @@
       RANGE,
       RANGE_INTERVAL,
       LIST,
    -  HASH
    +  HASH,
    +  STANDARD
    --- End diff --
   
    Maybe `HIVE` is better


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #1654: [CARBONDATA-1856][PARTITION] Support insert/l...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1654#discussion_r157149579
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/schema/table/CarbonTable.java ---
    @@ -573,6 +574,11 @@ public boolean isPartitionTable() {
         return null != tablePartitionMap.get(getTableName());
       }
     
    +  public boolean isStandardPartitionTable() {
    --- End diff --
   
    change to `isHivePartitionTable`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    @jackylk This PR implements both static and dynamic partition, but the syntax for static partition through LOAD command is not done yet. We can INSERT INTO sql for static partition. Test case also added for it please check.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/808/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2039/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2352/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #1654: [CARBONDATA-1856][PARTITION] Support insert/load dat...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1654
 
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/831/



---
123