viirya commented on code in PR #8618:
URL: https://github.com/apache/arrow-datafusion/pull/8618#discussion_r1434396657
##########
datafusion/proto/tests/cases/roundtrip_logical_plan.rs:
##########
@@ -301,6 +305,68 @@ async fn roundtrip_logical_plan_aggregation() ->
Result<()> {
Ok(())
}
+#[tokio::test]
+async fn roundtrip_logical_plan_copy_to_sql_options() -> Result<()> {
+ let ctx = SessionContext::new();
+
+ let input = create_csv_scan(&ctx).await?;
+
+ let mut options = HashMap::new();
+ options.insert("foo".to_string(), "bar".to_string());
+
+ let plan = LogicalPlan::Copy(CopyTo {
+ input: Arc::new(input),
+ output_url: "test.csv".to_string(),
+ file_format: FileType::CSV,
+ single_file_output: true,
+ copy_options:
CopyOptions::SQLOptions(StatementOptions::from(&options)),
+ });
+
+ let bytes = logical_plan_to_bytes(&plan)?;
+ let logical_round_trip = logical_plan_from_bytes(&bytes, &ctx)?;
+ assert_eq!(format!("{plan:?}"), format!("{logical_round_trip:?}"));
+
+ Ok(())
+}
+
+#[tokio::test]
+#[ignore] // see https://github.com/apache/arrow-datafusion/issues/8619
+async fn roundtrip_logical_plan_copy_to_writer_options() -> Result<()> {
+ let ctx = SessionContext::new();
+
+ let input = create_csv_scan(&ctx).await?;
+
+ let writer_properties = WriterProperties::builder()
+ .set_bloom_filter_enabled(true)
+ .set_created_by("DataFusion Test".to_string())
+ .build();
+ let plan = LogicalPlan::Copy(CopyTo {
+ input: Arc::new(input),
+ output_url: "test.csv".to_string(),
+ file_format: FileType::CSV,
+ single_file_output: true,
+ copy_options: CopyOptions::WriterOptions(Box::new(
+
FileTypeWriterOptions::Parquet(ParquetWriterOptions::new(writer_properties)),
+ )),
+ });
+
+ let bytes = logical_plan_to_bytes(&plan)?;
+ let logical_round_trip = logical_plan_from_bytes(&bytes, &ctx)?;
+ println!("{plan:?}");
+ println!("{logical_round_trip:?}");
Review Comment:
This is left by intention?
--
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]