[ 
https://issues.apache.org/jira/browse/PHOENIX-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15057283#comment-15057283
 ] 

ramkrishna.s.vasudevan commented on PHOENIX-1312:
-------------------------------------------------

[[email protected]]
I understand where the actual projection happens and that is where I have tried 
not to project the default CF. Atleast in the eg given in the desc
{code}
if (projector.isProjectEmptyKeyValue()) {
                // If nothing projected into scan and we only have one column 
family, just allow everything
                // to be projected and use a FirstKeyOnlyFilter to skip from 
row to row. This turns out to
                // be quite a bit faster.
                // Where condition columns also will get added into familyMap
                // When where conditions are present, we can not add 
FirstKeyOnlyFilter at beginning.
                if (familyMap.isEmpty() && 
context.getWhereCoditionColumns().isEmpty()
                        && table.getColumnFamilies().size() == 1) {
                    // Project the one column family. We must project a column 
family since it's possible
                    // that there are other non declared column families that 
we need to ignore.
                    
scan.addFamily(table.getColumnFamilies().get(0).getName().getBytes());
                } else {
                    byte[] ecf = SchemaUtil.getEmptyColumnFamily(table);
                    // Project empty key value unless the column family 
containing it has
                    // been projected in its entirety.
                    // TODO: Only project empty column family when necessary
                    if (!familyMap.containsKey(ecf) || familyMap.get(ecf) != 
null) {
                        scan.addColumn(ecf, QueryConstants.EMPTY_COLUMN_BYTES);
                    }
                }
{code} 
The else part is where the default CF was added.  Now I have tried to avoid 
that. In this part of code we don't get directly get the where expression and 
whether requiresFinalEvaluation is true or not. 

> Do not always project the empty column family
> ---------------------------------------------
>
>                 Key: PHOENIX-1312
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1312
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: ramkrishna.s.vasudevan
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-1312_1.patch, Phoenix-1312.patch
>
>
> Often times, we don't need to, but it seems we always are. See 
> MultiCfQueryExecIT.testGuidePostsForMultiCFs() where we run a query like this:
> {code}
> SELECT count(*) FROM multi_cf WHERE e.cpu_utilization IS NOT NULL
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to