You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/02/04 03:43:39 UTC

[jira] [Updated] (PHOENIX-2647) Duplicate results in reverse scan when guideposts are traversed

     [ https://issues.apache.org/jira/browse/PHOENIX-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Taylor updated PHOENIX-2647:
----------------------------------
    Summary: Duplicate results in reverse scan when guideposts are traversed  (was: Duplicate results in reverse scan after running "update statistics")

> Duplicate results in reverse scan when guideposts are traversed
> ---------------------------------------------------------------
>
>                 Key: PHOENIX-2647
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2647
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.4.0
>            Reporter: Maryann Xue
>            Assignee: Samarth Jain
>             Fix For: 4.7.0
>
>
> This problem seems to only occur with reverse scan not forward scan. Adding the below tests and settings in OrderByIT can reproduce the issue. I ended up getting two rows of "ROW7" instead of one.
> {code}
>     
>     @BeforeClass
>     public static void doSetup() throws Exception {
>         Map<String,String> props = getDefaultProps();
>         props.put(QueryServices.RUN_UPDATE_STATS_ASYNC, Boolean.FALSE.toString());
>         props.put(QueryServices.COMMIT_STATS_ASYNC, Boolean.FALSE.toString());
>         props.put(QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, Long.toString(1000));
>         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
>     }
>     @Test
>     public void testReverseScan() throws Exception {
>         long ts = nextTimestamp();
>         String tenantId = getOrganizationId();
>         initATableValues(tenantId, getDefaultSplits(tenantId), null, ts);
>         String query = "SELECT entity_id FROM aTable ORDER BY organization_id desc";
>         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
>         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 2)); // Execute at timestamp 2
>         Connection conn = DriverManager.getConnection(getUrl(), props);
>         conn.createStatement().execute("UPDATE STATISTICS ATABLE");
>         conn.commit();
>         conn.close();
>         props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); // Execute at timestamp 2
>         conn = DriverManager.getConnection(getUrl(), props);
>         try {
>             PreparedStatement statement = conn.prepareStatement(query);
>             ResultSet rs = statement.executeQuery();
>             assertTrue (rs.next());
>             assertEquals(ROW9,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW8,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW7,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW6,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW5,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW4,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW3,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW2,rs.getString(1));
>             assertTrue (rs.next());
>             assertEquals(ROW1,rs.getString(1));
>             assertFalse(rs.next());
>         } finally {
>             conn.close();
>         }
>     }
> {code}



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