zhuqi-lucas opened a new pull request, #13874:
URL: https://github.com/apache/datafusion/pull/13874

   ## Which issue does this PR close?
   
   Closes [#13873](https://github.com/apache/datafusion/issues/13873)
   
   ## Rationale for this change
   ```rust
   DataFrameWriteOptions is missing an order by / sort by like available in SQL.
   
   For sql we have the option to sort, for example:
   
   You can use the WITH ORDER clause of the CREATE EXTERNAL TABLE if your data 
is already ordered
   
   https://datafusion.apache.org/user-guide/sql/ddl.html#create-external-table
   
   CREATE EXTERNAL TABLE test (
       c1  VARCHAR NOT NULL,
       c2  INT NOT NULL,
       c3  SMALLINT NOT NULL,
       c4  SMALLINT NOT NULL,
       c5  INT NOT NULL,
       c6  BIGINT NOT NULL,
       c7  SMALLINT NOT NULL,
       c8  INT NOT NULL,
       c9  BIGINT NOT NULL,
       c10 VARCHAR NOT NULL,
       c11 FLOAT NOT NULL,
       c12 DOUBLE NOT NULL,
       c13 VARCHAR NOT NULL
   )
   STORED AS CSV
   -- this line tells DataFusion the data in the file is already ordered by (c2 
ASC)
   WITH ORDER (c2 ASC)
   LOCATION '/path/to/aggregate_test_100.csv'
   OPTIONS ('has_header' 'true');
   But for writing my parquet or other format files, we don't support it.
   ```
   
   
   ## What changes are included in this PR?
   Add the sort support.
   
   
   ## Are these changes tested?
   yes
   
   Added unit testing.
   
   ## Are there any user-facing changes?
   Yes, we support new order option for DataFrameWriteOptions
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to