Hi Xiaoqing!
>The syntax of query is as follows, select udtf_explode(info) as (name,
phone) from table;
What is type of info / what os the intention of the "as (name, phone)" part?
If info is a struct with members name/phone, then you could do this in
Impala with:
select item.name, item.phone from table.info;

>Do we have plan to support impala udtf?
I don't know about discussing specifically udtf, but there is some recently
done/ongoing development related to complex types (zipping unnest,
returning struct/array in select list).
Currently we have no functions that return complex types, so you can't use
array(1,2,3) in Impala.
There are plans to add complex type support to UDF, and that would bring us
much closer to UDTFs, e.g. unnest(udf_that_returns_array()) would
practically act like an UDTF.


On Wed, Aug 24, 2022 at 8:54 AM Xiaoqing Gao <285814...@qq.com> wrote:

> Hi, all, Currently, Impala does not support user-defined table functions
> (UDTFs), some data analysis scenario need this feature such as funnel
> analysis, session analysis and so on. Other databases Hive, Max compute
> support udtf. for example explode in hive:
> https://github.com/apache/hive/blob/master/ql/src/test/results/clientpositive/llap/udtf_explode.q.out
> Do we have plan to support impala udtf? The syntax of query is as follows,
> select udtf_explode(info) as (name, phone) from table; Besides, we can also
> support the following syntax, select udtf_example(c1, c2, c3) over
> (partition by c1 order by c2) as (num, c1, c2) from table; Users can create
> udtf, the create grammar as follows: create transform function
> udtf_example(BIGINT, STRING, STRING, ...) location '/tmp/libimpalaExts.so'
> prepare_fn='' init_fn='' update_fn='' finalize_fn='' close_fn='' Best
> regards, gaoxiaoqing

Reply via email to