[
https://issues.apache.org/jira/browse/DRILL-3772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14742331#comment-14742331
]
Abhishek Girish commented on DRILL-3772:
----------------------------------------
After trying out a few more things, it turns out, DROP table is being
restrictive in a way that it fails to drop files having extensions not defined
as part of format plug-ins. So even if Drill can read files, and files within a
directory are of the same type, DROP table will still fail since the file
extensions aren't explicitly defined by the user.
If we prefer to remain pessimistic w.r.t DROP table, the error message thrown
isn't clear and needs to be updated. As a consequence, users will definitely
face this issue while trying to read text files with common extensions such as
txt, dat, psv, ... which aren't defined explicitly within format plug-ins.
I'd suggest we relax this restriction in the first place.
P.S Correcting title of JIRA.
> DROP TABLE fails for directories with PSV files
> -----------------------------------------------
>
> Key: DRILL-3772
> URL: https://issues.apache.org/jira/browse/DRILL-3772
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 1.2.0
> Reporter: Abhishek Girish
> Assignee: Jinfeng Ni
> Attachments: drillbit.log.txt
>
>
> I created a simple PSV file with one row. Copied it twice into a directory.
> Put it on hadoop. Drop table failed, complaining that the directory contains
> non homogeneous files.
> {code}
> # cp a.psv b.psv
> # cp a.psv b.psv t1
> # hadoop fs -put t1 /tmp/t2
> 0: jdbc:drill:schema=dfs> select * from dfs.tmp.t2;
> +--------------+
> | columns |
> +--------------+
> | ["2|3|4|5"] |
> | ["2|3|4|5"] |
> +--------------+
> 2 rows selected (1.338 seconds)
> 0: jdbc:drill:schema=dfs> drop table dfs.tmp.t2;
> Error: VALIDATION ERROR: Table contains different file formats.
> Drop Table is only supported for directories that contain homogeneous file
> formats consumable by Drill
> [Error Id: 19763856-1a23-4438-a7f1-18f6dc280b0b on atsqa6c86.qa.lab:31010]
> (state=,code=0)
> {code}
> Works with CSV files:
> {code}
> # mv a.psv a.csv
> # mv b.psv b.csv
> # hadoop fs -put t1 /tmp/t3
> [root@atsqa6c85 ~]# /opt/drill/bin/sqlline -u
> jdbc:drill:schema=dfs;zk=10.10.104.85:5181
> apache drill 1.0.0
> "got drill?"
> 0: jdbc:drill:schema=dfs> use dfs.tmp;
> +-------+--------------------------------------+
> | ok | summary |
> +-------+--------------------------------------+
> | true | Default schema changed to [dfs.tmp] |
> +-------+--------------------------------------+
> 1 row selected (2.211 seconds)
> 0: jdbc:drill:schema=dfs> drop table t3;
> +-------+---------------------+
> | ok | summary |
> +-------+---------------------+
> | true | Table [t3] dropped |
> +-------+---------------------+
> 1 row selected (0.56 seconds)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)