Reputation: 191
If I apply specific text formatting of header, body, and trailer to input data within Foundry via SQL, is there a way to export the output dataset as an ANSI text file?
Upvotes: 1
Views: 267
Reputation: 11
You can use the TEXT
output format in combination with concatenating your data to a single column and coalescing to a single partition. This output format doesn't support numeric types, so make sure to cast numeric columns as string
:
CREATE TABLE `/path/to/your_output` USING TEXT AS
SELECT /*+ COALESCE(1) */ col1 || ' ' || cast (col2 as string) as result FROM `/path/to/your_input`
The resulting file should be available for download in the dataset details page:
Upvotes: 1