OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ai.heavy.jdbc.HeavyAIStatement Class Reference
+ Inheritance diagram for ai.heavy.jdbc.HeavyAIStatement:
+ Collaboration diagram for ai.heavy.jdbc.HeavyAIStatement:

Public Member Functions

ResultSet executeQuery (String sql) throws SQLException
 
void cancel () throws SQLException
 
int executeUpdate (String sql) throws SQLException
 
void close () throws SQLException
 
int getMaxFieldSize () throws SQLException
 
void setMaxFieldSize (int max) throws SQLException
 
int getMaxRows () throws SQLException
 
void setMaxRows (int max) throws SQLException
 
void setEscapeProcessing (boolean enable) throws SQLException
 
int getQueryTimeout () throws SQLException
 
int getQueryInternalExecuteTime () throws SQLException
 
void setQueryTimeout (int seconds) throws SQLException
 
SQLWarning getWarnings () throws SQLException
 
void clearWarnings () throws SQLException
 
void setCursorName (String name) throws SQLException
 
boolean execute (String sql) throws SQLException
 
ResultSet getResultSet () throws SQLException
 
int getUpdateCount () throws SQLException
 
boolean getMoreResults () throws SQLException
 
void setFetchDirection (int direction) throws SQLException
 
int getFetchDirection () throws SQLException
 
void setFetchSize (int rows) throws SQLException
 
int getFetchSize () throws SQLException
 
int getResultSetConcurrency () throws SQLException
 
int getResultSetType () throws SQLException
 
void addBatch (String sql) throws SQLException
 
void clearBatch () throws SQLException
 
int[] executeBatch () throws SQLException
 
Connection getConnection () throws SQLException
 
boolean getMoreResults (int current) throws SQLException
 
ResultSet getGeneratedKeys () throws SQLException
 
int executeUpdate (String sql, int autoGeneratedKeys) throws SQLException
 
int executeUpdate (String sql, int[] columnIndexes) throws SQLException
 
int executeUpdate (String sql, String[] columnNames) throws SQLException
 
boolean execute (String sql, int autoGeneratedKeys) throws SQLException
 
boolean execute (String sql, int[] columnIndexes) throws SQLException
 
boolean execute (String sql, String[] columnNames) throws SQLException
 
int getResultSetHoldability () throws SQLException
 
boolean isClosed () throws SQLException
 
void setPoolable (boolean poolable) throws SQLException
 
boolean isPoolable () throws SQLException
 
void closeOnCompletion () throws SQLException
 
boolean isCloseOnCompletion () throws SQLException
 
boolean isWrapperFor (Class<?> iface) throws SQLException
 

Static Public Member Functions

static String simplisticDateTransform (String sql)
 

Public Attributes

SQLWarning rootWarning = null
 

Package Functions

 HeavyAIStatement (String tsession, HeavyAIConnection tconnection)
 
public< T > T unwrap (Class< T > iface) throws SQLException
 

Static Package Attributes

static final org.slf4j.Logger logger = LoggerFactory.getLogger(HeavyAIStatement.class)
 
static Pattern top_pattern
 

Private Member Functions

void checkClosed () throws SQLException
 

Private Attributes

String session
 
Heavy.Client client
 
HeavyAIConnection connection
 
ResultSet currentRS = null
 
TQueryResult sqlResult = null
 
int maxRows
 
boolean escapeProcessing = false
 
boolean isClosed = false
 

Static Private Attributes

static final Pattern QUARTER
 
static final Pattern DAYOFYEAR
 
static final Pattern DAYOFWEEK
 
static final Pattern WEEK
 
static final Pattern CURRENTDATE
 

Detailed Description

Author
michael

Definition at line 36 of file HeavyAIStatement.java.

Constructor & Destructor Documentation

ai.heavy.jdbc.HeavyAIStatement.HeavyAIStatement ( String  tsession,
HeavyAIConnection  tconnection 
)
inlinepackage

Member Function Documentation

void ai.heavy.jdbc.HeavyAIStatement.addBatch ( String  sql) throws SQLException
inline

Definition at line 317 of file HeavyAIStatement.java.

317  { // logger.debug("Entered");
318  throw new UnsupportedOperationException("Not supported yet,"
319  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
320  + " class:" + new Throwable().getStackTrace()[0].getClassName()
321  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
322  }
void ai.heavy.jdbc.HeavyAIStatement.cancel ( ) throws SQLException
inline

Definition at line 111 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.checkClosed(), ai.heavy.jdbc.HeavyAIExceptionText.getExceptionDetail(), and ai.heavy.jdbc.HeavyAIStatement.session.

111  { // logger.debug("Entered");
112  checkClosed();
113  HeavyAIConnection alternate_connection = null;
114  try {
115  alternate_connection = connection.getAlternateConnection();
116  // Note alternate_connection shares a session with original connection
117  alternate_connection.client.interrupt(session, session);
118  } catch (TDBException ttE) {
119  throw new SQLException("Thrift transport connection failed - "
120  + HeavyAIExceptionText.getExceptionDetail(ttE),
121  ttE);
122  } catch (TException tE) {
123  throw new SQLException(
124  "Thrift failed - " + HeavyAIExceptionText.getExceptionDetail(tE), tE);
125  } finally {
126  // Note closeConnection only closes the underlying thrft connection
127  // not the logical db session connection
128  alternate_connection.closeConnection();
129  }
130  }

+ Here is the call graph for this function:

void ai.heavy.jdbc.HeavyAIStatement.checkClosed ( ) throws SQLException
inlineprivate

Definition at line 544 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.isClosed().

Referenced by ai.heavy.jdbc.HeavyAIStatement.cancel(), ai.heavy.jdbc.HeavyAIStatement.executeQuery(), ai.heavy.jdbc.HeavyAIStatement.executeUpdate(), ai.heavy.jdbc.HeavyAIStatement.getMoreResults(), ai.heavy.jdbc.HeavyAIStatement.getResultSet(), and ai.heavy.jdbc.HeavyAIStatement.getUpdateCount().

544  {
545  if (isClosed) {
546  throw new SQLException("Statement is closed.");
547  }
548  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIStatement.clearBatch ( ) throws SQLException
inline

Definition at line 325 of file HeavyAIStatement.java.

325  { // logger.debug("Entered");
326  throw new UnsupportedOperationException("Not supported yet,"
327  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
328  + " class:" + new Throwable().getStackTrace()[0].getClassName()
329  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
330  }
void ai.heavy.jdbc.HeavyAIStatement.clearWarnings ( ) throws SQLException
inline

Definition at line 224 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

224  { // logger.debug("Entered");
225  rootWarning = null;
226  }
void ai.heavy.jdbc.HeavyAIStatement.close ( ) throws SQLException
inline

Definition at line 156 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.currentRS, and ai.heavy.jdbc.HeavyAIStatement.isClosed().

Referenced by heavydb.connection.Connection.__del__(), heavydb.cursor.Cursor.__exit__(), and heavydb.connection.Connection.__exit__().

156  { // logger.debug("Entered");
157  if (currentRS != null) {
158  currentRS.close();
159  }
160  isClosed = true;
161  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ai.heavy.jdbc.HeavyAIStatement.closeOnCompletion ( ) throws SQLException
inline

Definition at line 447 of file HeavyAIStatement.java.

447  { // logger.debug("Entered");
448  throw new UnsupportedOperationException("Not supported yet,"
449  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
450  + " class:" + new Throwable().getStackTrace()[0].getClassName()
451  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
452  }
boolean ai.heavy.jdbc.HeavyAIStatement.execute ( String  sql) throws SQLException
inline

Definition at line 237 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.executeQuery().

Referenced by heavydb.cursor.Cursor.executemany().

237  { // logger.debug("Entered");
238  ResultSet rs = executeQuery(sql);
239  if (rs != null) {
240  return true;
241  } else {
242  return false;
243  }
244  }
ResultSet executeQuery(String sql)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

boolean ai.heavy.jdbc.HeavyAIStatement.execute ( String  sql,
int  autoGeneratedKeys 
) throws SQLException
inline

Definition at line 390 of file HeavyAIStatement.java.

Referenced by heavydb.cursor.Cursor.executemany().

391  { // logger.debug("Entered");
392  throw new UnsupportedOperationException("Not supported yet,"
393  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
394  + " class:" + new Throwable().getStackTrace()[0].getClassName()
395  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
396  }

+ Here is the caller graph for this function:

boolean ai.heavy.jdbc.HeavyAIStatement.execute ( String  sql,
int[]  columnIndexes 
) throws SQLException
inline

Definition at line 399 of file HeavyAIStatement.java.

Referenced by heavydb.cursor.Cursor.executemany().

400  { // logger.debug("Entered");
401  throw new UnsupportedOperationException("Not supported yet,"
402  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
403  + " class:" + new Throwable().getStackTrace()[0].getClassName()
404  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
405  }

+ Here is the caller graph for this function:

boolean ai.heavy.jdbc.HeavyAIStatement.execute ( String  sql,
String[]  columnNames 
) throws SQLException
inline

Definition at line 408 of file HeavyAIStatement.java.

Referenced by heavydb.cursor.Cursor.executemany().

409  { // logger.debug("Entered");
410  throw new UnsupportedOperationException("Not supported yet,"
411  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
412  + " class:" + new Throwable().getStackTrace()[0].getClassName()
413  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
414  }

+ Here is the caller graph for this function:

int [] ai.heavy.jdbc.HeavyAIStatement.executeBatch ( ) throws SQLException
inline

Definition at line 333 of file HeavyAIStatement.java.

333  { // logger.debug("Entered");
334  throw new UnsupportedOperationException("Not supported yet,"
335  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
336  + " class:" + new Throwable().getStackTrace()[0].getClassName()
337  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
338  }
ResultSet ai.heavy.jdbc.HeavyAIStatement.executeQuery ( String  sql) throws SQLException
inline

Definition at line 60 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.checkClosed(), ai.heavy.jdbc.HeavyAIStatement.currentRS, ai.heavy.jdbc.HeavyAIExceptionText.getExceptionDetail(), ai.heavy.jdbc.HeavyAIStatement.maxRows, ai.heavy.jdbc.HeavyAIStatement.session, ai.heavy.jdbc.HeavyAIStatement.simplisticDateTransform(), split(), and ai.heavy.jdbc.HeavyAIStatement.sqlResult.

Referenced by ai.heavy.jdbc.HeavyAIStatement.execute().

61  { // logger.debug("Entered");
62  checkClosed();
63  // @TODO: we can and probably should use "first_n" parameter of the
64  // sql_execute()
65  // endpoint to force the limit on the query, instead of rewriting it here.
66  if (maxRows >= 0) {
67  // add limit to sql call if it doesn't already have one and is a select
68  String[] tokens = sql.toLowerCase().split(" ", 3);
69  if (tokens[0].equals("select")) {
70  if (sql.toLowerCase().contains("limit")) {
71  // do nothing -
72  } else {
73  // Some applications add TOP <number> to limit the
74  // select statement rather than limit. Remove TOP and keep
75  // the number it used as the limit.
76  Matcher matcher = top_pattern.matcher(sql);
77  // Take "select TOP nnnn <rest ot sql>" and translate to select <reset of sql:
78  // limit nnnn
79  if (matcher.find()) {
80  maxRows = Integer.parseInt(matcher.group(1));
81  sql = top_pattern.matcher(sql).replaceAll("select ");
82  }
83 
84  sql = sql + " LIMIT " + maxRows;
85  logger.debug("Added LIMIT of " + maxRows);
86  }
87  }
88  }
89 
90  logger.debug("Before HeavyAIEscapeParser [" + sql + "]");
91  // The order of these to SQL re-writes is important.
92  // EscapeParse needs to come first.
93  String afterEscapeParseSQL = HeavyAIEscapeParser.parse(sql);
94  String afterSimpleParse = simplisticDateTransform(afterEscapeParseSQL);
95  logger.debug("After HeavyAIEscapeParser [" + afterSimpleParse + "]");
96  try {
97  sqlResult = client.sql_execute(session, afterSimpleParse + ";", true, null, -1, -1);
98  } catch (TDBException ex) {
99  throw new SQLException(
100  "Query failed : " + HeavyAIExceptionText.getExceptionDetail(ex));
101  } catch (TException ex) {
102  throw new SQLException(
103  "Query failed : " + HeavyAIExceptionText.getExceptionDetail(ex));
104  }
105 
106  currentRS = new HeavyAIResultSet(sqlResult, sql);
107  return currentRS;
108  }
static String simplisticDateTransform(String sql)
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ai.heavy.jdbc.HeavyAIStatement.executeUpdate ( String  sql) throws SQLException
inline

Definition at line 133 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.checkClosed(), ai.heavy.jdbc.HeavyAIExceptionText.getExceptionDetail(), ai.heavy.jdbc.HeavyAIStatement.session, and ai.heavy.jdbc.HeavyAIStatement.sqlResult.

133  { // logger.debug("Entered");
134  checkClosed();
135  try {
136  // remove " characters if it is a CREATE statement
137  if (sql.trim().substring(0, 6).compareToIgnoreCase("CREATE") == 0) {
138  sql = sql.replace('"', ' ');
139  }
140  sqlResult = client.sql_execute(session, sql + ";", true, null, -1, -1);
141  } catch (TDBException ex) {
142  throw new SQLException("Query failed : sql was '" + sql + "' "
143  + HeavyAIExceptionText.getExceptionDetail(ex),
144  ex);
145  } catch (TException ex) {
146  throw new SQLException(
147  "Query failed : " + HeavyAIExceptionText.getExceptionDetail(ex), ex);
148  }
149 
150  // TODO: OmniSciDB supports updates, inserts and deletes, but
151  // there is no way to get number of affected rows at the moment
152  return -1;
153  }

+ Here is the call graph for this function:

int ai.heavy.jdbc.HeavyAIStatement.executeUpdate ( String  sql,
int  autoGeneratedKeys 
) throws SQLException
inline

Definition at line 363 of file HeavyAIStatement.java.

364  { // logger.debug("Entered");
365  throw new UnsupportedOperationException("Not supported yet,"
366  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
367  + " class:" + new Throwable().getStackTrace()[0].getClassName()
368  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
369  }
int ai.heavy.jdbc.HeavyAIStatement.executeUpdate ( String  sql,
int[]  columnIndexes 
) throws SQLException
inline

Definition at line 372 of file HeavyAIStatement.java.

373  { // logger.debug("Entered");
374  throw new UnsupportedOperationException("Not supported yet,"
375  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
376  + " class:" + new Throwable().getStackTrace()[0].getClassName()
377  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
378  }
int ai.heavy.jdbc.HeavyAIStatement.executeUpdate ( String  sql,
String[]  columnNames 
) throws SQLException
inline

Definition at line 381 of file HeavyAIStatement.java.

382  { // logger.debug("Entered");
383  throw new UnsupportedOperationException("Not supported yet,"
384  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
385  + " class:" + new Throwable().getStackTrace()[0].getClassName()
386  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
387  }
Connection ai.heavy.jdbc.HeavyAIStatement.getConnection ( ) throws SQLException
inline

Definition at line 341 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.connection.

341  { // logger.debug("Entered");
342  return connection;
343  }
int ai.heavy.jdbc.HeavyAIStatement.getFetchDirection ( ) throws SQLException
inline

Definition at line 277 of file HeavyAIStatement.java.

277  { // logger.debug("Entered");
278  return ResultSet.FETCH_FORWARD;
279  }
int ai.heavy.jdbc.HeavyAIStatement.getFetchSize ( ) throws SQLException
inline

Definition at line 293 of file HeavyAIStatement.java.

293  { // logger.debug("Entered");
294  throw new UnsupportedOperationException("Not supported yet,"
295  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
296  + " class:" + new Throwable().getStackTrace()[0].getClassName()
297  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
298  }
ResultSet ai.heavy.jdbc.HeavyAIStatement.getGeneratedKeys ( ) throws SQLException
inline

Definition at line 355 of file HeavyAIStatement.java.

355  { // logger.debug("Entered");
356  throw new UnsupportedOperationException("Not supported yet,"
357  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
358  + " class:" + new Throwable().getStackTrace()[0].getClassName()
359  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
360  }
int ai.heavy.jdbc.HeavyAIStatement.getMaxFieldSize ( ) throws SQLException
inline

Definition at line 164 of file HeavyAIStatement.java.

164  { // logger.debug("Entered");
165  throw new UnsupportedOperationException("Not supported yet,"
166  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
167  + " class:" + new Throwable().getStackTrace()[0].getClassName()
168  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
169  }
int ai.heavy.jdbc.HeavyAIStatement.getMaxRows ( ) throws SQLException
inline

Definition at line 180 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.maxRows.

180  { // logger.debug("Entered");
181  return maxRows;
182  }
boolean ai.heavy.jdbc.HeavyAIStatement.getMoreResults ( ) throws SQLException
inline

Definition at line 261 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.checkClosed().

261  { // logger.debug("Entered");
262  checkClosed();
263  // TODO MAT this needs to be fixed for complex queries
264  return false;
265  }

+ Here is the call graph for this function:

boolean ai.heavy.jdbc.HeavyAIStatement.getMoreResults ( int  current) throws SQLException
inline

Definition at line 346 of file HeavyAIStatement.java.

347  { // logger.debug("Entered");
348  throw new UnsupportedOperationException("Not supported yet,"
349  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
350  + " class:" + new Throwable().getStackTrace()[0].getClassName()
351  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
352  }
int ai.heavy.jdbc.HeavyAIStatement.getQueryInternalExecuteTime ( ) throws SQLException
inline

Definition at line 201 of file HeavyAIStatement.java.

202  { // logger.debug("Entered");
203  return (int) sqlResult.execution_time_ms;
204  }
int ai.heavy.jdbc.HeavyAIStatement.getQueryTimeout ( ) throws SQLException
inline

Definition at line 196 of file HeavyAIStatement.java.

196  { // logger.debug("Entered");
197  return 0;
198  }
ResultSet ai.heavy.jdbc.HeavyAIStatement.getResultSet ( ) throws SQLException
inline

Definition at line 247 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.checkClosed(), and ai.heavy.jdbc.HeavyAIStatement.currentRS.

Referenced by ai.heavy.jdbc.HeavyAIPreparedStatement.getMetaData().

247  { // logger.debug("Entered");
248  checkClosed();
249  return currentRS;
250  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ai.heavy.jdbc.HeavyAIStatement.getResultSetConcurrency ( ) throws SQLException
inline

Definition at line 301 of file HeavyAIStatement.java.

301  { // logger.debug("Entered");
302  throw new UnsupportedOperationException("Not supported yet,"
303  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
304  + " class:" + new Throwable().getStackTrace()[0].getClassName()
305  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
306  }
int ai.heavy.jdbc.HeavyAIStatement.getResultSetHoldability ( ) throws SQLException
inline

Definition at line 417 of file HeavyAIStatement.java.

417  { // logger.debug("Entered");
418  throw new UnsupportedOperationException("Not supported yet,"
419  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
420  + " class:" + new Throwable().getStackTrace()[0].getClassName()
421  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
422  }
int ai.heavy.jdbc.HeavyAIStatement.getResultSetType ( ) throws SQLException
inline

Definition at line 309 of file HeavyAIStatement.java.

309  { // logger.debug("Entered");
310  throw new UnsupportedOperationException("Not supported yet,"
311  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
312  + " class:" + new Throwable().getStackTrace()[0].getClassName()
313  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
314  }
int ai.heavy.jdbc.HeavyAIStatement.getUpdateCount ( ) throws SQLException
inline

Definition at line 253 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.checkClosed().

253  { // logger.debug("Entered");
254  checkClosed();
255  // TODO: OmniSciDB supports updates, inserts and deletes, but
256  // there is no way to get number of affected rows at the moment
257  return -1;
258  }

+ Here is the call graph for this function:

SQLWarning ai.heavy.jdbc.HeavyAIStatement.getWarnings ( ) throws SQLException
inline

Definition at line 219 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

219  { // logger.debug("Entered");
220  return (rootWarning);
221  }
boolean ai.heavy.jdbc.HeavyAIStatement.isClosed ( ) throws SQLException
inline

Definition at line 425 of file HeavyAIStatement.java.

Referenced by ai.heavy.jdbc.HeavyAIStatement.checkClosed(), and ai.heavy.jdbc.HeavyAIStatement.close().

425  { // logger.debug("Entered");
426  return isClosed;
427  }

+ Here is the caller graph for this function:

boolean ai.heavy.jdbc.HeavyAIStatement.isCloseOnCompletion ( ) throws SQLException
inline

Definition at line 455 of file HeavyAIStatement.java.

455  { // logger.debug("Entered");
456  throw new UnsupportedOperationException("Not supported yet,"
457  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
458  + " class:" + new Throwable().getStackTrace()[0].getClassName()
459  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
460  }
boolean ai.heavy.jdbc.HeavyAIStatement.isPoolable ( ) throws SQLException
inline

Definition at line 439 of file HeavyAIStatement.java.

439  { // logger.debug("Entered");
440  throw new UnsupportedOperationException("Not supported yet,"
441  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
442  + " class:" + new Throwable().getStackTrace()[0].getClassName()
443  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
444  }
boolean ai.heavy.jdbc.HeavyAIStatement.isWrapperFor ( Class<?>  iface) throws SQLException
inline

Definition at line 471 of file HeavyAIStatement.java.

472  { // logger.debug("Entered");
473  throw new UnsupportedOperationException("Not supported yet,"
474  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
475  + " class:" + new Throwable().getStackTrace()[0].getClassName()
476  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
477  }
void ai.heavy.jdbc.HeavyAIStatement.setCursorName ( String  name) throws SQLException
inline

Definition at line 229 of file HeavyAIStatement.java.

229  { // logger.debug("Entered");
230  throw new UnsupportedOperationException("Not supported yet,"
231  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
232  + " class:" + new Throwable().getStackTrace()[0].getClassName()
233  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
234  }
void ai.heavy.jdbc.HeavyAIStatement.setEscapeProcessing ( boolean  enable) throws SQLException
inline

Definition at line 190 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.escapeProcessing.

191  { // logger.debug("Entered");
192  escapeProcessing = enable;
193  }
void ai.heavy.jdbc.HeavyAIStatement.setFetchDirection ( int  direction) throws SQLException
inline

Definition at line 268 of file HeavyAIStatement.java.

269  { // logger.debug("Entered");
270  throw new UnsupportedOperationException("Not supported yet,"
271  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
272  + " class:" + new Throwable().getStackTrace()[0].getClassName()
273  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
274  }
void ai.heavy.jdbc.HeavyAIStatement.setFetchSize ( int  rows) throws SQLException
inline

Definition at line 282 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

282  { // logger.debug("Entered");
283  SQLWarning warning = new SQLWarning(
284  "Query FetchSize are not supported. Substituting a value of zero.");
285  if (rootWarning == null) {
286  rootWarning = warning;
287  } else {
288  rootWarning.setNextWarning(warning);
289  }
290  }
void ai.heavy.jdbc.HeavyAIStatement.setMaxFieldSize ( int  max) throws SQLException
inline

Definition at line 172 of file HeavyAIStatement.java.

172  { // logger.debug("Entered");
173  throw new UnsupportedOperationException("Not supported yet,"
174  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
175  + " class:" + new Throwable().getStackTrace()[0].getClassName()
176  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
177  }
void ai.heavy.jdbc.HeavyAIStatement.setMaxRows ( int  max) throws SQLException
inline

Definition at line 185 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.maxRows.

185  { // logger.debug("Entered");
186  maxRows = max;
187  }
void ai.heavy.jdbc.HeavyAIStatement.setPoolable ( boolean  poolable) throws SQLException
inline

Definition at line 430 of file HeavyAIStatement.java.

431  { // logger.debug("Entered");
432  throw new UnsupportedOperationException("Not supported yet,"
433  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
434  + " class:" + new Throwable().getStackTrace()[0].getClassName()
435  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
436  }
void ai.heavy.jdbc.HeavyAIStatement.setQueryTimeout ( int  seconds) throws SQLException
inline

Definition at line 207 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

208  { // logger.debug("Entered");
209  SQLWarning warning = new SQLWarning(
210  "Query timeouts are not supported. Substituting a value of zero.");
211  if (rootWarning == null) {
212  rootWarning = warning;
213  } else {
214  rootWarning.setNextWarning(warning);
215  }
216  }
static String ai.heavy.jdbc.HeavyAIStatement.simplisticDateTransform ( String  sql)
inlinestatic

Definition at line 510 of file HeavyAIStatement.java.

Referenced by ai.heavy.jdbc.HeavyAIStatement.executeQuery().

510  {
511  // need to iterate as each reduction of string opens up a anew match
512  String start;
513  do {
514  // Example transform - select quarter(val) from table;
515  // will become select extract(quarter from val) from table;
516  // will also replace all CURRENT_TIME and CURRENT_DATE with a call to now().
517  start = sql;
518  sql = QUARTER.matcher(sql).replaceAll(" EXTRACT(QUARTER FROM $1");
519  } while (!sql.equals(start));
520 
521  do {
522  start = sql;
523  sql = DAYOFYEAR.matcher(sql).replaceAll(" EXTRACT(DOY FROM $1");
524  } while (!sql.equals(start));
525 
526  do {
527  start = sql;
528  sql = DAYOFWEEK.matcher(sql).replaceAll(" EXTRACT(ISODOW FROM $1");
529  } while (!sql.equals(start));
530 
531  do {
532  start = sql;
533  sql = WEEK.matcher(sql).replaceAll(" EXTRACT(WEEK FROM $1");
534  } while (!sql.equals(start));
535 
536  do {
537  start = sql;
538  sql = CURRENTDATE.matcher(sql).replaceAll(" cast(now() as date) ");
539  } while (!sql.equals(start));
540 
541  return sql;
542  }

+ Here is the caller graph for this function:

public<T> T ai.heavy.jdbc.HeavyAIStatement.unwrap ( Class< T >  iface) throws SQLException
inlinepackage

Definition at line 463 of file HeavyAIStatement.java.

463  { // logger.debug("Entered");
464  throw new UnsupportedOperationException("Not supported yet,"
465  + " line:" + new Throwable().getStackTrace()[0].getLineNumber()
466  + " class:" + new Throwable().getStackTrace()[0].getClassName()
467  + " method:" + new Throwable().getStackTrace()[0].getMethodName());
468  }

Member Data Documentation

Heavy.Client ai.heavy.jdbc.HeavyAIStatement.client
private
HeavyAIConnection ai.heavy.jdbc.HeavyAIStatement.connection
private
final Pattern ai.heavy.jdbc.HeavyAIStatement.CURRENTDATE
staticprivate
Initial value:
=
Pattern.compile("(?<![\\w.])CURRENT_DATE(?:\\(\\))?(?![\\w.])",
Pattern.DOTALL | Pattern.CASE_INSENSITIVE)

Definition at line 506 of file HeavyAIStatement.java.

ResultSet ai.heavy.jdbc.HeavyAIStatement.currentRS = null
private
final Pattern ai.heavy.jdbc.HeavyAIStatement.DAYOFWEEK
staticprivate
Initial value:
= Pattern.compile(
"\\sDAYOFWEEK\\(([^\\{]*?)", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)

Definition at line 483 of file HeavyAIStatement.java.

final Pattern ai.heavy.jdbc.HeavyAIStatement.DAYOFYEAR
staticprivate
Initial value:
= Pattern.compile(
"\\sDAYOFYEAR\\(([^\\{]*?)", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)

Definition at line 481 of file HeavyAIStatement.java.

boolean ai.heavy.jdbc.HeavyAIStatement.escapeProcessing = false
private
boolean ai.heavy.jdbc.HeavyAIStatement.isClosed = false
private

Definition at line 47 of file HeavyAIStatement.java.

final org.slf4j.Logger ai.heavy.jdbc.HeavyAIStatement.logger = LoggerFactory.getLogger(HeavyAIStatement.class)
staticpackage

Definition at line 37 of file HeavyAIStatement.java.

final Pattern ai.heavy.jdbc.HeavyAIStatement.QUARTER
staticprivate
Initial value:
= Pattern.compile(
"\\sQUARTER\\(([^\\{]*?)", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)

Definition at line 479 of file HeavyAIStatement.java.

String ai.heavy.jdbc.HeavyAIStatement.session
private

Definition at line 40 of file HeavyAIStatement.java.

Referenced by ai.heavy.jdbc.HeavyAIStatement.cancel(), ai.heavy.jdbc.HeavyAIStatement.executeQuery(), ai.heavy.jdbc.HeavyAIStatement.executeUpdate(), ai.heavy.jdbc.HeavyAIStatement.HeavyAIStatement(), heavydb.thrift.Heavy.disconnect_args.read(), heavydb.thrift.Heavy.switch_database_args.read(), heavydb.thrift.Heavy.clone_session_args.read(), heavydb.thrift.Heavy.get_server_status_args.read(), heavydb.thrift.Heavy.get_status_args.read(), heavydb.thrift.Heavy.get_hardware_info_args.read(), heavydb.thrift.Heavy.get_tables_args.read(), heavydb.thrift.Heavy.get_tables_for_database_args.read(), heavydb.thrift.Heavy.get_physical_tables_args.read(), heavydb.thrift.Heavy.get_views_args.read(), heavydb.thrift.Heavy.get_tables_meta_args.read(), heavydb.thrift.Heavy.get_table_details_args.read(), heavydb.thrift.Heavy.get_table_details_for_database_args.read(), heavydb.thrift.Heavy.get_internal_table_details_args.read(), heavydb.thrift.Heavy.get_internal_table_details_for_database_args.read(), heavydb.thrift.Heavy.get_users_args.read(), heavydb.thrift.Heavy.get_databases_args.read(), heavydb.thrift.Heavy.start_heap_profile_args.read(), heavydb.thrift.Heavy.stop_heap_profile_args.read(), heavydb.thrift.Heavy.get_heap_profile_args.read(), heavydb.thrift.Heavy.get_memory_args.read(), heavydb.thrift.Heavy.clear_cpu_memory_args.read(), heavydb.thrift.Heavy.clear_gpu_memory_args.read(), heavydb.thrift.Heavy.set_table_epoch_args.read(), heavydb.thrift.Heavy.set_table_epoch_by_name_args.read(), heavydb.thrift.Heavy.get_table_epoch_args.read(), heavydb.thrift.Heavy.get_table_epoch_by_name_args.read(), heavydb.thrift.Heavy.get_table_epochs_args.read(), heavydb.thrift.Heavy.set_table_epochs_args.read(), heavydb.thrift.Heavy.get_session_info_args.read(), heavydb.thrift.Heavy.get_queries_info_args.read(), heavydb.thrift.Heavy.set_leaf_info_args.read(), heavydb.thrift.Heavy.sql_execute_args.read(), heavydb.thrift.Heavy.sql_execute_df_args.read(), heavydb.thrift.Heavy.sql_execute_gdf_args.read(), heavydb.thrift.Heavy.deallocate_df_args.read(), heavydb.thrift.Heavy.sql_validate_args.read(), heavydb.thrift.Heavy.get_completion_hints_args.read(), heavydb.thrift.Heavy.set_execution_mode_args.read(), heavydb.thrift.Heavy.render_vega_args.read(), heavydb.thrift.Heavy.get_result_row_for_pixel_args.read(), heavydb.thrift.Heavy.create_custom_expression_args.read(), heavydb.thrift.Heavy.get_custom_expressions_args.read(), heavydb.thrift.Heavy.update_custom_expression_args.read(), heavydb.thrift.Heavy.delete_custom_expressions_args.read(), heavydb.thrift.Heavy.get_dashboard_args.read(), heavydb.thrift.Heavy.get_dashboards_args.read(), heavydb.thrift.Heavy.create_dashboard_args.read(), heavydb.thrift.Heavy.replace_dashboard_args.read(), heavydb.thrift.Heavy.delete_dashboard_args.read(), heavydb.thrift.Heavy.share_dashboards_args.read(), heavydb.thrift.Heavy.delete_dashboards_args.read(), heavydb.thrift.Heavy.share_dashboard_args.read(), heavydb.thrift.Heavy.unshare_dashboard_args.read(), heavydb.thrift.Heavy.unshare_dashboards_args.read(), heavydb.thrift.Heavy.get_dashboard_grantees_args.read(), heavydb.thrift.Heavy.get_link_view_args.read(), heavydb.thrift.Heavy.create_link_args.read(), heavydb.thrift.Heavy.load_table_binary_args.read(), heavydb.thrift.Heavy.load_table_binary_columnar_args.read(), heavydb.thrift.Heavy.load_table_binary_columnar_polys_args.read(), heavydb.thrift.Heavy.load_table_binary_arrow_args.read(), heavydb.thrift.Heavy.load_table_args.read(), heavydb.thrift.Heavy.detect_column_types_args.read(), heavydb.thrift.Heavy.create_table_args.read(), heavydb.thrift.Heavy.import_table_args.read(), heavydb.thrift.Heavy.import_geo_table_args.read(), heavydb.thrift.Heavy.import_table_status_args.read(), heavydb.thrift.Heavy.get_first_geo_file_in_archive_args.read(), heavydb.thrift.Heavy.get_all_files_in_archive_args.read(), heavydb.thrift.Heavy.get_layers_in_geo_file_args.read(), heavydb.thrift.Heavy.query_get_outer_fragment_count_args.read(), heavydb.thrift.Heavy.check_table_consistency_args.read(), heavydb.thrift.Heavy.start_render_query_args.read(), heavydb.thrift.Heavy.insert_data_args.read(), heavydb.thrift.Heavy.insert_chunks_args.read(), heavydb.thrift.Heavy.checkpoint_args.read(), heavydb.thrift.Heavy.get_roles_args.read(), heavydb.thrift.Heavy.get_db_objects_for_grantee_args.read(), heavydb.thrift.Heavy.get_db_object_privs_args.read(), heavydb.thrift.Heavy.get_all_roles_for_user_args.read(), heavydb.thrift.Heavy.get_all_effective_roles_for_user_args.read(), heavydb.thrift.Heavy.has_role_args.read(), heavydb.thrift.Heavy.has_object_privilege_args.read(), heavydb.thrift.Heavy.set_license_key_args.read(), heavydb.thrift.Heavy.get_license_claims_args.read(), heavydb.thrift.Heavy.get_device_parameters_args.read(), heavydb.thrift.Heavy.register_runtime_extension_functions_args.read(), heavydb.thrift.Heavy.get_table_function_names_args.read(), heavydb.thrift.Heavy.get_runtime_table_function_names_args.read(), heavydb.thrift.Heavy.get_table_function_details_args.read(), heavydb.thrift.Heavy.disconnect_args.write(), heavydb.thrift.Heavy.switch_database_args.write(), heavydb.thrift.Heavy.clone_session_args.write(), heavydb.thrift.Heavy.get_server_status_args.write(), heavydb.thrift.Heavy.get_status_args.write(), heavydb.thrift.Heavy.get_hardware_info_args.write(), heavydb.thrift.Heavy.get_tables_args.write(), heavydb.thrift.Heavy.get_tables_for_database_args.write(), heavydb.thrift.Heavy.get_physical_tables_args.write(), heavydb.thrift.Heavy.get_views_args.write(), heavydb.thrift.Heavy.get_tables_meta_args.write(), heavydb.thrift.Heavy.get_table_details_args.write(), heavydb.thrift.Heavy.get_table_details_for_database_args.write(), heavydb.thrift.Heavy.get_internal_table_details_args.write(), heavydb.thrift.Heavy.get_internal_table_details_for_database_args.write(), heavydb.thrift.Heavy.get_users_args.write(), heavydb.thrift.Heavy.get_databases_args.write(), heavydb.thrift.Heavy.start_heap_profile_args.write(), heavydb.thrift.Heavy.stop_heap_profile_args.write(), heavydb.thrift.Heavy.get_heap_profile_args.write(), heavydb.thrift.Heavy.get_memory_args.write(), heavydb.thrift.Heavy.clear_cpu_memory_args.write(), heavydb.thrift.Heavy.clear_gpu_memory_args.write(), heavydb.thrift.Heavy.set_table_epoch_args.write(), heavydb.thrift.Heavy.set_table_epoch_by_name_args.write(), heavydb.thrift.Heavy.get_table_epoch_args.write(), heavydb.thrift.Heavy.get_table_epoch_by_name_args.write(), heavydb.thrift.Heavy.get_table_epochs_args.write(), heavydb.thrift.Heavy.set_table_epochs_args.write(), heavydb.thrift.Heavy.get_session_info_args.write(), heavydb.thrift.Heavy.get_queries_info_args.write(), heavydb.thrift.Heavy.set_leaf_info_args.write(), heavydb.thrift.Heavy.sql_execute_args.write(), heavydb.thrift.Heavy.sql_execute_df_args.write(), heavydb.thrift.Heavy.sql_execute_gdf_args.write(), heavydb.thrift.Heavy.deallocate_df_args.write(), heavydb.thrift.Heavy.sql_validate_args.write(), heavydb.thrift.Heavy.get_completion_hints_args.write(), heavydb.thrift.Heavy.set_execution_mode_args.write(), heavydb.thrift.Heavy.render_vega_args.write(), heavydb.thrift.Heavy.get_result_row_for_pixel_args.write(), heavydb.thrift.Heavy.create_custom_expression_args.write(), heavydb.thrift.Heavy.get_custom_expressions_args.write(), heavydb.thrift.Heavy.update_custom_expression_args.write(), heavydb.thrift.Heavy.delete_custom_expressions_args.write(), heavydb.thrift.Heavy.get_dashboard_args.write(), heavydb.thrift.Heavy.get_dashboards_args.write(), heavydb.thrift.Heavy.create_dashboard_args.write(), heavydb.thrift.Heavy.replace_dashboard_args.write(), heavydb.thrift.Heavy.delete_dashboard_args.write(), heavydb.thrift.Heavy.share_dashboards_args.write(), heavydb.thrift.Heavy.delete_dashboards_args.write(), heavydb.thrift.Heavy.share_dashboard_args.write(), heavydb.thrift.Heavy.unshare_dashboard_args.write(), heavydb.thrift.Heavy.unshare_dashboards_args.write(), heavydb.thrift.Heavy.get_dashboard_grantees_args.write(), heavydb.thrift.Heavy.get_link_view_args.write(), heavydb.thrift.Heavy.create_link_args.write(), heavydb.thrift.Heavy.load_table_binary_args.write(), heavydb.thrift.Heavy.load_table_binary_columnar_args.write(), heavydb.thrift.Heavy.load_table_binary_columnar_polys_args.write(), heavydb.thrift.Heavy.load_table_binary_arrow_args.write(), heavydb.thrift.Heavy.load_table_args.write(), heavydb.thrift.Heavy.detect_column_types_args.write(), heavydb.thrift.Heavy.create_table_args.write(), heavydb.thrift.Heavy.import_table_args.write(), heavydb.thrift.Heavy.import_geo_table_args.write(), heavydb.thrift.Heavy.import_table_status_args.write(), heavydb.thrift.Heavy.get_first_geo_file_in_archive_args.write(), heavydb.thrift.Heavy.get_all_files_in_archive_args.write(), heavydb.thrift.Heavy.get_layers_in_geo_file_args.write(), heavydb.thrift.Heavy.query_get_outer_fragment_count_args.write(), heavydb.thrift.Heavy.check_table_consistency_args.write(), heavydb.thrift.Heavy.start_render_query_args.write(), heavydb.thrift.Heavy.insert_data_args.write(), heavydb.thrift.Heavy.insert_chunks_args.write(), heavydb.thrift.Heavy.checkpoint_args.write(), heavydb.thrift.Heavy.get_roles_args.write(), heavydb.thrift.Heavy.get_db_objects_for_grantee_args.write(), heavydb.thrift.Heavy.get_db_object_privs_args.write(), heavydb.thrift.Heavy.get_all_roles_for_user_args.write(), heavydb.thrift.Heavy.get_all_effective_roles_for_user_args.write(), heavydb.thrift.Heavy.has_role_args.write(), heavydb.thrift.Heavy.has_object_privilege_args.write(), heavydb.thrift.Heavy.set_license_key_args.write(), heavydb.thrift.Heavy.get_license_claims_args.write(), heavydb.thrift.Heavy.get_device_parameters_args.write(), heavydb.thrift.Heavy.register_runtime_extension_functions_args.write(), heavydb.thrift.Heavy.get_table_function_names_args.write(), heavydb.thrift.Heavy.get_runtime_table_function_names_args.write(), and heavydb.thrift.Heavy.get_table_function_details_args.write().

TQueryResult ai.heavy.jdbc.HeavyAIStatement.sqlResult = null
private
Pattern ai.heavy.jdbc.HeavyAIStatement.top_pattern
staticpackage
Initial value:
=
Pattern.compile("select top\\s+([0-9]+)\\s+", Pattern.CASE_INSENSITIVE)

Definition at line 56 of file HeavyAIStatement.java.

final Pattern ai.heavy.jdbc.HeavyAIStatement.WEEK
staticprivate
Initial value:
= Pattern.compile(
"\\sWEEK\\(([^\\{]*?)", Pattern.DOTALL | Pattern.CASE_INSENSITIVE)

Definition at line 485 of file HeavyAIStatement.java.


The documentation for this class was generated from the following file: