cloud-fan commented on a change in pull request #30554:
URL: https://github.com/apache/spark/pull/30554#discussion_r533612785
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveSessionCatalog.scala
##########
@@ -657,14 +659,8 @@ class ResolveSessionCatalog(
comment: Option[String],
storageFormat: CatalogStorageFormat,
external: Boolean): CatalogTable = {
- if (external) {
- if (DDLUtils.isHiveTable(Some(provider))) {
- if (location.isEmpty) {
- throw new AnalysisException(s"CREATE EXTERNAL TABLE must be
accompanied by LOCATION")
- }
- } else {
- throw new AnalysisException(s"Operation not allowed: CREATE EXTERNAL
TABLE ... USING")
- }
+ if (external && location.isEmpty) {
+ throw new AnalysisException(s"CREATE EXTERNAL TABLE must be accompanied
by LOCATION")
Review comment:
Please correct me if I read the code wrongly. Previously Spark fails
when EXTERNAL is specified and the following two conditions are met:
1. it's a hive table and LOCATION is not specified.
2. it's a data source table.
That said, we had a big restriction before that EXTERNAL is forbidden
completely for data source tables, no matter LOCATION is present or not. Now my
change allows it if LOCATION is present.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]