Help Center> MapReduce Service> Developer Guide (3.x)> Spark2x Development Guide (Normal Mode)> More Information> FAQ> Change of the Replica Policy After the CTAS Statement Is Executed on Spark SQL for a Directory

Change of the Replica Policy After the CTAS Statement Is Executed on Spark SQL for a Directory

Question

The EC policy is configured for an existing directory on HDFS. After the create table *** options (path= '**') as select *** statement is executed on Spark SQL to create tables in the directory and import data, the replica policy of the directory changes. Why?

Answer

During statement execution on Spark, the original data is overwritten and the original directory is deleted and recreated according to the processing logic. The replica policy of the directory is the same as that of the upper-layer directory by default. Therefore, if the replica policy of the original directory is inconsistent with that of the upper-layer directory, the replica policy of the directory changes.