16
16
import java .util .Map ;
17
17
import java .util .Set ;
18
18
import java .util .concurrent .ConcurrentHashMap ;
19
- import net .snowflake .client .core .CancellationReason ;
20
- import net .snowflake .client .core .ExecTimeTelemetryData ;
21
- import net .snowflake .client .core .ParameterBindingDTO ;
22
- import net .snowflake .client .core .ResultUtil ;
23
- import net .snowflake .client .core .SFBaseResultSet ;
24
- import net .snowflake .client .core .SFBaseStatement ;
25
- import net .snowflake .client .core .SFException ;
26
- import net .snowflake .client .core .SFStatement ;
27
- import net .snowflake .client .core .StmtUtil ;
19
+
20
+ import net .snowflake .client .core .*;
28
21
import net .snowflake .client .log .SFLogger ;
29
22
import net .snowflake .client .log .SFLoggerFactory ;
30
23
import net .snowflake .client .util .VariableTypeArray ;
@@ -146,7 +139,7 @@ public ResultSet executeQuery(String sql) throws SQLException {
146
139
new ExecTimeTelemetryData ("ResultSet Statement.executeQuery(String)" , this .batchID );
147
140
148
141
raiseSQLExceptionIfStatementIsClosed ();
149
- ResultSet rs = executeQueryInternal (sql , null , false , null , execTimeData );
142
+ ResultSet rs = executeQueryInternal (sql , false , null , execTimeData );
150
143
execTimeData .setQueryEnd ();
151
144
execTimeData .generateTelemetry ();
152
145
logger .debug ("Query completed. {}" , execTimeData .getLogString ());
@@ -164,7 +157,7 @@ public ResultSet executeAsyncQuery(String sql) throws SQLException {
164
157
ExecTimeTelemetryData execTimeData =
165
158
new ExecTimeTelemetryData ("ResultSet Statement.executeAsyncQuery(String)" , this .batchID );
166
159
raiseSQLExceptionIfStatementIsClosed ();
167
- ResultSet rs = executeQueryInternal (sql , null , true , null , execTimeData );
160
+ ResultSet rs = executeQueryInternal (sql , true , null , execTimeData );
168
161
execTimeData .setQueryEnd ();
169
162
execTimeData .generateTelemetry ();
170
163
logger .debug ("Query completed. {}" , queryID , execTimeData .getLogString ());
@@ -178,6 +171,7 @@ public ResultSet executeAsyncQuery(String sql) throws SQLException {
178
171
* @return ResultSet
179
172
* @throws SQLException if @link{#executeQueryInternal(String, Map)} throws an exception
180
173
*/
174
+ @ SnowflakeJdbcInternalApi
181
175
public ResultSet executeDataframeAst (String dataframeAst ) throws SQLException {
182
176
ExecTimeTelemetryData execTimeData =
183
177
new ExecTimeTelemetryData ("ResultSet Statement.executeQuery(String)" , this .batchID );
@@ -281,6 +275,23 @@ private void setQueryIdWhenValidOrNull(String queryId) {
281
275
this .queryID = null ;
282
276
}
283
277
}
278
+ /**
279
+ * Internal method for executing a query with bindings accepted.
280
+ *
281
+ * @param sql sql statement
282
+ * @param asyncExec execute query asynchronously
283
+ * @param parameterBindings parameters bindings
284
+ * @return query result set
285
+ * @throws SQLException if @link{SFStatement.execute(String)} throws exception
286
+ */
287
+ ResultSet executeQueryInternal (
288
+ String sql ,
289
+ boolean asyncExec ,
290
+ Map <String , ParameterBindingDTO > parameterBindings ,
291
+ ExecTimeTelemetryData execTimeData )
292
+ throws SQLException {
293
+ return executeQueryInternal (sql ,null , asyncExec , parameterBindings , execTimeData );
294
+ }
284
295
285
296
/**
286
297
* Internal method for executing a query with bindings accepted.
@@ -292,6 +303,7 @@ private void setQueryIdWhenValidOrNull(String queryId) {
292
303
* @return query result set
293
304
* @throws SQLException if @link{SFStatement.execute(String)} throws exception
294
305
*/
306
+ @ SnowflakeJdbcInternalApi
295
307
ResultSet executeQueryInternal (
296
308
String sql ,
297
309
String dataframeAst ,
0 commit comments