Uploaded image for project: 'Apache Lens'
  1. Apache Lens
  2. LENS-969

Literals with escaped quotes are not working with hsql db

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: client
    • Labels:
      None

      Description

      lens-shell>query execute cube select id,name from sample_db_dim where name in ('first\'s')

      Rewritten query :
      select ( mydb_dim_table3__sample_db_dim . id ), ( mydb_dim_table3_sample_db_dim . name ) from mydb_dim_table3 mydb_dim_table3_sample_db_dim where ( mydb_dim_table3__sample_db_dim . name ) in ( 'first\'s' )

      CLI error:
      Command failed org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html;charset=ISO-8859-1, type=class org.apache.lens.api.result.LensAPIResult, genericType=class org.apache.lens.api.result.LensAPIResult.
      
      org.apache.lens.server.api.error.LensException: SEMANTIC_ERROR[unexpected token: S required: )]
              at org.apache.lens.driver.jdbc.JDBCDriver.handleJDBCSQLException(JDBCDriver.java:824) ~[lens-driver-jdbc-2.5.0-beta-SNAPSHOT.jar:2.5.0-beta-SNAPSHOT]
              at org.apache.lens.driver.jdbc.JDBCDriver.prepareInternal(JDBCDriver.java:800) ~[lens-driver-jdbc-2.5.0-beta-SNAPSHOT.jar:2.5.0-beta-SNAPSHOT]
              at org.apache.lens.driver.jdbc.JDBCDriver.validate(JDBCDriver.java:678) ~[lens-driver-jdbc-2.5.0-beta-SNAPSHOT.jar:2.5.0-beta-SNAPSHOT]
              at org.apache.lens.driver.jdbc.JDBCDriver.estimate(JDBCDriver.java:607) ~[lens-driver-jdbc-2.5.0-beta-SNAPSHOT.jar:2.5.0-beta-SNAPSHOT]
              at org.apache.lens.server.api.query.AbstractQueryContext$DriverEstimateRunnable.run(AbstractQueryContext.java:250) ~[lens-server-api-2.5.0-beta-SNAPSHOT.jar:2.5.0-beta-SNAPSHOT]
              at org.apache.lens.server.query.QueryExecutionServiceImpl$RewriteEstimateRunnable.run(QueryExecutionServiceImpl.java:1430) [classes/:na]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_40]
              at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_40]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_40]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_40]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
      Caused by: java.sql.SQLException: A problem occurred while trying to acquire a cached PreparedStatement in a background thread.
              at com.mchange.v2.c3p0.stmt.GooGooStatementCache.acquireStatement(GooGooStatementCache.java:571) ~[c3p0-0.9.5.jar:0.9.5]
              at com.mchange.v2.c3p0.stmt.GooGooStatementCache.checkoutStatement(GooGooStatementCache.java:204) ~[c3p0-0.9.5.jar:0.9.5]
              at com.mchange.v2.c3p0.impl.NewPooledConnection.checkoutStatement(NewPooledConnection.java:321) ~[c3p0-0.9.5.jar:0.9.5]
              at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:455) ~[c3p0-0.9.5.jar:0.9.5]
              at org.apache.lens.driver.jdbc.JDBCDriver.prepareInternal(JDBCDriver.java:795) ~[lens-driver-jdbc-2.5.0-beta-SNAPSHOT.jar:2.5.0-beta-SNAPSHOT]
              ... 9 common frames omitted
      Caused by: java.sql.SQLSyntaxErrorException: unexpected token: S required: )
              at org.hsqldb.jdbc.Util.sqlException(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.jdbc.Util.sqlException(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_40]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_40]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_40]
              at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_40]
              at com.mchange.v2.c3p0.stmt.GooGooStatementCache$1StmtAcquireTask.run(GooGooStatementCache.java:546) ~[c3p0-0.9.5.jar:0.9.5]
              at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) ~[mchange-commons-java-0.2.9.jar:0.2.9]
      Caused by: org.hsqldb.HsqlException: unexpected token: S required: )
              at org.hsqldb.error.Error.parseError(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserBase.unexpectedTokenRequire(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserBase.readThis(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadInPredicateRightPart(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadPredicateRightPart(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadBooleanPrimaryOrNull(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadBooleanTestOrNull(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadBooleanFactorOrNull(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadBooleanTermOrNull(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadBooleanValueExpression(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.readWhereGroupHaving(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadTableExpression(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserCommand.compilePart(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.ParserCommand.compileStatement(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.Session.compileStatement(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.StatementManager.compile(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
              at org.hsqldb.Session.execute(Unknown Source) ~[hsqldb-2.2.9.jar:2.2.9]
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              archana.h Archana H
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: