[ 
https://issues.apache.org/jira/browse/KYLIN-2671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16053570#comment-16053570
 ] 

hongbin ma commented on KYLIN-2671:
-----------------------------------

please check org.apache.kylin.jdbc.KylinConnection#mockPreparedSignature, 
currently the result of Kylin JDBC's 
java.sql.Connection#prepareStatement(java.lang.String) method is mocked, which 
means:  You get a mocked statement metadata  from prepareStatement before you 
call java.sql.PreparedStatement#executeQuery(), it's okay if you use JDBC in 
following way:

{code:java}
 PreparedStatement statement = conn.prepareStatement("select LSTG_FORMAT_NAME, 
sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact " + "where 
LSTG_FORMAT_NAME = ? group by LSTG_FORMAT_NAME");
        statement.setString(1, "FP-GTC");
        ResultSet rs = statement.executeQuery();
{code}

however it's not okay to:

{code:java}
 PreparedStatement statement = conn.prepareStatement("select LSTG_FORMAT_NAME, 
sum(price) as GMV, count(1) as TRANS_CNT from test_kylin_fact " + "where 
LSTG_FORMAT_NAME = ? group by LSTG_FORMAT_NAME");
        ResultSetMetaData metaData = statement.getMetaData();
        // do something with metaData here will be problematical because 
metaData is merely a mock 
        statement.setString(1, "FP-GTC");
        ResultSet rs = statement.executeQuery();  
{code}

> Speed up prepared query execution
> ---------------------------------
>
>                 Key: KYLIN-2671
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2671
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter: hongbin ma
>
> BI tools use prepared query for function probing, kylin should not execute 
> such queries in standard way because it is too costly.
> It's still worth mentioning standard "prepare-bindparameter-execute" way of 
> PreparedStatement is still not supported. By now kylin only support Prepared 
> Statements WITHOUT parameters.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to