Repository navigation
Answer COPY TO with RETURN_FILES as the count and the list of files written - #2998
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1446.
COPY ... TOnow takesRETURN_FILES. When it is on, the copy answers a row withCountas a BIGINT andFilesas a VARCHAR[] list of every file it wrote, in the order it wrote them, so a partitioned or rotating copy lists each file. A copy with no rows still lists its one empty file, and withWRITE_EMPTY_FILE falsethe list is empty.The option value is cast to BOOLEAN the way the pin reads it, so
RETURN_FILES 1is on,RETURN_FILES falsegives the plain changed count, andRETURN_FILES 'x'is refused with the pin's Invalid Input message. Only an option that is on counts as set, and setting bothRETURN_FILESandRETURN_STATSis refused with the pin's Binder message.RETURN_STATSon a CSV or JSON copy is refused as not implemented, and the message names the "csv" format for JSON too, as the pin's does.The writers in export.rs now hand back the files they wrote, so the count and the list come from the same place. Everything here was checked against v2.0.0-dev84237.