cloud-fan commented on a change in pull request #34497:
URL: https://github.com/apache/spark/pull/34497#discussion_r749368543
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
##########
@@ -1250,7 +1252,21 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with
SQLConfHelper with Logg
*/
override def visitTableName(ctx: TableNameContext): LogicalPlan =
withOrigin(ctx) {
val tableId = visitMultipartIdentifier(ctx.multipartIdentifier)
- val table = mayApplyAliasPlan(ctx.tableAlias, UnresolvedRelation(tableId))
+ val properties = new util.HashMap[String, String]
+ val timeTravel = if (ctx.temporalClause != null &&
ctx.temporalClause.version != null) {
+ TimeTravelSpec.create(None, Some(ctx.temporalClause.version.getText))
+ } else if (ctx.temporalClause != null && ctx.temporalClause.timestamp !=
null) {
+ val tsWithQuotation = ctx.temporalClause.timestamp.getText
+ val ts = tsWithQuotation.substring(1, tsWithQuotation.length - 1)
+ TimeTravelSpec.create(Some(ts), None)
+ } else {
+ None
+ }
Review comment:
```suggestion
val timeTravel = if (ctx.temporalClause != null) {
TimeTravelSpec.create(
Option(ctx.temporalClause.timestamp).map(string),
Option(ctx.temporalClause.version).map(_.getText)))
} else {
None
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]