gruuya commented on issue #7292:
URL: 
https://github.com/apache/arrow-datafusion/issues/7292#issuecomment-1680243496

   > Over at DataFusion side, besides capturing the parsed version in the 
TableScan logical plan
   
   Actually, looking at this a bit more in-depth, `TableScan` would not need to 
be changed. Instead prior to creating that node we'd need to parse the table 
version during table reference resolution (`resolve_table_references`) inside 
`statement_to_plan`, which would in turn mean extending the sqlparser `Visitor` 
to go through `TableFactor`s.
   
   Then, while pre-populating the table providers for the referenced tables in 
the `SessionContextProvider`, we'd register the `TableProvider` for the 
specific table version provided. This also means that `SessionContextProvider` 
would need to track both the table name and the version too, since a given 
query could involve multiple versions of the same table, so something like
   ```rust
   struct SessionContextProvider<'a> {
       state: &'a SessionState,
       tables: HashMap<(String, Option<TableVersion>), Arc<dyn TableSource>>,
   }
   ```


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