Paul Rogers created DRILL-7709: ---------------------------------- Summary: CTAS as CSV creates files which the "csv" plugin can't read Key: DRILL-7709 URL: https://issues.apache.org/jira/browse/DRILL-7709 Project: Apache Drill Issue Type: Bug Affects Versions: 1.17.0 Reporter: Paul Rogers
Change the output format to JSON and create a CSV file: {noformat} ALTER SESSION SET `store.format` = 'csv'; CREATE TABLE foo AS ... {noformat} You will end up with a directory "foo" that contains a CSV file: "0_0_0.csv". Now, try to query that file: {noformat} SELECT * FROM foo {noformat} The query will fail, or return incorrect results, because in Drill, the "csv" read format is CSV *without* headers. But, on write, "csv" is CSV *with* headers. The (very messy) workaround is to manually rename all the files to use the ".csvh" suffix, or to create a separate storage plugin config for that target with a new "csv" format plugin that does not have headers. Expected that if I create a file in Drill I should be able to immediately read that file without extra hokey-pokey. -- This message was sent by Atlassian Jira (v8.3.4#803005)