Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-10520

Implement ds_theta_intersect() builtin function

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • Impala 4.0.0
    • Backend, Frontend
    • None

    Description

      ds_theta_intersect() is an aggregate function that accepts a sketch and produces a single sketch, which is the intersection of the received sketches.

      Example from Hive:

      create temporary table sketch_intermediate (category char(1), sketch binary);
      insert into sketch_intermediate select category, ds_theta_sketch(id) from sketch_input group by category;
      select ds_theta_estimate(ds_theta_intersect(sketch)) from sketch_intermediate;

      Some test data for the example:

      create temporary table sketch_input (id int, category char(1));
      insert into table sketch_input values
       (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'), (6, 'a'), (7, 'a'), (8, 'a'), (9, 'a'), (10, 'a'),
       (6, 'b'), (7, 'b'), (8, 'b'), (9, 'b'), (10, 'b'), (11, 'b'), (12, 'b'), (13, 'b'), (14, 'b'), (15, 'b');

      Approximate result:

      5.0

      Attachments

        Activity

          People

            chufucun Fucun Chu
            chufucun Fucun Chu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: