Well of course, however, the json may not be easily read by a human, (pretty printed vs not) and might have lots of fields with nesting making it even harder to successfully read.. To explore the data, if we had it so we could select * from the file, then hone in on there, unless you are advocating that to do data exploration in drill on Json, one has to open a json file in a text editor, and then manually copy field names to a query a window, hopefully not missing anything in the process due to nesting or other human error. That seems very counter intuitive if one wants to use Drill as the data exploration tool...
On Mon, Oct 12, 2015 at 12:27 PM, Paul Ilechko <[email protected]> wrote: > Well, if it's json then you do know the field names, they are right there > in the document > > On Mon, Oct 12, 2015 at 1:25 PM, John Omernik <[email protected]> wrote: > > > Interesting, so we can't use select * on those items. I think that > should > > be a bug of some sort in that it's hard to explore the json data if you > > don't know the field names ahead of time. This is one of the situations > > where having the select * works really well for learning the data. (Am I > > missing something here?) > > > > > > > > On Mon, Oct 12, 2015 at 12:13 PM, Abhishek Girish < > > [email protected] > > > wrote: > > > > > I tried out using the example you shared. Saw the same failures. > However, > > > this worked for me: > > > > > > > select `hello.yoko`, yousayyes from dfs.`/Users/agirish/abc.json`; > > > +-------------+------------+ > > > | hello.yoko | yousayyes | > > > +-------------+------------+ > > > | goodbye | isayno | > > > +-------------+------------+ > > > 1 row selected (0.092 seconds) > > > > > > Basically, instead of a select * I used select <columnName> and escaped > > the > > > column using back quotes. See if this can work for you. I'm not sure if > > > there is an alternate way - someone else can comment. > > > > > > -Abhishek > > > > > > > > > On Mon, Oct 12, 2015 at 9:45 AM, John Omernik <[email protected]> > wrote: > > > > > > > I am getting some data that seems well formed, except for there are > > dots > > > in > > > > some of the key names. > > > > > > > > Basically, something like ip.src seems to be making it fail with a > > "Field > > > > References must be singular names" > > > > > > > > I am using the MapR Packaged Drill 1.2. > > > > > > > > > > > > I can prove this out with > > > > > > > > {"hello":"goodbye", "yousayyes":"isayno"} > > > > > > > > works fine but > > > > > > > > {"hello.yoko":"goodbye", "yousayyes":"isayno"} > > > > > > > > Screams loudly that there is a failure. > > > > > > > > Is there a way we could handle dots in the key name on JSON? > > > > > > > > John > > > > > > > > > > > > > -- > ---------------------------------- > Paul Ilechko > Senior Systems Engineer > MapR Technologies > 908 331 2207 >
