[
https://issues.apache.org/jira/browse/LENS-126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14311476#comment-14311476
]
Arshad Matin commented on LENS-126:
-----------------------------------
*Validation*
{noformat}
lens-shell>query execute cube select id,name as `alias` from sample_db_dim
order by `alias`
ID NAME
Results of query stored at :
hdfs://192.168.138.99:8020/tmp/lensreports/dc90a47c-5ebd-41b2-8b2a-9faecc621395.csv
3 rows process in (1) seconds.
lens-shell>
{noformat}
> jdbc rewrite error while using alias name in order by
> -----------------------------------------------------
>
> Key: LENS-126
> URL: https://issues.apache.org/jira/browse/LENS-126
> Project: Apache Lens
> Issue Type: Bug
> Reporter: Raghavendra Singh
> Assignee: Sushil Mohanty
> Fix For: 2.0
>
> Attachments: LENS-126.patch
>
>
> for a query having:
> select col1 as alias1 . . . order by alias1 desc limit 10
> the rewritten query misses the alias name and is rewritten as:-
> order by desc limit 10
> error message:-
> {CODE}
> You have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near 'desc limit 10'
> at line 1
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
> at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
> at com.mysql.jdbc.Connection.execSQL(Connection.java:3206)
> at com.mysql.jdbc.Statement.execute(Statement.java:727)
> at
> com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:1006)
> at
> org.apache.lens.driver.jdbc.JDBCDriver$QueryCallable.call(JDBCDriver.java:299)
> at
> org.apache.lens.driver.jdbc.JDBCDriver.executeInternal(JDBCDriver.java:694)
> at org.apache.lens.driver.jdbc.JDBCDriver.explain(JDBCDriver.java:573)
> ... 5 more
> {CODE}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)