नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime 15.1 and above
Sets the CURRENT_RECIPIENT to the specified recipient in the current session to allow the provider to mock CURRENT_RECIPIENT properties. This enables providers to query views that contain the CURRENT_RECIPIENT function.
Syntax
SET RECIPIENT recipient_name
Parameters
-
The name of the recipient to set as the current recipient.
Examples
— Creates new recipient
> CREATE RECIPIENT nasdaq PROPERTIES ('country' = 'US');
> CREATE TABLE my_table (country STRING, name STRING);
> INSERT INTO my_table VALUES ('US', 'John'), ('UK', 'Mary');
> CREATE VIEW my_view AS
SELECT * FROM my_table
WHERE country = CURRENT_RECIPIENT('country');
— Sets current recipient
> SET RECIPIENT nasdaq;
> SELECT * FROM my_view;
US John