You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Maryann Xue (JIRA)" <ji...@apache.org> on 2017/01/09 19:44:58 UTC

[jira] [Created] (PHOENIX-3581) Class-cast exceptions caused by TestUtil.getSplits() and TestUtil.getGuidePostsList()

Maryann Xue created PHOENIX-3581:
------------------------------------

             Summary: Class-cast exceptions caused by TestUtil.getSplits() and TestUtil.getGuidePostsList()
                 Key: PHOENIX-3581
                 URL: https://issues.apache.org/jira/browse/PHOENIX-3581
             Project: Phoenix
          Issue Type: Bug
            Reporter: Maryann Xue
            Assignee: Maryann Xue
            Priority: Minor


These test utility methods are trying to convert a PrepareStatement object initiated by the current JDBC Connection into a PhoenixPreparedStatement. While we have switched to Calcite-Phoenix connections for tests, the PreparedStatement created by the connection will no longer be a PhoenixPreparedStatement object, so we need to get the original PhoenixConnection object for such util methods.
{code}
        String query = "SELECT /*+ NO_INDEX */ COUNT(*) FROM " + tableName + whereClause;
        PhoenixPreparedStatement pstmt = conn.prepareStatement(query).unwrap(PhoenixPreparedStatement.class);
{code}



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