Enum DataContext.Variable

    • 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).
      SYSTEM_USER
      The system user.
      TIME_ZONE
      Time zone in which the current statement is executing.
      TIMEOUT
      Query timeout in milliseconds.
      USER
      The query user.
      UTC_TIMESTAMP  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String camelName  
      java.lang.Class clazz  
    • 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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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).
      • TIMEOUT

        public static final DataContext.Variable TIMEOUT
        Query timeout in milliseconds. When no timeout is set, the value is 0 or not present.
      • SQL_ADVISOR

        public static final DataContext.Variable SQL_ADVISOR
        Advisor that suggests completion hints for SQL statements.
      • 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.
      • SYSTEM_USER

        public static final DataContext.Variable SYSTEM_USER
        The system user.

        Default value is "user.name" from System.getProperty(String).

    • Field Detail

      • camelName

        public final java.lang.String camelName
      • clazz

        public final java.lang.Class clazz
    • Constructor Detail

      • Variable

        private Variable​(java.lang.String camelName,
                         java.lang.Class clazz)
    • 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 name
        java.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.