rdblue commented on a change in pull request #24029: [SPARK-27108][SQL] Add parsed SQL plans for create, CTAS. URL: https://github.com/apache/spark/pull/24029#discussion_r267820672
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/sql/CreateTable.scala ########## @@ -0,0 +1,66 @@ +/* + * 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.sql + +import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.catalog.BucketSpec +import org.apache.spark.sql.catalyst.expressions.Attribute +import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.types.StructType + +/** + * A CREATE TABLE command, as parsed from SQL. + * + * This is a metadata-only command and is not used to write data to the created table. + */ +case class CreateTable( Review comment: I'm like using packages to differentiate between the plans. The rules use `sql.CreateTable` and I think that is clear. I'd also like to avoid renaming the v1 classes to include `V1` in their names. That's going to create a lot of conflicts when working with branches and it's hard enough to maintain PRs already given the amount of needless renaming, whitespace changes, and import changes happening. Similarly, I want to avoid adding `V2` to class names because we eventually want to remove the old packages and support. Then we would be left with a lot of v2 class names, or we would have to refactor to rename. Using packages as qualifiers is well supported in Scala, so I like to use that for this. But, that point is more about managing v1 and v2 plans, not the parsed plans. If there's consensus around renaming to `ParsedCreateTable` and `ParsedCreateTableAsSelect`, we can do that. Or, I can rename the `sql` package to `parsed`. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
