Package org.apache.calcite
Enum DataContext.Variable
- java.lang.Object
-
- java.lang.Enum<DataContext.Variable>
-
- org.apache.calcite.DataContext.Variable
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DataContext.Variable>
- Enclosing interface:
- DataContext
public static enum DataContext.Variable extends java.lang.Enum<DataContext.Variable>
Variable that may be asked for in a call toDataContext.get(java.lang.String)
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CANCEL_FLAG
A mutable flag that indicates whether user has requested that the current statement be canceled.CURRENT_TIMESTAMP
The time at which the current statement started executing.LOCAL_TIMESTAMP
The time at which the current statement started executing.SPARK_CONTEXT
The Spark engine.SQL_ADVISOR
Advisor that suggests completion hints for SQL statements.STDERR
Writer to the standard error (stderr).STDIN
Reader on the standard input (stdin).STDOUT
Writer to the standard output (stdout).TIME_ZONE
Time zone in which the current statement is executing.UTC_TIMESTAMP
-
Constructor Summary
Constructors Modifier Constructor Description private
Variable(java.lang.String camelName, java.lang.Class clazz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
get(DataContext dataContext)
Returns the value of this variable in a given data context.static DataContext.Variable
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DataContext.Variable[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UTC_TIMESTAMP
public static final DataContext.Variable UTC_TIMESTAMP
-
CURRENT_TIMESTAMP
public static final DataContext.Variable CURRENT_TIMESTAMP
The time at which the current statement started executing. In milliseconds after 1970-01-01 00:00:00, UTC. Required.
-
LOCAL_TIMESTAMP
public static final DataContext.Variable LOCAL_TIMESTAMP
The time at which the current statement started executing. In milliseconds after 1970-01-01 00:00:00, in the time zone of the current statement. Required.
-
SPARK_CONTEXT
public static final DataContext.Variable SPARK_CONTEXT
The Spark engine. Available if Spark is on the class path.
-
CANCEL_FLAG
public static final DataContext.Variable CANCEL_FLAG
A mutable flag that indicates whether user has requested that the current statement be canceled. Cancellation may not be immediate, but implementations of relational operators should check the flag fairly frequently and cease execution (e.g. by returning end of data).
-
SQL_ADVISOR
public static final DataContext.Variable SQL_ADVISOR
Advisor that suggests completion hints for SQL statements.
-
STDERR
public static final DataContext.Variable STDERR
Writer to the standard error (stderr).
-
STDIN
public static final DataContext.Variable STDIN
Reader on the standard input (stdin).
-
STDOUT
public static final DataContext.Variable STDOUT
Writer to the standard output (stdout).
-
TIME_ZONE
public static final DataContext.Variable TIME_ZONE
Time zone in which the current statement is executing. Required; defaults to the time zone of the JVM if the connection does not specify a time zone.
-
-
Method Detail
-
values
public static DataContext.Variable[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataContext.Variable c : DataContext.Variable.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataContext.Variable valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
get
public <T> T get(DataContext dataContext)
Returns the value of this variable in a given data context.
-
-