You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/08 08:05:46 UTC
[GitHub] [iceberg] hililiwei commented on a diff in pull request #5281: Spark: Spark SQL Extensions for tag
hililiwei commented on code in PR #5281:
URL: https://github.com/apache/iceberg/pull/5281#discussion_r927520624
##########
spark/v3.3/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/IcebergSqlExtensionsAstBuilder.scala:
##########
@@ -79,6 +84,51 @@ class IcebergSqlExtensionsAstBuilder(delegate: ParserInterface) extends IcebergS
Option(ctx.name).map(_.getText))
}
+ /**
+ * Create an CREATE TAG logical command.
+ */
+ override def visitCreateTag(ctx: CreateTagContext): CreateTag = withOrigin(ctx) {
+ CreateTag(
+ typedVisit[Seq[String]](ctx.multipartIdentifier),
+ ctx.identifier().getText,
+ Option(ctx.snapshotId()).map(_.getText.toLong),
+ Option(ctx.snapshotRefRetain()).map(_.getText.toLong * timeUnit(ctx.snapshotRefRetainTimeUnit().getText))
+ )
+ }
+
+ /**
+ * Create an REPLACE TAG logical command.
+ */
+ override def visitReplaceTag(ctx: ReplaceTagContext): ReplaceTag = withOrigin(ctx) {
+ ReplaceTag(
+ typedVisit[Seq[String]](ctx.multipartIdentifier),
+ ctx.identifier().getText,
+ Option(ctx.snapshotId()).map(_.getText.toLong),
+ Option(ctx.snapshotRefRetain()).map(_.getText.toLong * timeUnit(ctx.snapshotRefRetainTimeUnit().getText))
+ )
+ }
+
+ /**
+ * Create an REMOVE TAG logical command.
+ */
+ override def visitRemoveTag(ctx: RemoveTagContext): RemoveTag = withOrigin(ctx) {
+ RemoveTag(
+ typedVisit[Seq[String]](ctx.multipartIdentifier),
+ ctx.identifier().getText
+ )
+ }
+
+ /**
+ * Create an ALTER TAG RETENTION logical command.
+ */
+ override def visitAlterTagRetention(ctx: AlterTagRetentionContext): AlterTagRefRetention = withOrigin(ctx) {
+ AlterTagRefRetention(
+ typedVisit[Seq[String]](ctx.multipartIdentifier()),
Review Comment:
I caused it to pass when I used a space to create branch.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org