a bit performance improvement, but sorry seems forget another change..

Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/5e00f878
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/5e00f878
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/5e00f878

Branch: refs/heads/master
Commit: 5e00f87879f075638c197ea0d42cfcaefbdf6a77
Parents: f48cc2b
Author: Liu Ming <[email protected]>
Authored: Tue Apr 5 13:11:29 2016 +0000
Committer: Liu Ming <[email protected]>
Committed: Tue Apr 5 13:11:29 2016 +0000

----------------------------------------------------------------------
 core/sql/executor/ExHdfsScan.h | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/5e00f878/core/sql/executor/ExHdfsScan.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.h b/core/sql/executor/ExHdfsScan.h
index 2b3c785..1a88a64 100644
--- a/core/sql/executor/ExHdfsScan.h
+++ b/core/sql/executor/ExHdfsScan.h
@@ -436,22 +436,34 @@ inline char *hdfs_strchr(char *s, int c, const char *end, 
NABoolean checkRangeDe
 {
   char *curr = (char *)s;
   int count=0;
-  while (curr < end) {
+  if( (mode & HIVE_MODE_DOSFORMAT ) == 0)
+  {
+   while (curr < end) {
     if (*curr == c)
     {
-       if((mode & HIVE_MODE_DOSFORMAT) > 0 ) // The line terminator and we 
want to remove the \r before it
-       {
-         if(count>0 && c == '\n')
-         {
-           if(s[count-1] == '\r') s[count-1] = ' '; 
-         }
-       }
        return curr;
     }
     if (checkRangeDelimiter &&*curr == RANGE_DELIMITER)
        return NULL;
     curr++;
+   }
+  }
+  else
+  {
+   while (curr < end) {
+     if (*curr == c)
+     {
+         if(count>0 && c == '\n')
+         {
+           if(s[count-1] == '\r') s[count-1] = ' '; 
+         }
+         return curr;
+      }
+      if (checkRangeDelimiter &&*curr == RANGE_DELIMITER)
+         return NULL;
+    curr++;
     count++;
+   }
   }
   return NULL;
 }

Reply via email to