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 1 commit 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 Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: lukmanulhakkeem (94e072b)

@agrawalreetika
Copy link
Member

Copy link
Member

@agrawalreetika agrawalreetika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash all your commit to single commit and add proper commit message about the fix

prometheus.uri=http://localhost:9090
prometheus.query-chunk-duration=10m
prometheus.max-query-duration=1h
prometheus.uri=https://52.118.211.217:9090
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this ip here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidentally committed test ip. I removed the line

prometheus.cache-ttl=30s
#prometheus.tls.enabled=true
#prometheus.tls.truststore-path=/opt/presto/etc/cert/catalog/prometheus-truststore.jks
#prometheus.tls.truststore-password=changeit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are these commended properties here? If we don't need it in default then should we remove these?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are not needed and I removed them.

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