SET Statements

Description

The SET statement sets a property which provide a ways to set variables for a session and configuration property including system variable and Hive configuration. But environment variable can’t be set via SET statement. The behavior of SET with Hive dialect is compatible to Hive’s.

EXAMPLES

  1. -- set Flink's configuration
  2. SET table.sql-dialect=default;
  3. -- set Hive's configuration
  4. SET hiveconf:k1=v1;
  5. -- set system property
  6. SET system:k2=v2;
  7. -- set vairable for current session
  8. SET hivevar:k3=v3;
  9. -- get value for configuration
  10. SET table.sql-dialect;
  11. SET hiveconf:k1;
  12. SET system:k2;
  13. SET hivevar:k3;
  14. -- only print Flink's configuration
  15. SET;
  16. -- print all configurations
  17. SET -v;

Note:

  • In Hive, the SET command SET xx=yy whose key has no prefix is equivalent to SET hiveconf:xx=yy, which means it’ll set it to Hive Conf. But in Flink, with Hive dialect, such SET command set xx=yy will set xx with value yy to Flink’s configuration. So, if you want to set configuration to Hive’s Conf, please add the prefix hiveconf:, using the SET command like SET hiveconf:xx=yy.
  • In Hive dialect, the key/value to be set shouldn’t be quoted.