-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
There is no supertype when CROSS to INNER JOIN rewrite WHERE a.key=b.key-1 #21794
Comments
It's expected, because Any ideas how to handle it? |
Well, it works in regular WHERE condition:
So clickhouse just blindly convert a.number and (b.number - 1) to Int64 and hope that numbers just not big enough. |
Can we just convert minus to plus?
It probably shouldn't break more than we have now, i guess. |
|
No way, probably. Hash join uses binary comparison for keys, so it requires a supertype. Logical comparison with |
No.
Ok, but for example we have Int64 and UInt64 as datatypes for keys, and have equals condition on them. So we actually don't care for any Int64 keys < 0, because we already know that we can't find corresponding UInt64 key for them. |
You're right, we don't need a supertype, but only a type that can hold any common value of the key types. For UInt64 and Int64, the common values are nonnegative Int64, which fit into UInt64. Now I start remembering that this is kind of what we wanted to do with automated type conversion for |
For query |
I am wrong.
Postgresql just convert all to numberic:
|
We don't need "least supertype" when doing JOIN. We already applying this method for Ask @kitaisreal for the details if you need. |
Absolutely. We already have |
@vdimir Let's apply it only for |
It could be applied to LEFT/RIGHT join as well. |
@vdimir is it still relevant? |
I suppose yes, I've made attempts, but not finished yet. I'm going to continue this task |
Describe the bug
There is no supertype for types UInt64, Int64. CROSS to INNER JOIN rewrite WHERE a.key=b.key-1
How to reproduce
21.4.1.6210
The text was updated successfully, but these errors were encountered: