columns[31] is a string (VARCHAR), not an array? FLATTEN only works on
arrays. You need to split the string into an array. I don't think Drill has
a SPLIT function yet but it's possible to write a UDF to do that.

Does that make sense?

On Wed, Aug 26, 2015 at 10:45 PM, Muthu Pandi <[email protected]> wrote:

> Yeah my typo mistake for "flatten".
>
> Now am getting error like this and i cant understand from where its
> throwing
>
> ERROR [HY000] [MapR][Drill] (1040) Drill failed to execute the query:
> SELECT  flatten(columns[31]) as column_31 FROM
> `HDFS`.`default`.`sampledata.csv` where columns[0] = '116061'
> [30027]Query execution error. Details:[
> SYSTEM ERROR: java.lang.ClassCastException: Cannot cast
> org.apache.drill.exec.vector.NullableVarCharVector to
> org.apache.drill.exec.vector.RepeatedValueVector
>
> Fragment 0:0
>
> [Error Id: 83be7b03-a064-4a35-b71c-6277e331817f on nn01:31010]
> ]
>
>
> *RegardsMuthupandi.K*
>
> *muthupandi.strikingly.com <http://muthupandi.strikingly.com>*
>
>  Think before you print.
>
>
>
> On Wed, Aug 26, 2015 at 8:54 PM, Abdel Hakim Deneche <
> [email protected]>
> wrote:
>
> > Did you copy the Flatten error message as it is ? if this is the case
> then
> > Flatten didn't work because there is an extra R in it:
> >
> > No match found for function signature flatteRn
> >
> > On Wed, Aug 26, 2015 at 12:55 AM, Muthu Pandi <[email protected]>
> wrote:
> >
> > > Hi All
> > >
> > >
> > > I have two csv files which will be in format of (id,b,c,d,"g,t,a,b",t)
> > > (id,a,b,c,4,4,"a,b,c,d,e",e,i)
> > >
> > > I like to  compare both files based on the data inside the double
> quoted
> > > column, like i want get all row which may contains "g,t,a,b" at least
> > one,
> > > only inside the double quoted column.
> > >
> > > not able to use Flatten function it throws " No match found for
> function
> > > signature flattern"
> > >
> > > Kindly show some pointers on how to split up the particular column and
> > > compare it to other file.
> > >
> > >
> > > *RegardsMuthupandi.K*
> > >
> > > *muthupandi.strikingly.com <http://muthupandi.strikingly.com>*
> > >
> > >  Think before you print.
> > >
> >
> >
> >
> > --
> >
> > Abdelhakim Deneche
> >
> > Software Engineer
> >
> >   <http://www.mapr.com/>
> >
> >
> > Now Available - Free Hadoop On-Demand Training
> > <
> >
> http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available
> > >
> >
>



-- 
Tomer Shiran
CEO and Co-Founder, Dremio

Reply via email to