We don't currently have a way to do something equivalent to SELECT KVGEN(*)
 FROM T. Would you file a new feature request in JIRA for this?

With regards to the dot issue, can you file a JIRA bug. We have internal
protection against accidentally passing through complex identifiers and
apparently Drill is not correctly escaping your dotted identifier
throughout the engine.

thanks,
Jacques

--
Jacques Nadeau
CTO and Co-Founder, Dremio

On Tue, Dec 29, 2015 at 4:30 PM, AleCaste <[email protected]> wrote:

> Indeed, a period in a key is still valid JSON.
> So this should be fixed somehow within Drill.
>
> But also I still don’t see how to apply FLATTEN+KVGEN to a whole record
> and not just a property/subproperty of it.
> Anyone?
>
>
>
>
> From: Christopher Matta
> Sent: Wednesday, December 23, 2015 8:13 AM
> To: [email protected]
> Subject: Re: A field reference identifier must not have the form of a
> qualified name
>
> Seems like Drill is explicitly checking for a period in the key and failing
> (from FieldReference.java
> <
> https://github.com/apache/drill/blob/master/logical/src/main/java/org/apache/drill/common/expression/FieldReference.java#L54
> >
> ):
>
>
> private void checkSimpleString(CharSequence value) { if (value.toString().
> contains(".")) { throw new UnsupportedOperationException(
> String.format( "Unhandled
> field reference \"%s\"; a field reference identifier" + " must not have the
> form of a qualified name (i.e., with \".\").", value)); } }
>
> Devs, is there any reason for this? As far as I know a period in a key is
> still valid JSON.
>
> Chris Matta
> [email protected]
> 215-701-3146
>
> On Tue, Dec 22, 2015 at 6:10 PM, AleCaste <[email protected]> wrote:
>
> > I have a json file with the following structure:
> >
> >     {
> >       "0.0.1":{
> >         "version":"0.0.1",
> >         "date_created":"2014-03-15"
> >       },
> >       "0.1.2":{
> >         "version":"0.1.2",
> >         "date_created":"2014-05-21"
> >       }
> >     }
> >
> > As you can see the whole json file contains just one object which is a
> map
> > in which each key is the version number and the value is a new map with
> > version and date_created properties.
> >
> > I want to use Apache Drill to get a list with two columns: version and
> > date_created
> >
> > But since the keys contain dots (e.g. "0.0.1") Drill throws the following
> > error:
> >
> >     Error: SYSTEM ERROR: UnsupportedOperationException: Unhandled field
> > reference "0.0.1"; a field reference identifier must not have the form
> of a
> > qualified name (i.e., with ".").
> >
> > ... when running a query like this:
> >
> >     SELECT KVGEN(t.*) FROM dfs.`D:/drill/sample-data/myjsonfile.json` AS
> t;
> >
> > By the way, how do you tell KVGEN to process the WHOLE ROW since the row
> > object is the actual map we want to convert?
> >
> > Any ideas about how to overcome this problem?
> >
>

Reply via email to