Hi Marc, 
Welcome to Drill!  Firstly, take a look at the docs for querying a file system: 
https://drill.apache.org/docs/querying-a-file-system-introduction/

When you start up drill out of the box, there is a connector called dfs which 
points to the local filesystem.  You can configure a workspace to your desktop 
folder, then all you have to do is write a query like:

SELECT * 
FROM dfs.desktop.`file.json`

If you're looking to do this programmatically from Java and your data isn't too 
big, the easiest way is probably to use Drill's REST API 
(https://drill.apache.org/docs/rest-api-introduction/).  You can make a simple 
HtTP call to Drill and get the data that way. 

Hope this helps!
-- C



> On Nov 24, 2022, at 5:02 PM, marc nicole <[email protected]> wrote:
> 
> Hi,
> 
> I want to query a JSON file placed in Desktop folder (Windows).
> How to do that in Java ?
> 
> PS: i saw this type of code :
> 
> Connection con = null;
> 
>      con = new Driver().connect(DRILL_JDBC_LOCAL_URI, getDefaultProperties());
>      Statement stmt = con.createStatement();
>      ResultSet rs = stmt.executeQuery(DRILL_SAMPLE_QUERY);...
> 
> 
> But that requires using JDBC and to place JSON in jar file within CP of
> Drill which i don't want;
> 
> Thanks.

Reply via email to