Github user traflm commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/414#discussion_r58714988
--- Diff: core/sql/executor/ExHdfsScan.h ---
@@ -429,41 +432,92 @@ class ExOrcFastAggrTcb : public ExOrcScanTcb
#define RANGE_DELIMITER '\002'
-inline char *hdfs_strchr(const char *s, int c, const char *end, NABoolean
checkRangeDelimiter)
+inline char *hdfs_strchr(char *s, int c, const char *end, NABoolean
checkRangeDelimiter, int mode = 0)
{
char *curr = (char *)s;
-
- while (curr < end) {
+ int count=0;
+ if( (mode & HIVE_MODE_DOSFORMAT ) == 0)
+ {
+ while (curr < end) {
if (*curr == c)
+ {
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] = ' ';
--- End diff --
I tested with DATE and INT, both works well with extra space. But maybe \0
is better. Let me try it out.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---