You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bo...@apache.org on 2019/05/28 10:26:12 UTC
[impala] 03/08: [DOCS] Corrected the privileges required for CREATE
FUNCTION
This is an automated email from the ASF dual-hosted git repository.
boroknagyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 90da7fa48a3f3d7b781172d91dfa6026c5d7fab8
Author: Alex Rodoni <ar...@cloudera.com>
AuthorDate: Thu May 23 17:44:45 2019 -0700
[DOCS] Corrected the privileges required for CREATE FUNCTION
Change-Id: I51c8ec9d794e3364e700193c5a8f108ef270ac62
Reviewed-on: http://gerrit.cloudera.org:8080/13420
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Fredy Wijaya <fw...@cloudera.com>
---
docs/topics/impala_create_function.xml | 35 ++++++++++------------------------
docs/topics/impala_udf.xml | 33 ++++++++------------------------
2 files changed, 18 insertions(+), 50 deletions(-)
diff --git a/docs/topics/impala_create_function.xml b/docs/topics/impala_create_function.xml
index 1bdf494..9861fd9 100644
--- a/docs/topics/impala_create_function.xml
+++ b/docs/topics/impala_create_function.xml
@@ -37,11 +37,9 @@ under the License.
<conbody>
- <p>
- <indexterm audience="hidden">CREATE FUNCTION statement</indexterm>
- Creates a user-defined function (UDF), which you can use to implement custom logic during
- <codeph>SELECT</codeph> or <codeph>INSERT</codeph> operations.
- </p>
+ <p> Creates a user-defined function (UDF), which you can use to implement
+ custom logic during <codeph>SELECT</codeph> or <codeph>INSERT</codeph>
+ operations. </p>
<p conref="../shared/impala_common.xml#common/syntax_blurb"/>
@@ -74,14 +72,6 @@ under the License.
SYMBOL='<varname>class_name</varname>'</codeblock>
</p>
-<!--
-Examples:
-CREATE FUNCTION IF NOT EXISTS foo location '/path/to/jar' SYMBOL='TestUdf';
-CREATE FUNCTION bar location '/path/to/jar' SYMBOL='TestUdf2';
-DROP FUNCTION foo;
-DROP FUNCTION IF EXISTS bar;
--->
-
<p>
To create a persistent UDA, which must be written in C++, issue a <codeph>CREATE AGGREGATE FUNCTION</codeph> statement:
</p>
@@ -212,18 +202,6 @@ DROP FUNCTION IF EXISTS bar;
determine the names based on the first such clause, so the others are optional.
</p>
- <p audience="hidden">
- The <codeph>INTERMEDIATE</codeph> clause specifies the data type of intermediate values passed from the
- <q>update</q> phase to the <q>merge</q> phase, and from the <q>merge</q> phase to the <q>finalize</q> phase.
- You can use any of the existing Impala data types, or the special notation
- <codeph>CHAR(<varname>n</varname>)</codeph> to allocate a scratch area of <varname>n</varname> bytes for the
- intermediate result. For example, if the different phases of your UDA pass strings to each other but in the
- end the function returns a <codeph>BIGINT</codeph> value, you would specify <codeph>INTERMEDIATE
- STRING</codeph>. Likewise, if the different phases of your UDA pass 2 separate <codeph>BIGINT</codeph> values
- between them (8 bytes each), you would specify <codeph>INTERMEDIATE CHAR(16)</codeph> so that each function
- could read from and write to a 16-byte buffer.
- </p>
-
<p>
For end-to-end examples of UDAs, see <xref href="impala_udf.xml#udfs"/>.
</p>
@@ -235,6 +213,13 @@ DROP FUNCTION IF EXISTS bar;
<p conref="../shared/impala_common.xml#common/usage_notes_blurb"/>
<ul>
+ <li> When authorization is enabled, the <codeph>CREATE FUNCTION</codeph>
+ statement requires:<ul>
+ <li>The <codeph>CREATE</codeph> privilege on the database.</li>
+ <li>The <codeph>ALL</codeph> privilege on URI where URI is the value
+ you specified for the <codeph>LOCATION</codeph> in the
+ <codeph>CREATE FUNCTION</codeph> statement. </li>
+ </ul></li>
<li>
You can write Impala UDFs in either C++ or Java. C++ UDFs are new to Impala, and are the recommended format
for high performance utilizing native code. Java-based UDFs are compatible between Impala and Hive, and are
diff --git a/docs/topics/impala_udf.xml b/docs/topics/impala_udf.xml
index 4811643..8d6c382 100644
--- a/docs/topics/impala_udf.xml
+++ b/docs/topics/impala_udf.xml
@@ -45,13 +45,8 @@ under the License.
copying from one table to another with the <codeph>INSERT ... SELECT</codeph> syntax.
</p>
- <p>
- You might be familiar with this feature from other database products, under names such as stored functions or
- stored routines.
-<!--
- , user-defined aggregate functions (UDAFs), table functions, or window functions.
- -->
- </p>
+ <p> You might be familiar with this feature from other database products,
+ under names such as stored functions or stored routines. </p>
<p>
Impala support for UDFs is available in Impala 1.2 and higher:
@@ -137,18 +132,6 @@ select most_profitable_location(store_id, sales, expenses, tax_rate, depreciatio
Currently, Impala does not support other categories of user-defined functions, such as user-defined
table functions (UDTFs) or window functions.
</li>
-
-<!--
-<li>
-A user-defined table function (UDTF) returns an arbitrary number of rows (zero, one, or many) for each input row.
-These functions filter, explode, or transform the input data in a variety of ways.
-Currently, Impala does not support UDTFs.
-For example:
-<codeblock>select anomalous_event() from web_traffic;
-select price_change() from stock_ticker;
-select real_words(letters) from word_games;</codeblock>
-</li>
--->
</ul>
</conbody>
</concept>
@@ -1860,12 +1843,12 @@ Returned 2 row(s) in 0.43s</codeblock>
To call a UDF in a query, you must have the required read privilege for any databases and tables used in
the query.
</li>
-
- <li>
- Because incorrectly coded UDFs could cause performance or capacity problems, for example by going into
- infinite loops or allocating excessive amounts of memory, only an administrative user can create UDFs.
- That is, to execute the <codeph>CREATE FUNCTION</codeph> statement requires the <codeph>ALL</codeph>
- privilege on the server.
+ <li> The <codeph>CREATE FUNCTION</codeph> statement requires:<ul>
+ <li>The <codeph>CREATE</codeph> privilege on the database.</li>
+ <li>The <codeph>ALL</codeph> privilege on URI where URI is the value
+ you specified for the <codeph>LOCATION</codeph> in the
+ <codeph>CREATE FUNCTION</codeph> statement. </li>
+ </ul>
</li>
</ul>