phoenix5-spark/src/main/java/org/apache/phoenix/spark/datasource/v2/reader/PhoenixInputPartitionReader.java [100:125]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        try (Connection conn = DriverManager.getConnection(
                JDBC_PROTOCOL + JDBC_PROTOCOL_SEPARATOR + zkUrl, overridingProps)) {
            PTable pTable = null;
            try {
                pTable = PTable.parseFrom(options.getPTableCacheBytes());
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException("Parsing the PTable Cache Bytes is failing ", e);
            }
            org.apache.phoenix.schema.PTable table = PTableImpl.createFromProto(pTable);
            PhoenixConnection phoenixConnection = conn.unwrap(PhoenixConnection.class);
            phoenixConnection.addTable(table, System.currentTimeMillis());
            final Statement statement = conn.createStatement();
            final String selectStatement = options.getSelectStatement();
            if (selectStatement == null){
                throw new NullPointerException();
            }

            final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class);
            // Optimize the query plan so that we potentially use secondary indexes
            return pstmt.optimizeQuery(selectStatement);
        }
    }

    private void initialize() {
        try {
            final QueryPlan queryPlan = getQueryPlan();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



phoenix5-spark3/src/main/java/org/apache/phoenix/spark/sql/connector/reader/PhoenixPartitionReader.java [87:112]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        try (Connection conn = DriverManager.getConnection(
                JDBC_PROTOCOL + JDBC_PROTOCOL_SEPARATOR + zkUrl, overridingProps)) {
            PTable pTable = null;
            try {
                pTable = PTable.parseFrom(options.getPTableCacheBytes());
            } catch (InvalidProtocolBufferException e) {
                throw new RuntimeException("Parsing the PTable Cache Bytes is failing ", e);
            }
            org.apache.phoenix.schema.PTable table = PTableImpl.createFromProto(pTable);
            PhoenixConnection phoenixConnection = conn.unwrap(PhoenixConnection.class);
            phoenixConnection.addTable(table, System.currentTimeMillis());
            final Statement statement = conn.createStatement();
            final String selectStatement = options.getSelectStatement();
            if (selectStatement == null){
                throw new NullPointerException();
            }

            final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class);
            // Optimize the query plan so that we potentially use secondary indexes
            return pstmt.optimizeQuery(selectStatement);
        }
    }

    private void initialize() {
        try {
            final QueryPlan queryPlan = getQueryPlan();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



