Skip to content

Conversation

@tinfoil-knight
Copy link
Contributor

Which issue does this PR close?

Closes #9707 .

Rationale for this change

Please see the issue description for #9707 .

What changes are included in this PR?

We're getting the format from format_options & passing it to register_object_store_and_config_extensions so that TableOptions are set correctly.

Are these changes tested?

There are very less tests for the datafusion-cli crate. Testing this change would require setting up some sort of auto-cleanup like SQL Logic Tests for the COPY TO command. Let me know if we should do this now or open an issue separately for increasing the CLI test coverage.

Are there any user-facing changes?

No. This PR just fixes what's expected to be working. No new changes.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @tinfoil-knight

I tested this out locally

before this PR:

❯ COPY (select * from (values (1))) to '/tmp/foo.parquet' STORED AS PARQUET OPTIONS ('format.compression' snappy);
Invalid or Unsupported Configuration: Specify a format for TableOptions

After this PR:

DataFusion CLI v36.0.0
❯ COPY (select * from (values (1))) to '/tmp/foo.parquet' STORED AS PARQUET OPTIONS ('format.compression' snappy);
+-------+
| count |
+-------+
| 1     |
+-------+
1 row in set. Query took 0.038 seconds.

@alamb alamb merged commit 14972e6 into apache:main Mar 20, 2024
@alamb
Copy link
Contributor

alamb commented Mar 20, 2024

Thanks again @tinfoil-knight

@tinfoil-knight tinfoil-knight deleted the 9707-copy-to-opt branch March 21, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

COPY TO fails on passing options for format through cli

2 participants