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
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to