jinhai created SPARK-33478:
------------------------------

             Summary: Allow overwrite a path that is also being read under 
dynamic partition overwrite
                 Key: SPARK-33478
                 URL: https://issues.apache.org/jira/browse/SPARK-33478
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.0.1, 3.0.0
            Reporter: jinhai


Currently, Insert overwrite cannot overwrite a path that is also being read 
under dynamic partition overwrite. 
In the class DataSourceAnalysis, DDLUtils.verifyNotReadPath is called to 
determine whether it can be overwrite, but in the 
InsertIntoHadoopFsRelationCommand.dynamicPartitionOverwrite method, we need to 
consider the scenario where staticPartitions.size equals 
partitionColumns.length, which should also be allowed to overwrite path this is 
also being read.

Consider the following statement:

CREATE TABLE insertTable(i int, part1 int, part2 int) USING PARQUET PARTITIONED 
BY (part1, part2);

INSERT OVERWRITE TABLE insertTable PARTITION(part1=1, part2=1) SELECT i + 1 
FROM insertTable;



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to