blackflash997997 opened a new issue, #8779:
URL: https://github.com/apache/paimon/issues/8779

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   Currently, when querying a Paimon chain table table (e.g., time-series data 
partitioned by dt), if the queried partition does not exist, the query returns 
empty results. This is the default behavior.
   
   In some scenarios , users expect the query to transparently fall back to the 
nearest previous existing partition rather than returning empty data. 
   
   ### Solution
   
   1.If the queried partition does not exist in the table
   2.The system automatically finds the nearest previous partition (the largest 
partition value that is smaller than the queried one)
   3.Returns data from that partition instead of empty results
   
   ## example
   Table partitions: [2024-07-01, 2024-07-02, 2024-07-05]
   snapshot paritions : [2024-07-01]
   delta partitionss : [2024-07-02, 2024-07-05]
   
   
   Query1 :
    `SELECT * FROM table WHERE dt = '2024-07-04'`
   Current behavior: returns empty
   With feature enabled: returns data from dt = '2024-07-02' , and the value of 
dt column replaced with 2024-07-04
   
   Query2 :
    `SELECT * FROM table WHERE dt = '2024-07-10'`
   Current behavior: returns empty
   With feature enabled: returns data from dt = '2024-07-10' , and the value of 
dt column replaced with 2024-07-10
   
   only work for query like :  `partition column` = 'some value'
   not work for query like :  `partition column` <='some value' or  `partition 
column`  in ('some value')
   
   ### Anything else?
   
    I would like to ask whether this feature is considered reasonable from the 
project's design perspective. If the maintainers agree that this is a valuable 
addition and the proposed approach is acceptable, I have already implemented 
the core logic locally and am ready to clean up the code and submit a PR.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


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