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

Hadoop QA commented on PHOENIX-2746:
------------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12793297/PHOENIX-2746.patch
  against master branch at commit 5d33fba633bdc5b2cbc31fa1736f56dce1e17ac6.
  ATTACHMENT ID: 12793297

    {color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include 
any new or modified tests.
                        Please justify why no new tests are needed for this 
patch.
                        Also please list what manual steps were performed to 
verify this patch.

    {color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

    {color:red}-1 javadoc{color}.  The javadoc tool appears to have generated 
20 warning messages.

    {color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

    {color:red}-1 lineLengths{color}.  The patch introduces the following lines 
longer than 100:
    +            stm.execute("CREATE " + (localIndex ? "LOCAL" : "") + " INDEX 
web_stats_idx2 ON web_stats (DATE, FEATURE, USAGE.DB)");
+            stm.execute("CREATE " + (localIndex ? "LOCAL" : "") + " INDEX 
web_stats_idx ON web_stats (USAGE.DB)");
+            stm.execute("CREATE " + (localIndex ? "LOCAL" : "") + " INDEX 
web_stats_idx2 ON web_stats (USAGE.DB, DATE)");
+            Map<PTableKey, PTable> nonDisabledIndexes = new HashMap<PTableKey, 
PTable>(table.getIndexes().size());
+                        ? optimizer.getApplicablePlans(dataPlanToBe, 
statement, select, resolverToBe, Collections.<PColumn>emptyList(), 
parallelIteratorFactory, true)
+                final DeletingParallelIteratorFactory parallelIteratorFactory2 
= parallelIteratorFactory;
+                                    
parallelIteratorFactory2.setIndexTargetTableRef(deleteFromImmutableIndexToo ? 
plan.getTableRef() : null);
+        List<QueryPlan>plans = getApplicablePlans(dataPlan, statement, 
targetColumns, parallelIteratorFactory, true, false);
+        return getApplicablePlans(dataPlan, statement, targetColumns, 
parallelIteratorFactory, true, false);
+    public List<QueryPlan> getApplicablePlans(QueryPlan dataPlan, 
PhoenixStatement statement, SelectStatement select, ColumnResolver resolver, 
List<? extends PDatum> targetColumns, ParallelIteratorFactory 
parallelIteratorFactory, boolean chooseAllPlans) throws SQLException {

    {color:green}+1 core tests{color}.  The patch passed unit tests in .

Test results: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/272//testReport/
Javadoc warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/272//artifact/patchprocess/patchJavadocWarnings.txt
Console output: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/272//console

This message is automatically generated.

> Delete on the table with immutable rows may fail with 
> INVALID_FILTER_ON_IMMUTABLE_ROWS error code.
> --------------------------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2746
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2746
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>             Fix For: 4.8.0
>
>         Attachments: PHOENIX-2746.patch
>
>
> Some times delete on table with immutable rows is failing with below error 
> even all the indexes are having the column in where condition. If we have 
> condition on primary key columns it's always failing.
> {noformat}
> 0: jdbc:phoenix:localhost> delete from t2 where a='raj1';
> Error: ERROR 1027 (42Y86): All columns referenced in a WHERE clause must be 
> available in every index for a table with immutable rows. tableName=T2 
> (state=42Y86,code=1027)
> java.sql.SQLException: ERROR 1027 (42Y86): All columns referenced in a WHERE 
> clause must be available in every index for a table with immutable rows. 
> tableName=T2
>       at 
> org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:386)
>       at 
> org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
>       at 
> org.apache.phoenix.compile.DeleteCompiler.compile(DeleteCompiler.java:390)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:546)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableDeleteStatement.compilePlan(PhoenixStatement.java:534)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:302)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:295)
>       at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:293)
>       at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1247)
>       at sqlline.Commands.execute(Commands.java:822)
>       at sqlline.Commands.sql(Commands.java:732)
>       at sqlline.SqlLine.dispatch(SqlLine.java:808)
>       at sqlline.SqlLine.begin(SqlLine.java:681)
>       at sqlline.SqlLine.start(SqlLine.java:398)
>       at sqlline.SqlLine.main(SqlLine.java:292
> {noformat}
> The reason is we are collecting nondisable indexes and adding to list. 
> 1) Once after resolving the table data table.
> 2) One after running select with where condition from delete. 
> So the references of index table objects will be different two times if cache 
> updated again 2nd time.
> {noformat}
>                 immutableIndex = getNonDisabledImmutableIndexes(tableRefToBe);
> {noformat}
> So here when remove a table from immutableIndex list we should compare 
> references because PTable doesn't have equal or hashCode implementations 
> which will not remove any index from the list and we throw SQLException.
> {noformat}
>             while (plans.hasNext()) {
>                 QueryPlan plan = plans.next();
>                 PTable table = plan.getTableRef().getTable();
>                 if (table.getType() == PTableType.INDEX) { // index plans
>                     tableRefs[i++] = plan.getTableRef();
>                     immutableIndex.remove(table);
>                 } else { // data plan
>                     /*
>                      * If we have immutable indexes that we need to maintain, 
> don't execute the data plan
>                      * as we can save a query by piggy-backing on any of the 
> other index queries, since the
>                      * PK columns that we need are always in each index row.
>                      */
>                     plans.remove();
>                 }
> {noformat}
> If the where condition is PK column then the plans returned by compiler is 
> only one because we are passing USE_DATA_OVER_INDEX_TABLE hint. Then also the 
> immutableIndex list is not empty. Then also we through exception.
> {noformat}
>                 noQueryReqd = !hasLimit;
>                 // Can't run on same server for transactional data, as we 
> need the row keys for the data
>                 // that is being upserted for conflict detection purposes.
>                 runOnServer = isAutoCommit && noQueryReqd && 
> !table.isTransactional();
>                 HintNode hint = delete.getHint();
>                 if (runOnServer && 
> !delete.getHint().hasHint(Hint.USE_INDEX_OVER_DATA_TABLE)) {
>                     hint = HintNode.create(hint, 
> Hint.USE_DATA_OVER_INDEX_TABLE);
>                 }
> {noformat}



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

Reply via email to