You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by 南在南方 <i0...@qq.com> on 2014/05/22 15:53:31 UTC
Have some trouble in querying json files
hi,
When I use drill to query json files , error occurs . here is my error report :
and my drill storage-engines.json configuration :
{
"storage":{
"parquet-local" :
{
"type":"parquet",
"dfsName" : "file:///"
},
"parquet-cp" :
{
"type":"parquet",
"dfsName" : "classpath:///"
},
"jsonl" :
{
"type":"json",
"dfsName" : "hdfs://localhost:9000/user/bevin"
},
"json-cp" :
{
"type":"json",
"dfsName" : "classpath:///"
},
"parquet" :
{
"type":"parquet",
"dfsName" : "hdfs://localhost:9000/user/bevin"
}
}
}
I also have some trouble in querying csv file. How should I config my drill storage-engines.json file?
thanks
回复: Have some trouble in querying json files
Posted by 南在南方 <i0...@qq.com>.
------------------ 原始邮件 ------------------
发件人: "Yash Sharma"<ya...@gmail.com>;
发送时间: 2014年5月23日(星期五) 凌晨2:00
收件人: "drill-user"<dr...@incubator.apache.org>;
主题: Re: Have some trouble in querying json files
Or paste the error trace here!
On Thu, May 22, 2014 at 8:59 PM, Jason Altekruse
<al...@gmail.com>wrote:
> The image didn't show up for me, do you want to throw it on an image
> hosting service like imgur and post a link?
>
> -Jason Altekruse
>
>
> On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
>
> > hi,
> > When I use drill to query json files , error occurs . here is my error
> > report :
> >
> > and my drill storage-engines.json configuration :
> > {
> > "storage":{
> > "parquet-local" :
> > {
> > "type":"parquet",
> > "dfsName" : "file:///"
> > },
> > "parquet-cp" :
> > {
> > "type":"parquet",
> > "dfsName" : "classpath:///"
> > },
> > "jsonl" :
> > {
> > "type":"json",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > },
> > "json-cp" :
> > {
> > "type":"json",
> > "dfsName" : "classpath:///"
> > },
> > "parquet" :
> > {
> > "type":"parquet",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > }
> > }
> > }
> >
> > I also have some trouble in querying csv file. How should I config my
> > drill storage-engines.json file?
> > thanks
> >
>
Re: Have some trouble in querying json files
Posted by Yash Sharma <ya...@gmail.com>.
Or paste the error trace here!
On Thu, May 22, 2014 at 8:59 PM, Jason Altekruse
<al...@gmail.com>wrote:
> The image didn't show up for me, do you want to throw it on an image
> hosting service like imgur and post a link?
>
> -Jason Altekruse
>
>
> On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
>
> > hi,
> > When I use drill to query json files , error occurs . here is my error
> > report :
> >
> > and my drill storage-engines.json configuration :
> > {
> > "storage":{
> > "parquet-local" :
> > {
> > "type":"parquet",
> > "dfsName" : "file:///"
> > },
> > "parquet-cp" :
> > {
> > "type":"parquet",
> > "dfsName" : "classpath:///"
> > },
> > "jsonl" :
> > {
> > "type":"json",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > },
> > "json-cp" :
> > {
> > "type":"json",
> > "dfsName" : "classpath:///"
> > },
> > "parquet" :
> > {
> > "type":"parquet",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > }
> > }
> > }
> >
> > I also have some trouble in querying csv file. How should I config my
> > drill storage-engines.json file?
> > thanks
> >
>
Re: Have some trouble in querying json files
Posted by Ramana Inukonda <ri...@maprtech.com>.
Please substitute maprfs with file if you are using a local file.
Regards
Ramana
On Thursday, May 22, 2014, Ramana Inukonda <ri...@maprtech.com> wrote:
> To Query CSV files. Please use the storage-plugins.json I have provided.
>
>
>
>
> On Thu, May 22, 2014 at 10:58 PM, 南在南方 <i02389@qq.com<javascript:_e(%7B%7D,'cvml','i02389@qq.com');>
> > wrote:
>
> I have tried several querying format. Like select * from
> "/home/bevin/storage-engines.json"; select * from
> `/home/bevin/storage-engines.json`; select * from
> '/home/bevin/storage-engines.json'; but error also happened. when I query
> another json file , query works.
> BTW, How should I config my storage.engines.json file if I want to query
> csv files? The configuration of cwiki page by configuring
> drill-override.conf file doesn's works.
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Neeraja Rentachintala"<nr...@maprtech.com>;
> 发送时间: 2014年5月23日(星期五) 中午1:48
> 收件人: "drill-user"<dr...@incubator.apache.org>;
> 主题: Re: 回复: 回复: Have some trouble in querying json files
>
>
>
> You will need to use back ticks (`) around the file name for the above
> error.
> Refer to the document below on sample queries.
>
> https://cwiki.apache.org/confluence/display/DRILL/Apache+Drill+in+10+Minutes#ApacheDrillin10Minutes-QueryingaJSONFile
>
>
> On Thu, May 22, 2014 at 10:42 PM, 南在南方 <i0...@qq.com> wrote:
>
> > Sorry. BTW, How should I config my storage.engines.json file if I want to
> > query csv files?
> >
> >
> > 0: jdbc:drill:schema> select * from /home/bevin/storage.engines.json;
> > java.lang.RuntimeException: parse failed
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:237)
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:195)
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:168)
> > at
> >
> net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:402)
> > at
> > net.hydromatic.optiq.jdbc.OptiqStatement.execute(OptiqStatement.java:192)
> > at sqlline.SqlLine$Commands.execute(SqlLine.java:3825)
> > at sqlline.SqlLine$Commands.sql(SqlLine.java:3738)
> > at sqlline.SqlLine.dispatch(SqlLine.java:882)
> > at sqlline.SqlLine.begin(SqlLine.java:717)
> > at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:460)
> > at sqlline.SqlLine.main(SqlLine.java:443)
> > Caused by: org.eigenbase.sql.parser.SqlParseException: Encountered "/" at
> > line 1, column 15.
> > Was expecting one of:
> > <IDENTIFIER> ...
> > <QUOTED_IDENTIFIER> ...
> > <UNICODE_QUOTED_IDENTIFIER> ...
> > "LATERAL" ...
> > "(" ...
> > "UNNEST" ...
> > "TABLE" ...
> >
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:281)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:44)
> > at
> org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:138)
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:235)
> > ... 10 more
> > Caused by: org.eigenbase.sql.parser.impl.ParseException: Encountered "/"
> > at line 1, column 15.
> > Was expecting one of:
> > <IDENTIFIER> ...
> > <QUOTED_IDENTIFIER> ...
> > <UNICODE_QUOTED_IDENTIFIER> ...
> > "LATERAL" ...
> > "(" ...
> > "UNNEST" ...
> > "TABLE" ...
> >
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:15443)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:15272)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.TableRef(SqlParserImpl.java:1423)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.FromClause(SqlParserImpl.java:1286)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlSelect(SqlParserImpl.java:633)
> > at
> > org.eigenbase.sql.parser.impl.SqlParserImpl.
>
>
>
Re: 回复: 回复: 回复: Have some trouble in querying json files
Posted by Ramana Inukonda <ri...@maprtech.com>.
To Query CSV files. Please use the storage-plugins.json I have provided.
On Thu, May 22, 2014 at 10:58 PM, 南在南方 <i0...@qq.com> wrote:
> I have tried several querying format. Like select * from
> "/home/bevin/storage-engines.json"; select * from
> `/home/bevin/storage-engines.json`; select * from
> '/home/bevin/storage-engines.json'; but error also happened. when I query
> another json file , query works.
> BTW, How should I config my storage.engines.json file if I want to query
> csv files? The configuration of cwiki page by configuring
> drill-override.conf file doesn's works.
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Neeraja Rentachintala"<nr...@maprtech.com>;
> 发送时间: 2014年5月23日(星期五) 中午1:48
> 收件人: "drill-user"<dr...@incubator.apache.org>;
> 主题: Re: 回复: 回复: Have some trouble in querying json files
>
>
>
> You will need to use back ticks (`) around the file name for the above
> error.
> Refer to the document below on sample queries.
>
> https://cwiki.apache.org/confluence/display/DRILL/Apache+Drill+in+10+Minutes#ApacheDrillin10Minutes-QueryingaJSONFile
>
>
> On Thu, May 22, 2014 at 10:42 PM, 南在南方 <i0...@qq.com> wrote:
>
> > Sorry. BTW, How should I config my storage.engines.json file if I want to
> > query csv files?
> >
> >
> > 0: jdbc:drill:schema> select * from /home/bevin/storage.engines.json;
> > java.lang.RuntimeException: parse failed
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:237)
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:195)
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:168)
> > at
> >
> net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:402)
> > at
> > net.hydromatic.optiq.jdbc.OptiqStatement.execute(OptiqStatement.java:192)
> > at sqlline.SqlLine$Commands.execute(SqlLine.java:3825)
> > at sqlline.SqlLine$Commands.sql(SqlLine.java:3738)
> > at sqlline.SqlLine.dispatch(SqlLine.java:882)
> > at sqlline.SqlLine.begin(SqlLine.java:717)
> > at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:460)
> > at sqlline.SqlLine.main(SqlLine.java:443)
> > Caused by: org.eigenbase.sql.parser.SqlParseException: Encountered "/" at
> > line 1, column 15.
> > Was expecting one of:
> > <IDENTIFIER> ...
> > <QUOTED_IDENTIFIER> ...
> > <UNICODE_QUOTED_IDENTIFIER> ...
> > "LATERAL" ...
> > "(" ...
> > "UNNEST" ...
> > "TABLE" ...
> >
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:281)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:44)
> > at
> org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:138)
> > at
> >
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:235)
> > ... 10 more
> > Caused by: org.eigenbase.sql.parser.impl.ParseException: Encountered "/"
> > at line 1, column 15.
> > Was expecting one of:
> > <IDENTIFIER> ...
> > <QUOTED_IDENTIFIER> ...
> > <UNICODE_QUOTED_IDENTIFIER> ...
> > "LATERAL" ...
> > "(" ...
> > "UNNEST" ...
> > "TABLE" ...
> >
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:15443)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:15272)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.TableRef(SqlParserImpl.java:1423)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.FromClause(SqlParserImpl.java:1286)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlSelect(SqlParserImpl.java:633)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQuery(SqlParserImpl.java:399)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQueryOrExpr(SqlParserImpl.java:2055)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.QueryOrExpr(SqlParserImpl.java:2017)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.OrderedQueryOrExpr(SqlParserImpl.java:377)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:573)
> > at
> >
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:599)
> > at
> org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:130)
> > ... 11 more
> > 0: jdbc:drill:schema>
> >
> >
> >
> >
> >
> > ------------------ 原始邮件 ------------------
> > 发件人: "Yash Sharma"<ya...@gmail.com>;
> > 发送时间: 2014年5月23日(星期五) 下午2:04
> > 收件人: "drill-user"<dr...@incubator.apache.org>;
> > 主题: Re: 回复: Have some trouble in querying json files
> >
> >
> >
> > Hi,
> > Please try to paste the text error trace directly rather than
> > screenshots/images.
> > We are unable to view the images in the mail.
> >
> > Peace,
> > Yash
> >
> >
> > On Fri, May 23, 2014 at 9:32 AM, 南在南方 <i0...@qq.com> wrote:
> >
> > >
> > > ------------------ 原始邮件 ------------------
> > > *发件人:* "Jason Altekruse";<al...@gmail.com>;
> > > *发送时间:* 2014年5月22日(星期四) 晚上11:29
> > > *收件人:* "Apache Drill User"<dr...@incubator.apache.org>;
> > > *主题:* Re: Have some trouble in querying json files
> > >
> > > The image didn't show up for me, do you want to throw it on an image
> > > hosting service like imgur and post a link?
> > >
> > > -Jason Altekruse
> > >
> > >
> > > On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
> > >
> > > > hi,
> > > > When I use drill to query json files , error occurs . here is my
> error
> > > > report :
> > > >
> > > > and my drill storage-engines.json configuration :
> > > > {
> > > > "storage":{
> > > > "parquet-local" :
> > > > {
> > > > "type":"parquet",
> > > > "dfsName" : "file:///"
> > > > },
> > > > "parquet-cp" :
> > > > {
> > > > "type":"parquet",
> > > > "dfsName" : "classpath:///"
> > > > },
> > > > "jsonl" :
> > > > {
> > > > "type":"json",
> > > > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > > > },
> > > > "json-cp" :
> > > > {
> > > > "type":"json",
> > > > "dfsName" : "classpath:///"
> > > > },
> > > > "parquet" :
> > > > {
> > > > "type":"parquet",
> > > > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > > > }
> > > > }
> > > > }
> > > >
> > > > I also have some trouble in querying csv file. How should I config my
> > > > drill storage-engines.json file?
> > > > thanks
> > > >
> > >
> > >
> >
>
回复: 回复: 回复: Have some trouble in querying json files
Posted by 南在南方 <i0...@qq.com>.
I have tried several querying format. Like select * from "/home/bevin/storage-engines.json"; select * from `/home/bevin/storage-engines.json`; select * from '/home/bevin/storage-engines.json'; but error also happened. when I query another json file , query works.
BTW, How should I config my storage.engines.json file if I want to query csv files? The configuration of cwiki page by configuring drill-override.conf file doesn's works.
------------------ 原始邮件 ------------------
发件人: "Neeraja Rentachintala"<nr...@maprtech.com>;
发送时间: 2014年5月23日(星期五) 中午1:48
收件人: "drill-user"<dr...@incubator.apache.org>;
主题: Re: 回复: 回复: Have some trouble in querying json files
You will need to use back ticks (`) around the file name for the above
error.
Refer to the document below on sample queries.
https://cwiki.apache.org/confluence/display/DRILL/Apache+Drill+in+10+Minutes#ApacheDrillin10Minutes-QueryingaJSONFile
On Thu, May 22, 2014 at 10:42 PM, 南在南方 <i0...@qq.com> wrote:
> Sorry. BTW, How should I config my storage.engines.json file if I want to
> query csv files?
>
>
> 0: jdbc:drill:schema> select * from /home/bevin/storage.engines.json;
> java.lang.RuntimeException: parse failed
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:237)
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:195)
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:168)
> at
> net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:402)
> at
> net.hydromatic.optiq.jdbc.OptiqStatement.execute(OptiqStatement.java:192)
> at sqlline.SqlLine$Commands.execute(SqlLine.java:3825)
> at sqlline.SqlLine$Commands.sql(SqlLine.java:3738)
> at sqlline.SqlLine.dispatch(SqlLine.java:882)
> at sqlline.SqlLine.begin(SqlLine.java:717)
> at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:460)
> at sqlline.SqlLine.main(SqlLine.java:443)
> Caused by: org.eigenbase.sql.parser.SqlParseException: Encountered "/" at
> line 1, column 15.
> Was expecting one of:
> <IDENTIFIER> ...
> <QUOTED_IDENTIFIER> ...
> <UNICODE_QUOTED_IDENTIFIER> ...
> "LATERAL" ...
> "(" ...
> "UNNEST" ...
> "TABLE" ...
>
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:281)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:44)
> at org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:138)
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:235)
> ... 10 more
> Caused by: org.eigenbase.sql.parser.impl.ParseException: Encountered "/"
> at line 1, column 15.
> Was expecting one of:
> <IDENTIFIER> ...
> <QUOTED_IDENTIFIER> ...
> <UNICODE_QUOTED_IDENTIFIER> ...
> "LATERAL" ...
> "(" ...
> "UNNEST" ...
> "TABLE" ...
>
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:15443)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:15272)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.TableRef(SqlParserImpl.java:1423)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.FromClause(SqlParserImpl.java:1286)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlSelect(SqlParserImpl.java:633)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQuery(SqlParserImpl.java:399)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQueryOrExpr(SqlParserImpl.java:2055)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.QueryOrExpr(SqlParserImpl.java:2017)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.OrderedQueryOrExpr(SqlParserImpl.java:377)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:573)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:599)
> at org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:130)
> ... 11 more
> 0: jdbc:drill:schema>
>
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Yash Sharma"<ya...@gmail.com>;
> 发送时间: 2014年5月23日(星期五) 下午2:04
> 收件人: "drill-user"<dr...@incubator.apache.org>;
> 主题: Re: 回复: Have some trouble in querying json files
>
>
>
> Hi,
> Please try to paste the text error trace directly rather than
> screenshots/images.
> We are unable to view the images in the mail.
>
> Peace,
> Yash
>
>
> On Fri, May 23, 2014 at 9:32 AM, 南在南方 <i0...@qq.com> wrote:
>
> >
> > ------------------ 原始邮件 ------------------
> > *发件人:* "Jason Altekruse";<al...@gmail.com>;
> > *发送时间:* 2014年5月22日(星期四) 晚上11:29
> > *收件人:* "Apache Drill User"<dr...@incubator.apache.org>;
> > *主题:* Re: Have some trouble in querying json files
> >
> > The image didn't show up for me, do you want to throw it on an image
> > hosting service like imgur and post a link?
> >
> > -Jason Altekruse
> >
> >
> > On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
> >
> > > hi,
> > > When I use drill to query json files , error occurs . here is my error
> > > report :
> > >
> > > and my drill storage-engines.json configuration :
> > > {
> > > "storage":{
> > > "parquet-local" :
> > > {
> > > "type":"parquet",
> > > "dfsName" : "file:///"
> > > },
> > > "parquet-cp" :
> > > {
> > > "type":"parquet",
> > > "dfsName" : "classpath:///"
> > > },
> > > "jsonl" :
> > > {
> > > "type":"json",
> > > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > > },
> > > "json-cp" :
> > > {
> > > "type":"json",
> > > "dfsName" : "classpath:///"
> > > },
> > > "parquet" :
> > > {
> > > "type":"parquet",
> > > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > > }
> > > }
> > > }
> > >
> > > I also have some trouble in querying csv file. How should I config my
> > > drill storage-engines.json file?
> > > thanks
> > >
> >
> >
>
Re: 回复: 回复: Have some trouble in querying json files
Posted by Neeraja Rentachintala <nr...@maprtech.com>.
You will need to use back ticks (`) around the file name for the above
error.
Refer to the document below on sample queries.
https://cwiki.apache.org/confluence/display/DRILL/Apache+Drill+in+10+Minutes#ApacheDrillin10Minutes-QueryingaJSONFile
On Thu, May 22, 2014 at 10:42 PM, 南在南方 <i0...@qq.com> wrote:
> Sorry. BTW, How should I config my storage.engines.json file if I want to
> query csv files?
>
>
> 0: jdbc:drill:schema> select * from /home/bevin/storage.engines.json;
> java.lang.RuntimeException: parse failed
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:237)
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:195)
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:168)
> at
> net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:402)
> at
> net.hydromatic.optiq.jdbc.OptiqStatement.execute(OptiqStatement.java:192)
> at sqlline.SqlLine$Commands.execute(SqlLine.java:3825)
> at sqlline.SqlLine$Commands.sql(SqlLine.java:3738)
> at sqlline.SqlLine.dispatch(SqlLine.java:882)
> at sqlline.SqlLine.begin(SqlLine.java:717)
> at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:460)
> at sqlline.SqlLine.main(SqlLine.java:443)
> Caused by: org.eigenbase.sql.parser.SqlParseException: Encountered "/" at
> line 1, column 15.
> Was expecting one of:
> <IDENTIFIER> ...
> <QUOTED_IDENTIFIER> ...
> <UNICODE_QUOTED_IDENTIFIER> ...
> "LATERAL" ...
> "(" ...
> "UNNEST" ...
> "TABLE" ...
>
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:281)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:44)
> at org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:138)
> at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:235)
> ... 10 more
> Caused by: org.eigenbase.sql.parser.impl.ParseException: Encountered "/"
> at line 1, column 15.
> Was expecting one of:
> <IDENTIFIER> ...
> <QUOTED_IDENTIFIER> ...
> <UNICODE_QUOTED_IDENTIFIER> ...
> "LATERAL" ...
> "(" ...
> "UNNEST" ...
> "TABLE" ...
>
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:15443)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:15272)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.TableRef(SqlParserImpl.java:1423)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.FromClause(SqlParserImpl.java:1286)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlSelect(SqlParserImpl.java:633)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQuery(SqlParserImpl.java:399)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQueryOrExpr(SqlParserImpl.java:2055)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.QueryOrExpr(SqlParserImpl.java:2017)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.OrderedQueryOrExpr(SqlParserImpl.java:377)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:573)
> at
> org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:599)
> at org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:130)
> ... 11 more
> 0: jdbc:drill:schema>
>
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Yash Sharma"<ya...@gmail.com>;
> 发送时间: 2014年5月23日(星期五) 下午2:04
> 收件人: "drill-user"<dr...@incubator.apache.org>;
> 主题: Re: 回复: Have some trouble in querying json files
>
>
>
> Hi,
> Please try to paste the text error trace directly rather than
> screenshots/images.
> We are unable to view the images in the mail.
>
> Peace,
> Yash
>
>
> On Fri, May 23, 2014 at 9:32 AM, 南在南方 <i0...@qq.com> wrote:
>
> >
> > ------------------ 原始邮件 ------------------
> > *发件人:* "Jason Altekruse";<al...@gmail.com>;
> > *发送时间:* 2014年5月22日(星期四) 晚上11:29
> > *收件人:* "Apache Drill User"<dr...@incubator.apache.org>;
> > *主题:* Re: Have some trouble in querying json files
> >
> > The image didn't show up for me, do you want to throw it on an image
> > hosting service like imgur and post a link?
> >
> > -Jason Altekruse
> >
> >
> > On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
> >
> > > hi,
> > > When I use drill to query json files , error occurs . here is my error
> > > report :
> > >
> > > and my drill storage-engines.json configuration :
> > > {
> > > "storage":{
> > > "parquet-local" :
> > > {
> > > "type":"parquet",
> > > "dfsName" : "file:///"
> > > },
> > > "parquet-cp" :
> > > {
> > > "type":"parquet",
> > > "dfsName" : "classpath:///"
> > > },
> > > "jsonl" :
> > > {
> > > "type":"json",
> > > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > > },
> > > "json-cp" :
> > > {
> > > "type":"json",
> > > "dfsName" : "classpath:///"
> > > },
> > > "parquet" :
> > > {
> > > "type":"parquet",
> > > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > > }
> > > }
> > > }
> > >
> > > I also have some trouble in querying csv file. How should I config my
> > > drill storage-engines.json file?
> > > thanks
> > >
> >
> >
>
回复: 回复: Have some trouble in querying json files
Posted by 南在南方 <i0...@qq.com>.
Sorry. BTW, How should I config my storage.engines.json file if I want to query csv files?
0: jdbc:drill:schema> select * from /home/bevin/storage.engines.json;
java.lang.RuntimeException: parse failed
at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:237)
at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:195)
at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:168)
at net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:402)
at net.hydromatic.optiq.jdbc.OptiqStatement.execute(OptiqStatement.java:192)
at sqlline.SqlLine$Commands.execute(SqlLine.java:3825)
at sqlline.SqlLine$Commands.sql(SqlLine.java:3738)
at sqlline.SqlLine.dispatch(SqlLine.java:882)
at sqlline.SqlLine.begin(SqlLine.java:717)
at sqlline.SqlLine.mainWithInputRedirection(SqlLine.java:460)
at sqlline.SqlLine.main(SqlLine.java:443)
Caused by: org.eigenbase.sql.parser.SqlParseException: Encountered "/" at line 1, column 15.
Was expecting one of:
<IDENTIFIER> ...
<QUOTED_IDENTIFIER> ...
<UNICODE_QUOTED_IDENTIFIER> ...
"LATERAL" ...
"(" ...
"UNNEST" ...
"TABLE" ...
at org.eigenbase.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:281)
at org.eigenbase.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:44)
at org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:138)
at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:235)
... 10 more
Caused by: org.eigenbase.sql.parser.impl.ParseException: Encountered "/" at line 1, column 15.
Was expecting one of:
<IDENTIFIER> ...
<QUOTED_IDENTIFIER> ...
<UNICODE_QUOTED_IDENTIFIER> ...
"LATERAL" ...
"(" ...
"UNNEST" ...
"TABLE" ...
at org.eigenbase.sql.parser.impl.SqlParserImpl.generateParseException(SqlParserImpl.java:15443)
at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_consume_token(SqlParserImpl.java:15272)
at org.eigenbase.sql.parser.impl.SqlParserImpl.TableRef(SqlParserImpl.java:1423)
at org.eigenbase.sql.parser.impl.SqlParserImpl.FromClause(SqlParserImpl.java:1286)
at org.eigenbase.sql.parser.impl.SqlParserImpl.SqlSelect(SqlParserImpl.java:633)
at org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQuery(SqlParserImpl.java:399)
at org.eigenbase.sql.parser.impl.SqlParserImpl.LeafQueryOrExpr(SqlParserImpl.java:2055)
at org.eigenbase.sql.parser.impl.SqlParserImpl.QueryOrExpr(SqlParserImpl.java:2017)
at org.eigenbase.sql.parser.impl.SqlParserImpl.OrderedQueryOrExpr(SqlParserImpl.java:377)
at org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:573)
at org.eigenbase.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:599)
at org.eigenbase.sql.parser.SqlParser.parseStmt(SqlParser.java:130)
... 11 more
0: jdbc:drill:schema>
------------------ 原始邮件 ------------------
发件人: "Yash Sharma"<ya...@gmail.com>;
发送时间: 2014年5月23日(星期五) 下午2:04
收件人: "drill-user"<dr...@incubator.apache.org>;
主题: Re: 回复: Have some trouble in querying json files
Hi,
Please try to paste the text error trace directly rather than
screenshots/images.
We are unable to view the images in the mail.
Peace,
Yash
On Fri, May 23, 2014 at 9:32 AM, 南在南方 <i0...@qq.com> wrote:
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Jason Altekruse";<al...@gmail.com>;
> *发送时间:* 2014年5月22日(星期四) 晚上11:29
> *收件人:* "Apache Drill User"<dr...@incubator.apache.org>;
> *主题:* Re: Have some trouble in querying json files
>
> The image didn't show up for me, do you want to throw it on an image
> hosting service like imgur and post a link?
>
> -Jason Altekruse
>
>
> On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
>
> > hi,
> > When I use drill to query json files , error occurs . here is my error
> > report :
> >
> > and my drill storage-engines.json configuration :
> > {
> > "storage":{
> > "parquet-local" :
> > {
> > "type":"parquet",
> > "dfsName" : "file:///"
> > },
> > "parquet-cp" :
> > {
> > "type":"parquet",
> > "dfsName" : "classpath:///"
> > },
> > "jsonl" :
> > {
> > "type":"json",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > },
> > "json-cp" :
> > {
> > "type":"json",
> > "dfsName" : "classpath:///"
> > },
> > "parquet" :
> > {
> > "type":"parquet",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > }
> > }
> > }
> >
> > I also have some trouble in querying csv file. How should I config my
> > drill storage-engines.json file?
> > thanks
> >
>
>
Re: 回复: Have some trouble in querying json files
Posted by Yash Sharma <ya...@gmail.com>.
Hi,
Please try to paste the text error trace directly rather than
screenshots/images.
We are unable to view the images in the mail.
Peace,
Yash
On Fri, May 23, 2014 at 9:32 AM, 南在南方 <i0...@qq.com> wrote:
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Jason Altekruse";<al...@gmail.com>;
> *发送时间:* 2014年5月22日(星期四) 晚上11:29
> *收件人:* "Apache Drill User"<dr...@incubator.apache.org>;
> *主题:* Re: Have some trouble in querying json files
>
> The image didn't show up for me, do you want to throw it on an image
> hosting service like imgur and post a link?
>
> -Jason Altekruse
>
>
> On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
>
> > hi,
> > When I use drill to query json files , error occurs . here is my error
> > report :
> >
> > and my drill storage-engines.json configuration :
> > {
> > "storage":{
> > "parquet-local" :
> > {
> > "type":"parquet",
> > "dfsName" : "file:///"
> > },
> > "parquet-cp" :
> > {
> > "type":"parquet",
> > "dfsName" : "classpath:///"
> > },
> > "jsonl" :
> > {
> > "type":"json",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > },
> > "json-cp" :
> > {
> > "type":"json",
> > "dfsName" : "classpath:///"
> > },
> > "parquet" :
> > {
> > "type":"parquet",
> > "dfsName" : "hdfs://localhost:9000/user/bevin"
> > }
> > }
> > }
> >
> > I also have some trouble in querying csv file. How should I config my
> > drill storage-engines.json file?
> > thanks
> >
>
>
回复: Have some trouble in querying json files
Posted by 南在南方 <i0...@qq.com>.
------------------ 原始邮件 ------------------
发件人: "Jason Altekruse";<al...@gmail.com>;
发送时间: 2014年5月22日(星期四) 晚上11:29
收件人: "Apache Drill User"<dr...@incubator.apache.org>;
主题: Re: Have some trouble in querying json files
The image didn't show up for me, do you want to throw it on an image
hosting service like imgur and post a link?
-Jason Altekruse
On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
> hi,
> When I use drill to query json files , error occurs . here is my error
> report :
>
> and my drill storage-engines.json configuration :
> {
> "storage":{
> "parquet-local" :
> {
> "type":"parquet",
> "dfsName" : "file:///"
> },
> "parquet-cp" :
> {
> "type":"parquet",
> "dfsName" : "classpath:///"
> },
> "jsonl" :
> {
> "type":"json",
> "dfsName" : "hdfs://localhost:9000/user/bevin"
> },
> "json-cp" :
> {
> "type":"json",
> "dfsName" : "classpath:///"
> },
> "parquet" :
> {
> "type":"parquet",
> "dfsName" : "hdfs://localhost:9000/user/bevin"
> }
> }
> }
>
> I also have some trouble in querying csv file. How should I config my
> drill storage-engines.json file?
> thanks
>
Re: Have some trouble in querying json files
Posted by Jason Altekruse <al...@gmail.com>.
The image didn't show up for me, do you want to throw it on an image
hosting service like imgur and post a link?
-Jason Altekruse
On Thu, May 22, 2014 at 8:53 AM, 南在南方 <i0...@qq.com> wrote:
> hi,
> When I use drill to query json files , error occurs . here is my error
> report :
>
> and my drill storage-engines.json configuration :
> {
> "storage":{
> "parquet-local" :
> {
> "type":"parquet",
> "dfsName" : "file:///"
> },
> "parquet-cp" :
> {
> "type":"parquet",
> "dfsName" : "classpath:///"
> },
> "jsonl" :
> {
> "type":"json",
> "dfsName" : "hdfs://localhost:9000/user/bevin"
> },
> "json-cp" :
> {
> "type":"json",
> "dfsName" : "classpath:///"
> },
> "parquet" :
> {
> "type":"parquet",
> "dfsName" : "hdfs://localhost:9000/user/bevin"
> }
> }
> }
>
> I also have some trouble in querying csv file. How should I config my
> drill storage-engines.json file?
> thanks
>