Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus fix for count(*) #23703

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lukmanulhakkeem
Copy link

@lukmanulhakkeem lukmanulhakkeem commented Sep 23, 2024

Description

In this Presto pull request, we are addressing the issue where a SELECT count(*) query returns an empty columnHandles list, leading to an ArrayIndexOutOfBoundsException when the function columnHandles.get(0).getColumnType() is called. To handle this, we are bypassing the conversion from metricHeader to a Block type (performed by the getBlockFromMap function at line 293 in PrometheusRecordCursor.java). We are modifying the constructor of PrometheusStandardizedRow to accept a Map type rather than a Block. The conversion to BlockFromMap is now deferred to the getFieldValue function, where getLabels() is used.

Honoring the Trino PR: trinodb/trino#12510

Motivation and Context

#23702

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* ... :pr:`12345`
* ... :pr:`12345`

Hive Connector Changes
* ... :pr:`12345`
* ... :pr:`12345`

If release note is NOT required, use:

== NO RELEASE NOTE ==

Copy link

linux-foundation-easycla bot commented Sep 23, 2024

CLA Missing ID CLA Not Signed

@agrawalreetika
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants