No I added, the bin extension, updated the storage plugin, then tried the
query... do I need to relogin to sqlline for things to take effect?

On Thu, Oct 15, 2015 at 1:50 PM, Abhishek Girish <[email protected]>
wrote:

> You'll get a "file not found" error if Drill cannot recognize an extension
> (**). So if you tried querying a file with say .bin extension before you
> added "bin" as an extension to the json format plugin (and did not specify
> the default input format), you'd hit that issue.
>
> Can you try once more, after updating the json format plugin to read .bin
> files as json?
>
> ** Specifying default input format for a workspace is one such way to get
> around that. Also, some formats such as parquet might work either way.
>
> -Abhishek
>
> On Thu, Oct 15, 2015 at 11:22 AM, John Omernik <[email protected]> wrote:
>
> > That's on me, I thought I had typed good json, but apparently I did
> not.  I
> > got an invalid json format and I assumed that specifying extensions there
> > was not valid.
> >
> > That said, when I tried to select a file, or a directory I am get "file
> not
> > found" with the .bin extension, yet I know it to be there... when I do a
> > different (also file type) storage plugin where the default input type is
> > specified as json, then works.
> >
> > On Thu, Oct 15, 2015 at 10:41 AM, Abhishek Girish <
> > [email protected]
> > > wrote:
> >
> > > That should have worked! Also, I did try it out now:
> > >
> > > *Data:*
> > >
> > > # cat abc.bin
> > > {"abc":"123", "pqr":"789"}
> > >
> > > *Format Plugin:*
> > >
> > > "json": {
> > >       "type": "json",
> > >       "extensions": [
> > >         "json",
> > >         "bin"
> > >       ]
> > >     }
> > >
> > > *Query:*
> > >
> > > > select * from dfs.tmp.`abc.bin`;
> > > +------+------+
> > > | abc  | pqr  |
> > > +------+------+
> > > | 123  | 789  |
> > > +------+------+
> > > 1 row selected (0.392 seconds)
> > >
> > > As seen above, I did not query from a specific workspace - so did not
> > > specify or use any default input format.
> > >
> > > Can you please check again and share more specifics of error you see?
> > >
> > > -Abhishek
> > >
> > > On Thu, Oct 15, 2015 at 5:46 AM, John Omernik <[email protected]>
> wrote:
> > >
> > > > Hey all,
> > > >
> > > > I have some json files that are written out in with a .bin extension.
> > > > (Process not under my control).  In drill I am able to create a
> > workspace
> > > > that uses a default input type of json, and this is able to read with
> > no
> > > > issues, but I'd like to be able specify that .bin should also be read
> > as
> > > > json....
> > > >
> > > > I tried
> > > >
> > > >  "bin": {
> > > >       "type": "json"
> > > >     },
> > > >
> > > > That didn't work
> > > >
> > > > I tried
> > > >
> > > >  "json": {
> > > >       "type": "json",
> > > >        "extensions": [
> > > >         "bin", "json"
> > > >       ]
> > > >     },
> > > >
> > > > And that didn't work either. Other than using a different default
> input
> > > > format, is there a way to assign different extensions to non text
> files
> > > in
> > > > storage plugins?
> > > >
> > > > Thanks!
> > > >
> > > > John
> > > >
> > >
> >
>

Reply via email to