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

    https://github.com/apache/incubator-carbondata/pull/263#discussion_r87124965
  
    --- Diff: 
processing/src/main/java/org/apache/carbondata/processing/util/CarbonDataProcessorUtil.java
 ---
    @@ -396,4 +407,223 @@ private static void 
addAllComplexTypeChildren(CarbonDimension dimension, StringB
         }
         return complexTypesMap;
       }
    +
    +  /**
    +   * Get the csv file to read if it the path is file otherwise get the 
first file of directory.
    +   *
    +   * @param csvFilePath
    +   * @return File
    +   */
    +  public static CarbonFile getCsvFileToRead(String csvFilePath) {
    +    CarbonFile csvFile =
    +        FileFactory.getCarbonFile(csvFilePath, 
FileFactory.getFileType(csvFilePath));
    +
    +    CarbonFile[] listFiles = null;
    +    if (csvFile.isDirectory()) {
    +      listFiles = csvFile.listFiles(new CarbonFileFilter() {
    +        @Override public boolean accept(CarbonFile pathname) {
    +          if (!pathname.isDirectory()) {
    +            if 
(pathname.getName().endsWith(CarbonCommonConstants.CSV_FILE_EXTENSION) || 
pathname
    +                
.getName().endsWith(CarbonCommonConstants.CSV_FILE_EXTENSION
    +                    + CarbonCommonConstants.FILE_INPROGRESS_STATUS)) {
    +              return true;
    +            }
    +          }
    +
    --- End diff --
    
    remove empty line


---
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