hit-lacus commented on pull request #1490:
URL: https://github.com/apache/kylin/pull/1490#issuecomment-735637532
For `sql_dynamic`, I think there are some difference
```java
protected ITable executeDynamicQuery(IDatabaseConnection dbConn, String
queryName, String sql,
List<String> parameters, boolean needSort) throws Exception {
QueryContextFacade.resetCurrent();
QueryContextFacade.current().setProject(ProjectInstance.DEFAULT_PROJECT_NAME);
// change join type to match current setting
sql = changeJoinType(sql, joinType);
PreparedStatement prepStat =
dbConn.getConnection().prepareStatement(sql);
for (int j = 1; j <= parameters.size(); ++j) {
prepStat.setString(j, parameters.get(j - 1).trim());
}
ITable queryTable = dbConn.createTable(resultTableName + queryName,
prepStat);
String[] columnNames = new
String[queryTable.getTableMetaData().getColumns().length];
for (int i = 0; i < columnNames.length; i++) {
columnNames[i] =
queryTable.getTableMetaData().getColumns()[i].getColumnName();
}
if (needSort) {
queryTable = new SortedTable(queryTable, columnNames);
}
if (PRINT_RESULT)
printResult(queryTable);
return queryTable;
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]