@@ -37,7 +37,7 @@ public ResultSet executeQuery() throws SQLException {
37
37
38
38
conn .beforeExecute ();
39
39
try {
40
- ObjectResult extractor = getObjectResult (true , getSql (), false , false , true );
40
+ ObjectResult extractor = getObjectResult (true , false , false , true );
41
41
List <String > headers = extractor .getHeaders ();
42
42
List <List <Object >> lines = extractor .getLines ();
43
43
@@ -67,7 +67,7 @@ public boolean execute() throws SQLException {
67
67
68
68
conn .beforeExecute ();
69
69
try {
70
- ObjectResult extractor = getObjectResult (true , getSql (), false , false , true );
70
+ ObjectResult extractor = getObjectResult (true , false , false , true );
71
71
List <String > headers = extractor .getHeaders ();
72
72
List <List <Object >> lines = extractor .getLines ();
73
73
@@ -84,11 +84,10 @@ public boolean execute() throws SQLException {
84
84
}
85
85
}
86
86
87
- private ObjectResult getObjectResult (boolean flat , String query , boolean includeScore , boolean includeType , boolean includeId ) throws SqlParseException , SQLFeatureNotSupportedException , Exception , CsvExtractorException {
87
+ private ObjectResult getObjectResult (boolean flat , boolean includeScore , boolean includeType , boolean includeId ) throws SqlParseException , SQLFeatureNotSupportedException , Exception , CsvExtractorException {
88
88
SearchDao searchDao = new org .nlpcn .es4sql .SearchDao (client );
89
89
90
- //String rewriteSQL = searchDao.explain(getSql()).explain().explain();
91
-
90
+ String query = ((ElasticSearchPreparedStatement ) getRawPreparedStatement ()).getExecutableSql ();
92
91
QueryAction queryAction = searchDao .explain (query );
93
92
Object execution = QueryActionElasticExecutor .executeAnyAction (searchDao .getClient (), queryAction );
94
93
return new ObjectResultsExtractor (includeScore , includeType , includeId , false , queryAction ).extractResults (execution , flat );
0 commit comments