Skip to content

Failure in kll_sketch_float_build_k() #136

@nikunjbhartia

Description

@nikunjbhartia

Query:

SELECT
  group_key,
  count(*) AS total_count,
  bqutil.datasketches.kll_sketch_float_build_k(x, 250) AS kll_sketch
FROM (
  SELECT
    CONCAT("group_key_", CAST(RAND() * 100 AS INT64)) AS group_key,
    RAND() AS x
  FROM
  UNNEST(GENERATE_ARRAY(1, 1000000))) as sample_data
GROUP BY group_key;

BQ Error:
Query error: ReferenceError: sketch is not defined at bqutil.datasketches.kll_sketch_float_build_k(FLOAT64, INT64) line 44, columns 27-28 at [10:1]

Potential issue:
https://github.com/apache/datasketches-bigquery/blob/main/kll/sqlx/kll_sketch_float_build_k.sqlx#L73C6-L73C38

sketch.merge(state.serialized);
sketch referenced without state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions