sujith71955 commented on a change in pull request #24558: [SPARK-27617][SQL] 
Support creating managed table on user specified location
URL: https://github.com/apache/spark/pull/24558#discussion_r282457452
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
 ##########
 @@ -988,9 +988,10 @@ class SparkSqlAstBuilder(conf: SQLConf) extends 
AstBuilder(conf) {
       serde = 
rowStorage.serde.orElse(fileStorage.serde).orElse(defaultStorage.serde),
       compressed = false,
       properties = rowStorage.properties ++ fileStorage.properties)
-    // If location is defined, we'll assume this is an external table.
-    // Otherwise, we may accidentally delete existing data.
-    val tableType = if (external || location.isDefined) {
+    // If external is defined, we'll assume this is an external table.
+    // Otherwise, we may consider it as managed table where the data
+    // will be deleted on drop table command.
+    val tableType = if (external) {
 
 Review comment:
   yeah i got the point, also this will make sure we wont delete user data, 
actually this point has come up because we got some usecases where customer 
facing issue in migrating the hive jobs to spark because of this behaviourial 
difference. they dont want to manage table :)

----------------------------------------------------------------
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]

Reply via email to