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

ASF GitHub Bot commented on PHOENIX-7014:
-----------------------------------------

haridsv opened a new pull request, #1766:
URL: https://github.com/apache/phoenix/pull/1766

   This PR replaces #1738 to include some experimental scanner changes for 
PHOENIX-7015.
    
   This has the changes needed for PHOENIX-7014. It short-circuits the existing 
optimizer logic to produce a plan that is suitable for CDC queries. It also 
reimplements the query hints so that it is simpler and easier to maintain using 
regex. It includes a PoC query test and some debug test cases for short term 
reference (can be removed before merging to master). Currently `select *` works 
but if you specify column names, you get an `IndexOutOfBoundsException` that I 
will look into later.
   
   This PR also goes one step further to generating a mock JSON string (PoC in 
#1738) to be able to generate results from the actual data (though, not per the 
expected format). I temporary added Gson as a dependency to generate the 
result, but this will be replaced with BSON once the JSON support is available. 
Here is a quick demo of how this works:
   
   ```
   0: jdbc:phoenix:localhost> create table t (k INTEGER PRIMARY KEY, v1 
INTEGER);
   No rows affected (0.651 seconds)
   0: jdbc:phoenix:localhost> upsert into t (k, v1) VALUES (1, 100);
   1 row affected (0.067 seconds)
   0: jdbc:phoenix:localhost> upsert into t (k, v1) VALUES (2, 200);
   1 row affected (0.067 seconds)
   0: jdbc:phoenix:localhost> upsert into t (k, v1) VALUES (1, 101);
   1 row affected (0.067 seconds)
   0: jdbc:phoenix:localhost> create cdc tchanges  on 
t(PHOENIX_ROW_TIMESTAMP());
   2 rows affected (5.686 seconds)
   0: jdbc:phoenix:localhost> select * from tchanges;
   +--------------------------+---+------------+
   |  PHOENIX_ROW_TIMESTAMP() | K |  CDC JSON  |
   +--------------------------+---+------------+
   | 2023-12-06               | 1 | {"V1":100} |
   | 2023-12-06               | 2 | {"V1":200} |
   | 2023-12-06               | 1 | {"V1":101} |
   +--------------------------+---+------------+
   3 rows selected (0.022 seconds
   ```
   
   




> CDC query complier and optimizer
> --------------------------------
>
>                 Key: PHOENIX-7014
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7014
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Viraj Jasani
>            Assignee: Hari Krishna Dara
>            Priority: Major
>
> For CDC table type, the query optimizer should be able to query from the 
> uncovered global index table with data table associated with the given CDC 
> table.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to