yihua opened a new issue, #20826:
URL: https://github.com/apache/hudi/issues/20826
With the Hudi session extension enabled, `VERSION AS OF` and `TIMESTAMP AS
OF` fail on any table that is not a Hudi table, even when that table supports
time travel. For example, with `spark.sql.catalog.testcat` set to Spark's
`org.apache.spark.sql.connector.catalog.InMemoryTableCatalog`:
```sql
SELECT * FROM testcat.ns.t VERSION AS OF 'v1';
```
```
[INVALID_USAGE_OF_STAR_OR_REGEX] Invalid usage of '*' in Project.
'Project [*]
+- 'TimeTravelRelation v1
+- SubqueryAlias testcat.ns.t
+- RelationV2[id#19] testcat.ns.t
```
`HoodieCommonSqlParser.convertNativeTimeTravel` rewrites every Spark
`RelationTimeTravel` into Hudi's `TimeTravelRelation`, and `ResolveReferences`
in `HoodieSparkBaseAnalysis` only resolves that node when the relation is a
Hudi table. For any other table the node is left unresolved, so the query fails
instead of reaching Spark's own time travel.
Proposal: keep the parsed relation on `TimeTravelRelation` and turn the node
back into Spark's `RelationTimeTravel` during analysis when the relation does
not resolve to a Hudi table.
--
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]