Options

pass predicate inside UDL/UDX

Hello
I'm looking for a way in sdk to get access to predicates inside udx (transform or custom source) to reduce workload inside function (to implement something like partition elimination). I see there is a planContext, but it seems it does not know anything about outer query. Is there any way to make row reduction possible inside udx?

Answers

  • Options
    HibikiHibiki Vertica Employee Employee

    I have tried to find a way to achieve what you wanted to do, but I haven't found anything yet. Let me understand your requests clearly.

    • For the custom source, I'm thinking it is used by the external table. When the user queries that table, the custom source gets the data from the other source system by filtering the data. For example:
    CREATE EXTERNAL TABLE te (.....) AS COPY SOURCE custom_source (parameters);
    SELECT * FROM te WHERE i = 10;
    
    • For the transform case, can you give me the detailed scenario?
  • Options

    something like

    create view item_params as select parse2columns(X) over(partition nodes) as (id,p1,p2,p3,p4,...p100) from t;
    select id, p11, p12, p13, p14, p15, p16 from item_params where p12 = 'bmw';
    

    or

    create view item_params as select parse2eav(X) over(partition nodes) as (id,name,value) from t;
    select * from item_params where name = 'model';
    

    or any case where tranform calculation is hard to evaluate so skipping it would save a lot of time

  • Options
    HibikiHibiki Vertica Employee Employee

    Could you please open a support case? We can raise a new feature request if required accordingly.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file