Package dev.frostlake.metastore
Class NoCurrentDatabaseRefusal
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.frostlake.metastore.NoCurrentDatabaseRefusal
- All Implemented Interfaces:
Serializable
Live's refusal of a statement that needs a current database the session does not have, naming what the
statement was doing, with no compilation-error prefix:
Cannot perform CREATE TABLE. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
A session gets there by dropping its current database, which leaves CURRENT_DATABASE() and
CURRENT_SCHEMA() both NULL. The refusal usually names the statement's own kind, which the command visitor
enters as each statement starts, so a refusal raised deep inside name resolution still names it. A few
lookups name themselves instead, whatever the statement: a FROM clause is a SELECT, a CLONE source a
CLONE. They pass that name to naming(java.lang.String).
The missing prefix matters beyond the text. The refusal is raised while the statement compiles, so a DML write must never wrap it in its row-time envelope, and this type is how the envelope tells.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe statement about to run, by the name live gives it.static voidThe statement has ended, and the enclosing one's name applies again.static RuntimeExceptionThe refusal, naming the statement running now.static NoCurrentDatabaseRefusalThe refusal, naming an operation of its own.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Method Details
-
enter
The statement about to run, by the name live gives it.- Parameters:
kind- the statement's name- Returns:
- the enclosing statement's name, for
exit(java.lang.String)
-
exit
The statement has ended, and the enclosing one's name applies again.- Parameters:
enclosing- whatenter(java.lang.String)returned
-
forStatement
The refusal, naming the statement running now.- Returns:
- the refusal to throw
-
naming
The refusal, naming an operation of its own.- Parameters:
kind- what the refusal names: SELECT for a FROM clause, CLONE for a CLONE source- Returns:
- the refusal to throw
-