Github user nonstop-qfchen commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/255#discussion_r49476810
--- Diff: core/sql/generator/GenPreCode.cpp ---
@@ -11337,6 +11816,38 @@ RelExpr * HbaseAccess::preCodeGen(Generator *
generator,
if (! FileScan::preCodeGen(generator,externalInputs,pulledNewInputs))
return NULL;
+ //compute isUnique:
+ NABoolean isUnique = FALSE;
+ if (listOfRangeRows_.entries() == 0)
+ {
+ if ((searchKey() && searchKey()->isUnique()) &&
+ (listOfUniqueRows_.entries() == 0))
+ isUnique = TRUE;
+ else if ((NOT (searchKey() && searchKey()->isUnique())) &&
+ (listOfUniqueRows_.entries() == 1) &&
+ (listOfUniqueRows_[0].rowIds_.entries() == 1))
+ isUnique = TRUE;
+ }
+
+ // executorPred() contains an ANDed list of predicates.
+ // if hbase filter preds are enabled, then extracts those preds from
executorPred()
+ // which could be pushed down to hbase.
+ // Do this only for non-unique scan access.
+ ValueIdSet newExePreds;
+ ValueIdSet* originExePreds = new
(generator->wHeap())ValueIdSet(executorPred()) ;//saved for futur nullable
column check
+
+ if (CmpCommon::getDefault(HBASE_FILTER_PREDS) != DF_MINIMUM){ // the
check for V2 and above is moved up before calculating retrieved columns
+ if ((NOT isUnique) &&
--- End diff --
The computation on isUnique can be avoided if it is not for V2 push-down.
Suggest to move the CQD check earlier.
---
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.
---