zzzzming95 commented on PR #38356:
URL: https://github.com/apache/spark/pull/38356#issuecomment-1301649899

   > @allisonwang-db can you elaborate on mapping `write.requiredOrdering` to 
the projected columns via `attrMap` that you introduced in 
[f98f9f8](https://github.com/apache/spark/commit/f98f9f8566243a8a01edcaad3b847bbd2f52305b)?
 Was that existing code moved into `V1Writes`, or was that logic added.
   > 
   > 
https://github.com/apache/spark/blob/ff66adda3ca3762b8c71b14acbd6da00c5508a2e/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/V1Writes.scala#L81-L84
   
   
   
   > @allisonwang-db can you elaborate on mapping `write.requiredOrdering` to 
the projected columns via `attrMap` that you introduced in 
[f98f9f8](https://github.com/apache/spark/commit/f98f9f8566243a8a01edcaad3b847bbd2f52305b)?
 Was that existing code moved into `V1Writes`, or was that logic added.
   > 
   > 
https://github.com/apache/spark/blob/ff66adda3ca3762b8c71b14acbd6da00c5508a2e/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/V1Writes.scala#L81-L84
   
   
   In this case ,this code will take effect
   
   ```
       val df1 = Seq((20, "partition"), (15, "partition"), (30, "partition"), 
(18, "partition"))
         .toDF("id", "P")
         .repartition(1)
         .sortWithinPartitions("p", "id")    // lowercase p
         df1.write
         .partitionBy("p")   //lowercase p
         .csv("file:///Users/shezhiming/tmp/csv_data/sort_path7/")
   ```
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to