incubator-drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "南在南方" <i02...@qq.com>
Subject 回复: Have some trouble in querying json files
Date Fri, 23 May 2014 07:19:54 GMT
Sorry.I have tried with '`' and ''' alreally. But doesn't works.
0: jdbc:drill:schema=dfs> select * from `/home/bevin/AllstarFull.csv`;
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: Lexical error at line 1, column 15.
 Encountered: "`" (96), after : ""
	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.TokenMgrError: Lexical error at line 1, column 15.
 Encountered: "`" (96), after : ""
	at org.eigenbase.sql.parser.impl.SqlParserImplTokenManager.getNextToken(SqlParserImplTokenManager.java:4924)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_scan_token(SqlParserImpl.java:15281)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_3_245(SqlParserImpl.java:14738)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_3R_38(SqlParserImpl.java:14750)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_3R_42(SqlParserImpl.java:14643)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_3_73(SqlParserImpl.java:14951)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.jj_2_73(SqlParserImpl.java:5338)
	at org.eigenbase.sql.parser.impl.SqlParserImpl.TableRef(SqlParserImpl.java:1379)
	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=dfs> 





0: jdbc:drill:schema=dfs> select * from '/home/bevin/AllstarFull.csv';
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 "\'/home/bevin/AllstarFull.csv\'"
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 "\'/home/bevin/AllstarFull.csv\'"
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=dfs> 







------------------ 原始邮件 ------------------
发件人: "Ramana Inukonda";<rinukonda@maprtech.com>;
发送时间: 2014年5月23日(星期五) 下午3:14
收件人: "drill-user@incubator.apache.org"<drill-user@incubator.apache.org>; 

主题: Re: Have some trouble in querying json files



Can you use back ticks please.

On Friday, May 23, 2014, 南在南方 <i02389@qq.com> wrote:

> got it
> here is the error report:
> 0: jdbc:drill:schema=dfs> select * from "/home/bevin/AllstarFull.csv";
> 五月 23, 2014 3:07:38 下午 org.eigenbase.sql.validate.SqlValidatorException
> <init>
> 严重: org.eigenbase.sql.validate.SqlValidatorException: Table
> '/home/bevin/AllstarFull.csv' not found
> 五月 23, 2014 3:07:38 下午 org.eigenbase.util.EigenbaseException <init>
> 严重: org.eigenbase.util.EigenbaseContextException: From line 1, column 15
> to line 1, column 43
> org.eigenbase.util.EigenbaseContextException: From line 1, column 15 to
> line 1, column 43
>         at
> org.eigenbase.resource.EigenbaseResource$_Def12.ex(EigenbaseResource.java:1026)
>         at org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:739)
>         at org.eigenbase.sql.SqlUtil.newContextException(SqlUtil.java:726)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:3830)
>         at
> org.eigenbase.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:78)
>         at
> org.eigenbase.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:90)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:802)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:790)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2776)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3013)
>         at
> org.eigenbase.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:69)
>         at
> org.eigenbase.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:90)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:802)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:790)
>         at org.eigenbase.sql.SqlSelect.validate(SqlSelect.java:154)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:753)
>         at
> org.eigenbase.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:444)
>         at
> org.eigenbase.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:445)
>         at
> net.hydromatic.optiq.prepare.Prepare.prepareSql(Prepare.java:160)
>         at
> net.hydromatic.optiq.prepare.Prepare.prepareSql(Prepare.java:129)
>         at
> net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:255)
>         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.validate.SqlValidatorException: Table
> '/home/bevin/AllstarFull.csv' not found
>         at
> org.eigenbase.resource.EigenbaseResource$_Def9.ex(EigenbaseResource.java:963)
>         ... 27 more
> 0: jdbc:drill:schema=dfs>
>
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Ramana Inukonda"<rinukonda@maprtech.com <javascript:;>>;
> 发送时间: 2014年5月23日(星期五) 下午3:04
> 收件人: "drill-user"<drill-user@incubator.apache.org <javascript:;>>;
> 主题: Re: Have some trouble in querying json files
>
>
>
> In the storage plugins file I sent replace the maprfs:/// with file:///
>
> Regards
> Ramana
>
> On Thursday, May 22, 2014, 南在南方 <i02389@qq.com <javascript:;>> wrote:
>
> > I conn't tell what is "maprfs with file" ,could you more specific? I'm
> new
> > to Drill. thanks.
> >
> >
> >
> >
> > ------------------ 原始邮件 ------------------
> > 发件人: "Ramana Inukonda"<rinukonda@maprtech.com <javascript:;><javascript:;>>;
> > 发送时间: 2014年5月23日(星期五) 下午2:48
> > 收件人: "drill-user"<drill-user@incubator.apache.org <javascript:;><javascript:;>>;
> > 主题: Re: Have some trouble in querying json files
> >
> >
> >
> > Please substitute maprfs with file if you are using a local file.
> >
> > Regards
> > Ramana
> >
> > On Thursday, May 22, 2014, Ramana Inukonda <rinukonda@maprtech.com<javascript:;>
> <javascript:;>>
> > 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:;><javascript:;>
> > <javascript:_e(%7B%7D,'cvml','i02389@qq.com <javascript:;><javascript:;>');>
> > > > 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"<nrentachintala@maprtech.com>;
> > > 发送时间: 2014年5月23日(星期五) 中午1:48
> > > 收件人: "drill-user"<drill-user@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, 南在南方 <i02389@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(SqlPar
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message