Skip to content

Conversation

@arhimondr
Copy link
Member

No description provided.

@arhimondr
Copy link
Member Author

arhimondr commented Jul 20, 2018

Note: this implementation follows existing EQUALS semantics. abc is considered different than abc (abc[space] != abc[space][space]). It is consistent with current count(DISTINCT c_char) semantics.

Copy link
Contributor

@jessesleeping jessesleeping left a comment

Choose a reason for hiding this comment

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

LGTM

@findepi
Copy link
Contributor

findepi commented Jul 20, 2018

abc[space] != abc[space][space]

this are values of different types: char(4) and char(5) respectively

if you meant internal representation, then note that trailing spaces are strictly forbidden in internal representation

assertQuery("SELECT approx_distinct(CAST(custkey AS VARCHAR), 0.023) FROM orders", "SELECT 1036");

// test char
assertQuery("SELECT approx_distinct(CAST(CAST(custkey AS VARCHAR) AS CHAR(20))) FROM orders", "SELECT 1036");
Copy link
Contributor

Choose a reason for hiding this comment

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

i guess CAST(custkey AS CHAR(20)) is not enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, there is no direct cast operator

@arhimondr arhimondr merged commit 2036070 into prestodb:master Jul 20, 2018
@arhimondr arhimondr deleted the approx-distinct-char branch August 2, 2018 15:20
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.

4 participants