-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Support comparison for ipprefix [3/n] #11546
Conversation
This pull request was exported from Phabricator. Differential Revision: D65521072 |
✅ Deploy Preview for meta-velox canceled.
|
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
90db886
to
a24558c
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
a24558c
to
30d72b2
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
30d72b2
to
9d883a8
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
9d883a8
to
d2d01f5
Compare
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
This pull request was exported from Phabricator. Differential Revision: D65521072 |
d2d01f5
to
4bb987a
Compare
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
4bb987a
to
1517279
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
1517279
to
59ec40d
Compare
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
auto left = makeArrayOfRowVector( | ||
IPPREFIX(), | ||
{{ipprefix("2001:0db8:0000:0000:0000:ff00:0042:8329/128")}, | ||
{ipprefix("1.2.3.4/32")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presto has this:
> select ipprefix '1.2.3.4/24' = ipprefix '1.2.3.5/24';
_col0
-------
true
(1 row)
Can we make sure Velox behaves the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with the new test case, thanks Jimmy!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result should be true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, we are masking the extra bits to zeros like Java did when we creating new ipprefix, so we don't need this test case (it's invalid input).
59ec40d
to
0a75675
Compare
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
This pull request was exported from Phabricator. Differential Revision: D65521072 |
0a75675
to
8726e15
Compare
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
8726e15
to
49418ed
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
49418ed
to
ecf18b1
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Differential Revision: D65521072
ecf18b1
to
e89edac
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Reviewed By: Yuhta Differential Revision: D65521072
e89edac
to
c210b19
Compare
This pull request was exported from Phabricator. Differential Revision: D65521072 |
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Reviewed By: Yuhta Differential Revision: D65521072
Summary: We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Reviewed By: Yuhta Differential Revision: D65521072
This pull request has been merged in c12207a. |
Summary: Pull Request resolved: facebookincubator#11546 We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>. Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free. Reviewed By: Yuhta Differential Revision: D65521072 fbshipit-source-id: 3e21e2fa4ff5d1306dc5dde601168bb659e54303
Summary:
We need to support comparison for IPPrefix, which has underlying type of RowVector<HUGEINT, TINYINT>.
Since the first 16 bytes of IPPrefix is pretty much the same as IPAddress, we can just convert the underlying type of IPPrefix to RowVector<IPADDRESS, TINYINT>. Since IPADDRESS already has its custom comparison defined, and rowVector by default compares left to right, this takes of comparison for us for free.
Differential Revision: D65521072