You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2015/11/11 17:30:47 UTC

[2/3] incubator-trafodion git commit: Moving the check for presence of LOB columns in sampled Coumns to generator so it allows non lob columns from the same table to be sampled.

Moving the check for presence of LOB columns in sampled Coumns to generator so it allows non lob columns from the same table to be sampled.


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

Branch: refs/heads/master
Commit: 02cf1145c4635fd92295cea75430eb143da23ef4
Parents: 825216d
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Tue Nov 10 21:27:59 2015 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Tue Nov 10 21:27:59 2015 +0000

----------------------------------------------------------------------
 core/sql/generator/GenRelSample.cpp | 15 ++++++++++++++-
 core/sql/optimizer/BindRelExpr.cpp  | 11 ++---------
 core/sql/optimizer/RelSample.cpp    | 11 +----------
 3 files changed, 17 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/02cf1145/core/sql/generator/GenRelSample.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelSample.cpp b/core/sql/generator/GenRelSample.cpp
index ee45908..a80bec3 100644
--- a/core/sql/generator/GenRelSample.cpp
+++ b/core/sql/generator/GenRelSample.cpp
@@ -192,7 +192,20 @@ PhysSample::codeGen(Generator *generator)
 //       MapInfo *mapInfo = localMapTable->addMapInfoToThis(valId, attr);
 //       mapInfo->codeGenerated();
 //     }
-
+// check if any of the columns inthe sampled columns are lob columns. If so, return an error.
+  ValueId valId;
+  for(valId = sampledColumns().init();
+      sampledColumns().next(valId);
+      sampledColumns().advance(valId))
+    {
+      const NAType &colType = valId.getType();
+      if ((colType.getFSDatatype() == REC_BLOB) ||
+	  (colType.getFSDatatype() == REC_CLOB))
+	{
+	   *CmpCommon::diags() << DgSqlCode(-4322);
+	   GenExit();
+	}
+    }
   // Now, remove all attributes from the map table except the 
   // the stuff in the local map table -- the result of this node.
   //

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/02cf1145/core/sql/optimizer/BindRelExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindRelExpr.cpp b/core/sql/optimizer/BindRelExpr.cpp
index 26cf345..662e789 100644
--- a/core/sql/optimizer/BindRelExpr.cpp
+++ b/core/sql/optimizer/BindRelExpr.cpp
@@ -7469,14 +7469,7 @@ RelExpr *Scan::bindNode(BindWA *bindWA)
      bindWA->setErrStatus();
      return NULL;
   }
-  if (naTable->hasLobColumn() && isSampleScan())
-    {
-      *CmpCommon::diags() << DgSqlCode(-4322)
-       << DgTableName(
-           naTable->getTableName().getQualifiedNameAsAnsiString());
-     bindWA->setErrStatus();
-     return NULL;
-    }
+ 
   // restricted partitions for HBase table
   if (naTable->isHbaseTable() &&
       (naTable->isPartitionNameSpecified() ||
@@ -14073,7 +14066,7 @@ RelExpr *Transpose::bindNode(BindWA *bindWA)
   for (i = 0; i < resultTable->getDegree(); i++)
     {
       if ((resultTable->getType(i)).getFSDatatype() == REC_BLOB || 
-	  (resultTable->getType(i)).getFSDatatype() == REC_BLOB)
+	  (resultTable->getType(i)).getFSDatatype() == REC_CLOB)
 	{
 	  *CmpCommon::diags() << DgSqlCode(-4322);
 	  bindWA->setErrStatus();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/02cf1145/core/sql/optimizer/RelSample.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/RelSample.cpp b/core/sql/optimizer/RelSample.cpp
index d3c4170..56d88b8 100644
--- a/core/sql/optimizer/RelSample.cpp
+++ b/core/sql/optimizer/RelSample.cpp
@@ -1064,16 +1064,7 @@ RelExpr *RelSample::bindNode(BindWA *bindWA)
       childTable.getHeading(i));
     sampledColumns() += newColumn->getValueId();
   }
-  for (i = 0; i < resultTable->getDegree(); i++)
-    {
-      if ((resultTable->getType(i)).getFSDatatype() == REC_BLOB || 
-	  (resultTable->getType(i)).getFSDatatype() == REC_BLOB)
-	{
-	  *CmpCommon::diags() << DgSqlCode(-4322);
-	  bindWA->setErrStatus();
-	  return this;
-	}
-    }
+  
   // Set the return descriptor
   //
   setRETDesc(resultTable);