Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/16626#discussion_r97191445 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala --- @@ -814,4 +814,28 @@ object DDLUtils { } } } + + /** + * ALTER TABLE ADD COLUMNS command does not support temporary view/table, + * view, or datasource table yet. + */ + def verifyAlterTableAddColumn( + catalog: SessionCatalog, + table: TableIdentifier): CatalogTable = { + if (catalog.isTemporaryTable(table)) { + throw new AnalysisException( + s"${table.toString} is a temporary VIEW, which does not support ALTER ADD COLUMNS.") + } + + val catalogTable = catalog.getTableMetadata(table) + if (catalogTable.tableType == CatalogTableType.VIEW) { + throw new AnalysisException( + s"${table.toString} is a VIEW, which does not support ALTER ADD COLUMNS.") + } + if (isDatasourceTable(catalogTable)) { --- End diff -- Currently, their code paths for managing hive serde tables and data source tables have been combined. Thus, it can be easily handled together.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org