[TRAFODION-1912] update according to review comments use TDB flag
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/64ef7db6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/64ef7db6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/64ef7db6 Branch: refs/heads/master Commit: 64ef7db64fed0aca56554336d39710c15121518f Parents: 6294427 Author: Liu Ming <[email protected]> Authored: Wed Apr 6 14:53:22 2016 +0000 Committer: Liu Ming <[email protected]> Committed: Wed Apr 6 14:53:22 2016 +0000 ---------------------------------------------------------------------- core/sql/comexe/ComTdbHdfsScan.h | 5 ++++- core/sql/executor/ExHdfsScan.cpp | 7 ++----- core/sql/executor/ExHdfsScan.h | 1 - core/sql/generator/GenRelScan.cpp | 6 ++++-- core/sql/regress/hive/EXPECTED005 | 3 --- core/sql/regress/hive/TEST005 | 1 - 6 files changed, 10 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/64ef7db6/core/sql/comexe/ComTdbHdfsScan.h ---------------------------------------------------------------------- diff --git a/core/sql/comexe/ComTdbHdfsScan.h b/core/sql/comexe/ComTdbHdfsScan.h index 067b28f..0842c19 100755 --- a/core/sql/comexe/ComTdbHdfsScan.h +++ b/core/sql/comexe/ComTdbHdfsScan.h @@ -130,7 +130,8 @@ class ComTdbHdfsScan : public ComTdb NABasicPtr errCountTable_; // 160 - 167 NABasicPtr loggingLocation_; // 168 - 175 NABasicPtr errCountRowId_; // 176 - 183 - char fillersComTdbHdfsScan1_[16]; // 184 - 199 + UInt32 hiveScanMode_; // 184 - 187 + char fillersComTdbHdfsScan1_[12]; // 188 - 199 public: enum HDFSFileType @@ -217,6 +218,8 @@ public: void setLoggingLocation(char * v ) { loggingLocation_ = v; } char * getErrCountRowId() { return errCountRowId_; } void setErrCountRowId(char * v ) { errCountRowId_ = v; } + void setHiveScanMode(UInt32 v ) { hiveScanMode_ = v; } + UInt32 getHiveScanMode() { return hiveScanMode_; } Queue* getHdfsFileInfoList() {return hdfsFileInfoList_;} Queue* getHdfsFileRangeBeginList() {return hdfsFileRangeBeginList_;} http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/64ef7db6/core/sql/executor/ExHdfsScan.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp index 6c38ecc..6bed78e 100644 --- a/core/sql/executor/ExHdfsScan.cpp +++ b/core/sql/executor/ExHdfsScan.cpp @@ -367,10 +367,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work() char cursorId[8]; HdfsFileInfo *hdfo = NULL; Lng32 openType = 0; - int hiveScanMode = 0; - hiveScanMode = CmpCommon::getDefaultLong(HIVE_SCAN_SPECIAL_MODE); - while (!qparent_.down->isEmpty()) { ex_queue_entry *pentry_down = qparent_.down->getHeadEntry(); @@ -723,7 +720,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work() // Position in the hdfsScanBuffer_ to the // first record delimiter. hdfsBufNextRow_ = hdfs_strchr(hdfsScanBuffer_, - hdfsScanTdb().recordDelimiter_, hdfsScanBuffer_+trailingPrevRead_+ bytesRead_, checkRangeDelimiter_, hiveScanMode); + hdfsScanTdb().recordDelimiter_, hdfsScanBuffer_+trailingPrevRead_+ bytesRead_, checkRangeDelimiter_, hdfsScanTdb().getHiveScanMode()); // May be that the record is too long? Or data isn't ascii? // Or delimiter is incorrect. if (! hdfsBufNextRow_) @@ -771,7 +768,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work() ComDiagsArea *transformDiags = NULL; int err = 0; char *startOfNextRow = - extractAndTransformAsciiSourceToSqlRow(err, transformDiags, hiveScanMode); + extractAndTransformAsciiSourceToSqlRow(err, transformDiags, hdfsScanTdb().getHiveScanMode()); bool rowWillBeSelected = true; lastErrorCnd_ = NULL; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/64ef7db6/core/sql/executor/ExHdfsScan.h ---------------------------------------------------------------------- diff --git a/core/sql/executor/ExHdfsScan.h b/core/sql/executor/ExHdfsScan.h index 0a1dc62..7bc7d5e 100644 --- a/core/sql/executor/ExHdfsScan.h +++ b/core/sql/executor/ExHdfsScan.h @@ -516,7 +516,6 @@ inline char *hdfs_strchr(char *s, int rd, int cd, const char *end, NABoolean che return NULL; } curr++; - count++; } } *rdSeen = FALSE; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/64ef7db6/core/sql/generator/GenRelScan.cpp ---------------------------------------------------------------------- diff --git a/core/sql/generator/GenRelScan.cpp b/core/sql/generator/GenRelScan.cpp index b56a7ae..83a3b64 100644 --- a/core/sql/generator/GenRelScan.cpp +++ b/core/sql/generator/GenRelScan.cpp @@ -1131,7 +1131,7 @@ if (hTabStats->isOrcFile()) char * tablename = space->AllocateAndCopyToAlignedSpace(GenGetQualifiedName(getIndexDesc()->getNAFileSet()->getFileSetName()), 0); - + UInt32 hiveScanMode = CmpCommon::getDefaultLong(HIVE_SCAN_SPECIAL_MODE); // create hdfsscan_tdb ComTdbHdfsScan *hdfsscan_tdb = new(space) ComTdbHdfsScan( @@ -1170,7 +1170,7 @@ if (hTabStats->isOrcFile()) buffersize, errCountTab, logLocation, - errCountRowId + errCountRowId ); generator->initTdbFields(hdfsscan_tdb); @@ -1179,6 +1179,8 @@ if (hTabStats->isOrcFile()) hdfsscan_tdb->setDoSplitFileOpt(doSplitFileOpt); + hdfsscan_tdb->setHiveScanMode(hiveScanMode); + NABoolean hdfsPrefetch = FALSE; if (CmpCommon::getDefault(HDFS_PREFETCH) == DF_ON) hdfsPrefetch = TRUE; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/64ef7db6/core/sql/regress/hive/EXPECTED005 ---------------------------------------------------------------------- diff --git a/core/sql/regress/hive/EXPECTED005 b/core/sql/regress/hive/EXPECTED005 index 7d7b108..53cafed 100644 --- a/core/sql/regress/hive/EXPECTED005 +++ b/core/sql/regress/hive/EXPECTED005 @@ -474,9 +474,6 @@ C1 (EXPR) --- SQL operation complete. >> ->>cqd CALL_EMBEDDED_ARKCMP 'ON'; - ---- SQL operation complete. >>cqd HIVE_SCAN_SPECIAL_MODE '1'; --- SQL operation complete. http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/64ef7db6/core/sql/regress/hive/TEST005 ---------------------------------------------------------------------- diff --git a/core/sql/regress/hive/TEST005 b/core/sql/regress/hive/TEST005 index e2c824f..96ed8ac 100644 --- a/core/sql/regress/hive/TEST005 +++ b/core/sql/regress/hive/TEST005 @@ -230,7 +230,6 @@ cqd HIVE_FILE_CHARSET 'GBK'; select c1, CONVERTTOHEX(c2) from tbl_gbk; cqd HIVE_FILE_CHARSET reset; -cqd CALL_EMBEDDED_ARKCMP 'ON'; cqd HIVE_SCAN_SPECIAL_MODE '1'; select * from tbl_dos; cqd HIVE_SCAN_SPECIAL_MODE reset;
