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

record.getBoolean(columnName) fails while record.hasValue(columnName) succeeds in GenericRecord (version 0.7.0) #1971

Closed
dikshajoshi44 opened this issue Nov 25, 2024 · 3 comments

Comments

@dikshajoshi44
Copy link

dikshajoshi44 commented Nov 25, 2024

Description

I am encountering an issue with the GenericRecord interface from the com.clickhouse.client.api.query package in version 0.7.0. The method record.hasValue(columnName) returns true, indicating that the column has a value, but when I call record.getBoolean(columnName), it does not return the expected boolean value.

Steps to Reproduce

  1. Execute the following generic query to retrieve a record from ClickHouse:
    SELECT EXISTS (
        SELECT *
        FROM {table_name}
        WHERE column_name = '{value_placeholder}'
    );
  2. if (record.hasValue(columnName)) {
    boolean value = record.getBoolean(columnName); // This is where the issue occurs
    }

Expected Behavior

record.getBoolean(columnName) should return the correct boolean value when record.hasValue(columnName) returns true.

Environment

  • ClickHouse Client version: 0.7.0
  • Java version: 17
@chernser
Copy link
Contributor

chernser commented Dec 4, 2024

Thank you for reporting, @dikshajoshi44 !
Will look into it.

@chernser chernser self-assigned this Dec 4, 2024
@chernser chernser added this to the 0.7.2 milestone Dec 4, 2024
@chernser
Copy link
Contributor

Good day, @dikshajoshi44!
Is record.getBoolean() returns null or throws an exception? If exception - do you have a stack trace for that?
Thanks!

@chernser
Copy link
Contributor

Good day, @dikshajoshi44 !
I have not reproduced the issue on latest version 0.7.1-patch1
I think, this is duplicate of #1908

I'm closing the issue.

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

No branches or pull requests

2 participants