trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hzel...@apache.org
Subject [10/11] incubator-trafodion git commit: Fix char length calculation for equivalent hive char type.
Date Mon, 31 Oct 2016 22:55:17 GMT
Fix char length calculation for equivalent hive char type.


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

Branch: refs/heads/master
Commit: 8f4864034d2c162f6efab818e18a8ba4e2035dea
Parents: 51ba8ee
Author: Hans Zeller <hzeller@apache.org>
Authored: Mon Oct 31 17:45:58 2016 +0000
Committer: Hans Zeller <hzeller@apache.org>
Committed: Mon Oct 31 17:45:58 2016 +0000

----------------------------------------------------------------------
 core/sql/common/NAType.cpp   | 4 +++-
 core/sql/optimizer/RelMisc.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8f486403/core/sql/common/NAType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/NAType.cpp b/core/sql/common/NAType.cpp
index 12cc085..385c626 100644
--- a/core/sql/common/NAType.cpp
+++ b/core/sql/common/NAType.cpp
@@ -697,7 +697,9 @@ short NAType::getMyTypeAsHiveText(NAString * outputStr/*out*/) const
         else
           {
             char buf[20];
-            Int32 size = getNominalSize() / ct->getBytesPerChar();
+            // Hive doesn't have the "n bytes" notation,
+            // so just take the overall char limit
+            Int32 size = ct->getStrCharLimit();
             str_itoa(size, buf);
             *outputStr = "varchar(";
             *outputStr += buf;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8f486403/core/sql/optimizer/RelMisc.h
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelMisc.h b/core/sql/optimizer/RelMisc.h
index 46eb133..9fd5f1a 100644
--- a/core/sql/optimizer/RelMisc.h
+++ b/core/sql/optimizer/RelMisc.h
@@ -109,6 +109,7 @@ class ElemProxyColDef;
 class ItemExprList;
 class RtmdCompileTimeObj;
 class HbaseAccessOptions;
+class Union;
 
 // TreeStore struct
 struct TreeStore : public NABasicObject


Mime
View raw message