SET (SQL Analytics)SET (SQL Analytics)

设置属性,返回现有属性的值,或返回所有具有值和含义的 SQL 配置属性。Sets a property, returns the value of an existing property or returns all SQL configuration properties with value and meaning.

语法Syntax

SET
SET [ -v ]
SET property_key[ = property_value ]

参数Parameters

  • -v-v

    输出现有 SQL 配置属性的键、值和含义。Outputs the key, value and meaning of existing SQL configuration properties.

  • property_keyproperty_key

    返回指定属性键的值。Returns the value of specified property key.

  • property_key=property_valueproperty_key=property_value

    设置给定属性键的值。Sets the value for a given property key. 如果给定的属性键具有旧值,则新值将替代该值。If an old value exists for a given property key, then it gets overridden by the new value.

示例Examples

-- Set a property.
SET spark.sql.variable.substitute=false;

-- List all SQL configuration properties with value and meaning.
SET -v;

-- List all SQL configuration properties with value for current session.
SET;

-- List the value of specified property key.
SET spark.sql.variable.substitute;
+-----------------------------+-----+
|                          key|value|
+-----------------------------+-----+
|spark.sql.variable.substitute|false|
+-----------------------------+-----+