OmniSciDB  72c90bc290
 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

Definition at line 32 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 313 of file HeavyAIStatement.java.

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

Definition at line 107 of file HeavyAIStatement.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 540 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().

540  {
541  if (isClosed) {
542  throw new SQLException("Statement is closed.");
543  }
544  }

+ 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 321 of file HeavyAIStatement.java.

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

Definition at line 220 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

220  { // logger.debug("Entered");
221  rootWarning = null;
222  }
void ai.heavy.jdbc.HeavyAIStatement.close ( ) throws SQLException
inline

Definition at line 152 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__().

152  { // logger.debug("Entered");
153  if (currentRS != null) {
154  currentRS.close();
155  }
156  isClosed = true;
157  }

+ 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 443 of file HeavyAIStatement.java.

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

Definition at line 233 of file HeavyAIStatement.java.

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

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

233  { // logger.debug("Entered");
234  ResultSet rs = executeQuery(sql);
235  if (rs != null) {
236  return true;
237  } else {
238  return false;
239  }
240  }
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 386 of file HeavyAIStatement.java.

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

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

+ Here is the caller graph for this function:

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

Definition at line 395 of file HeavyAIStatement.java.

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

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

+ Here is the caller graph for this function:

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

Definition at line 404 of file HeavyAIStatement.java.

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

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

+ Here is the caller graph for this function:

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

Definition at line 329 of file HeavyAIStatement.java.

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

Definition at line 56 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().

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

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

+ Here is the call graph for this function:

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

Definition at line 359 of file HeavyAIStatement.java.

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

Definition at line 368 of file HeavyAIStatement.java.

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

Definition at line 377 of file HeavyAIStatement.java.

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

Definition at line 337 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.connection.

337  { // logger.debug("Entered");
338  return connection;
339  }
int ai.heavy.jdbc.HeavyAIStatement.getFetchDirection ( ) throws SQLException
inline

Definition at line 273 of file HeavyAIStatement.java.

273  { // logger.debug("Entered");
274  return ResultSet.FETCH_FORWARD;
275  }
int ai.heavy.jdbc.HeavyAIStatement.getFetchSize ( ) throws SQLException
inline

Definition at line 289 of file HeavyAIStatement.java.

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

Definition at line 351 of file HeavyAIStatement.java.

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

Definition at line 160 of file HeavyAIStatement.java.

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

Definition at line 176 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.maxRows.

176  { // logger.debug("Entered");
177  return maxRows;
178  }
boolean ai.heavy.jdbc.HeavyAIStatement.getMoreResults ( ) throws SQLException
inline

Definition at line 257 of file HeavyAIStatement.java.

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

257  { // logger.debug("Entered");
258  checkClosed();
259  // TODO MAT this needs to be fixed for complex queries
260  return false;
261  }

+ Here is the call graph for this function:

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

Definition at line 342 of file HeavyAIStatement.java.

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

Definition at line 197 of file HeavyAIStatement.java.

198  { // logger.debug("Entered");
199  return (int) sqlResult.execution_time_ms;
200  }
int ai.heavy.jdbc.HeavyAIStatement.getQueryTimeout ( ) throws SQLException
inline

Definition at line 192 of file HeavyAIStatement.java.

192  { // logger.debug("Entered");
193  return 0;
194  }
ResultSet ai.heavy.jdbc.HeavyAIStatement.getResultSet ( ) throws SQLException
inline

Definition at line 243 of file HeavyAIStatement.java.

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

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

243  { // logger.debug("Entered");
244  checkClosed();
245  return currentRS;
246  }

+ 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 297 of file HeavyAIStatement.java.

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

Definition at line 413 of file HeavyAIStatement.java.

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

Definition at line 305 of file HeavyAIStatement.java.

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

Definition at line 249 of file HeavyAIStatement.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 215 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

215  { // logger.debug("Entered");
216  return (rootWarning);
217  }
boolean ai.heavy.jdbc.HeavyAIStatement.isClosed ( ) throws SQLException
inline

Definition at line 421 of file HeavyAIStatement.java.

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

421  { // logger.debug("Entered");
422  return isClosed;
423  }

+ Here is the caller graph for this function:

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

Definition at line 451 of file HeavyAIStatement.java.

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

Definition at line 435 of file HeavyAIStatement.java.

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

Definition at line 467 of file HeavyAIStatement.java.

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

Definition at line 225 of file HeavyAIStatement.java.

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

Definition at line 186 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.escapeProcessing.

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

Definition at line 264 of file HeavyAIStatement.java.

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

Definition at line 278 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

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

Definition at line 168 of file HeavyAIStatement.java.

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

Definition at line 181 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.maxRows.

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

Definition at line 426 of file HeavyAIStatement.java.

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

Definition at line 203 of file HeavyAIStatement.java.

References ai.heavy.jdbc.HeavyAIStatement.rootWarning.

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

Definition at line 506 of file HeavyAIStatement.java.

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

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

+ 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 459 of file HeavyAIStatement.java.

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

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 502 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 479 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 477 of file HeavyAIStatement.java.

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

Definition at line 43 of file HeavyAIStatement.java.

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

Definition at line 33 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 475 of file HeavyAIStatement.java.

String ai.heavy.jdbc.HeavyAIStatement.session
private

Definition at line 36 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_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.get_function_names_args.read(), heavydb.thrift.Heavy.get_runtime_function_names_args.read(), heavydb.thrift.Heavy.get_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_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(), heavydb.thrift.Heavy.get_table_function_details_args.write(), heavydb.thrift.Heavy.get_function_names_args.write(), heavydb.thrift.Heavy.get_runtime_function_names_args.write(), and heavydb.thrift.Heavy.get_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 52 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 481 of file HeavyAIStatement.java.


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