You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by AleCaste <Al...@hotmail.com> on 2015/12/23 00:10:36 UTC

A field reference identifier must not have the form of a qualified name

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?

Re: A field reference identifier must not have the form of a qualified name

Posted by Christopher Matta <cm...@mapr.com>.
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
cmatta@mapr.com
215-701-3146

On Tue, Dec 22, 2015 at 6:10 PM, AleCaste <Al...@hotmail.com> 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?
>