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

    https://github.com/apache/incubator-carbondata/pull/263#discussion_r87170789
  
    --- Diff: 
integration/spark/src/main/java/org/apache/carbondata/spark/load/CarbonLoaderUtil.java
 ---
    @@ -215,6 +227,105 @@ public static void executeGraph(CarbonLoadModel 
loadModel, String storeLocation,
                 info, loadModel.getPartitionId(), 
loadModel.getCarbonDataLoadSchema());
       }
     
    +  public static void executeNewDataLoad(CarbonLoadModel loadModel, String 
storeLocation,
    +      String hdfsStoreLocation, RecordReader<NullWritable, 
StringArrayWritable>[] recordReaders)
    +      throws Exception {
    +    if (!new File(storeLocation).mkdirs()) {
    +      LOGGER.error("Error while creating the temp store path: " + 
storeLocation);
    +    }
    +    CarbonDataLoadConfiguration configuration = new 
CarbonDataLoadConfiguration();
    +    String databaseName = loadModel.getDatabaseName();
    +    String tableName = loadModel.getTableName();
    +    String tempLocationKey = databaseName + 
CarbonCommonConstants.UNDERSCORE + tableName
    +        + CarbonCommonConstants.UNDERSCORE + loadModel.getTaskNo();
    +    CarbonProperties.getInstance().addProperty(tempLocationKey, 
storeLocation);
    +    CarbonProperties.getInstance()
    +        .addProperty(CarbonCommonConstants.STORE_LOCATION_HDFS, 
hdfsStoreLocation);
    +    // CarbonProperties.getInstance().addProperty("store_output_location", 
outPutLoc);
    +    CarbonProperties.getInstance().addProperty("send.signal.load", 
"false");
    +
    +    CarbonTable carbonTable = 
loadModel.getCarbonDataLoadSchema().getCarbonTable();
    +    AbsoluteTableIdentifier identifier =
    +        carbonTable.getAbsoluteTableIdentifier();
    +    configuration.setTableIdentifier(identifier);
    +    String csvHeader = loadModel.getCsvHeader();
    +    String csvFileName = null;
    +    if (csvHeader != null && !csvHeader.isEmpty()) {
    +      
configuration.setHeader(CarbonDataProcessorUtil.getColumnFields(csvHeader, 
","));
    +    } else {
    +      CarbonFile csvFile =
    +          
CarbonDataProcessorUtil.getCsvFileToRead(loadModel.getFactFilesToProcess().get(0));
    +      csvFileName = csvFile.getName();
    +      csvHeader = CarbonDataProcessorUtil.getFileHeader(csvFile);
    +      configuration.setHeader(
    +          CarbonDataProcessorUtil.getColumnFields(csvHeader, 
loadModel.getCsvDelimiter()));
    +    }
    +    CarbonDataProcessorUtil
    +        .validateHeader(loadModel.getTableName(), csvHeader, 
loadModel.getCarbonDataLoadSchema(),
    +            loadModel.getCsvDelimiter(), csvFileName);
    --- End diff --
    
    Ok. Modified.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to