[
https://issues.apache.org/jira/browse/PHOENIX-4212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170328#comment-16170328
]
James Taylor edited comment on PHOENIX-4212 at 9/18/17 5:42 PM:
----------------------------------------------------------------
[~aertoria] - I should have looked at this a little closer. You should keep the
test as parameterized instead of duplicating all the tests. For the check of
the query plan, instead of having that in the parameterized data, you can
change those to just test which table is being used so that you don't have to
do a string comparison of the entire explain plan. Here's how you get that:
{code}
String tableNameUsedInQuery =
statement.unwrap(PhoenixStatement.class).getLastPlan().getContext().getCurrentTable().getTable().getName().getString();
{code}
If we still need to store something in the parameterized data, you could just
store a boolean on whether or not the index is used. Then, based on that, you
could test using the above statement to assert if the right table is being used.
was (Author: jamestaylor):
[~aertoria] - I should have looked at this a little closer. You should keep the
test as parameterized instead of duplicating all the tests. For the check of
the query plan, instead of having that in the parameterized data, you can
change those to just test which table is being used so that you don't have to
do a string comparison of the entire explain plan. Here's how you get that:
{code}
String tableNameUsedInQuery =
statement.unwrap(PhoenixStatement.class).getLastPlan().getContext().getCurrentTable().getTable().getName().getString();
{code}
> Disallow DML operations on connections with CURRENT_SCN set - DerivedTableIT
> ----------------------------------------------------------------------------
>
> Key: PHOENIX-4212
> URL: https://issues.apache.org/jira/browse/PHOENIX-4212
> Project: Phoenix
> Issue Type: Bug
> Reporter: Ethan Wang
> Assignee: Ethan Wang
> Fix For: 4.12.0
>
> Attachments: PHOENIX-4212.patch, PHOENIX-4212_v2.patch
>
>
> Disallow DML operations on connections with CURRENT_SCN set - DerivedTableIT
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)