-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-28892][SQL][followup] add resolved logical plan for UPDATE TABLE #26025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.sql.catalyst.plans.logical | ||
|
|
||
| import org.apache.spark.sql.catalyst.expressions.Expression | ||
|
|
||
| case class DeleteFromTable( | ||
| table: LogicalPlan, | ||
| condition: Option[Expression]) extends Command with SupportsSubquery { | ||
| override def children: Seq[LogicalPlan] = table :: Nil | ||
| } | ||
|
|
||
| case class UpdateTable( | ||
| table: LogicalPlan, | ||
| columns: Seq[Expression], | ||
| values: Seq[Expression], | ||
| condition: Option[Expression]) extends Command with SupportsSubquery { | ||
| override def children: Seq[LogicalPlan] = table :: Nil | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -532,7 +532,7 @@ class AnalysisErrorSuite extends AnalysisTest { | |
| Seq(a, Alias(InSubquery(Seq(a), ListQuery(LocalRelation(b))), "c")()), | ||
| LocalRelation(a)) | ||
| assertAnalysisError(plan, "Predicate sub-queries can only be used" + | ||
| " in Filter/DeleteFromTable" :: Nil) | ||
| " in Filter" :: Nil) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why there isn't the new
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, got it. |
||
| } | ||
|
|
||
| test("PredicateSubQuery is used is a nested condition") { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So are we extracting some of DDL relative plans in this
commands.scala? But there're still other commands inbasicLogicalOperators.scala. What's the relation of the two?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to put all the DDL/DML commands in this file, starting with DELETE/UPDATE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, let me do it together in an individual PR.