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

    https://github.com/apache/incubator-quickstep/pull/99#discussion_r78285930
  
    --- Diff: relational_operators/TextScanOperator.cpp ---
    @@ -91,6 +91,15 @@ bool TextScanOperator::getAllWorkOrders(
       if (blocking_dependencies_met_ && !work_generated_) {
         for (const std::string &file : files) {
           // Use standard C libary to retrieve the file size.
    +
    +      // Check file permissions before trying to open it
    +      #ifdef QUICKSTEP_HAVE_UNISTD
    --- End diff --
    
    Hi @tarunbansal Welcome to the team, and please get familiar with our code 
style at 
https://cwiki.apache.org/confluence/display/QUICKSTEP/Quickstep+Coding+Standards.
    
    Also, I noticed that you made the file mode from `644` to `755`. Please 
revert this change first.
    
    Finally, I would have written the code as following:
    ```
    // Add in Line 21.
    #include "relational_operators/RelationalConfig.h"  // For 
QUICKSTEP_HAVE_UNISTD.
    
    #ifdef QUICKSTEP_HAVE_UNISTD
    #include <unistd.h>
    #endif  // QUICKSTEP_HAVE_UNISTD
    
    // Start from Line 95.
    #ifdef QUICKSTEP_HAVE_UNISTD
          // Check file permissions before trying to open it.
          const int access_result = access(file.c_str(), R_OK);
          CHECK_EQ(0, access_result)
              << "File " <<  file << " is not readable due to permission 
issues.";
    #endif  // QUICKSTEP_HAVE_UNISTD
    ```


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