drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Matta <cma...@mapr.com>
Subject Re: [Create view] Unable to create view. Schema [csvtest.default] is immutable.
Date Fri, 31 Oct 2014 13:13:04 GMT
When querying a CSV/TSV/PSV document each row is returned as an array. You
have to give meaning to the columns by casting them:

SELECT CAST(columns[0] as INT) as `id`, CAST(columns[1] as
VARCHAR(128)) as `play` FROM `plays.csv`;

‚Äč

Chris Matta
cmatta@mapr.com
215-701-3146

On Thu, Oct 30, 2014 at 12:48 PM, Sean Hsuan-Yi Chu <hsuanyichu@gmail.com>
wrote:

> Hi,
>
> I am trying to create a view from a table which looks like below:
>
> 0: jdbc:drill:zk=local> select * from `plays.csv`;
>
> +------------+
>
> |  columns   |
>
> +------------+
>
> | ["1599","As You Like It"] |
>
> | ["1601","Twelfth Night"] |
>
> | ["1594","Comedy of Errors"] |
>
> | ["1595","Romeo and Juliet"] |
>
> | ["1596","The Merchant of Venice"] |
>
> | ["1610","The Tempest"] |
>
> | ["1599","Hamlet"] |
>
> +------------+
>
>
> But it returns:
>
>
> 0: jdbc:drill:zk=local> create view viewZZZ AS
>
> . . . . . . . . . . . > select * from `plays.csv`;
>
> +------------+------------+
>
> |     ok     |  summary   |
>
> +------------+------------+
>
> | false      | Unable to create view. Schema [csvtest.default] is
> immutable.  |
>
> +------------+------------+
>
>
> Can anybody tell me what's wrong here???
>
>
> Thanks
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message