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

refactor: Support parameters in custom type resolving #12402

Closed
wants to merge 1 commit into from

Conversation

Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Feb 20, 2025

Summary:
Support TypeParameter when creating custom types. For tdigest this
is not absolutely necessary, since the only parameter supported is double, but
it would be nice to have this ready so we can use it with qdigest(T).

Differential Revision: D69879669

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 20, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69879669

Copy link

netlify bot commented Feb 20, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit ff08341
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67b75c1e26e5fa0008bc40f8

Yuhta added a commit to Yuhta/velox that referenced this pull request Feb 20, 2025
…tor#12402)

Summary:

Support `TypeParameter` when creating custom types.  For `tdigest` this
is not absolutely necessary, since the only parameter supported is `double`, but
it would be nice to have this ready so we can use it with `qdigest(T)`.

Differential Revision: D69879669
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69879669

Yuhta added a commit to Yuhta/velox that referenced this pull request Feb 20, 2025
…tor#12402)

Summary:

Support `TypeParameter` when creating custom types.  For `tdigest` this
is not absolutely necessary, since the only parameter supported is `double`, but
it would be nice to have this ready so we can use it with `qdigest(T)`.

Differential Revision: D69879669
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69879669

…tor#12402)

Summary:

Support `TypeParameter` when creating custom types.  For `tdigest` this
is not absolutely necessary, since the only parameter supported is `double`, but
it would be nice to have this ready so we can use it with `qdigest(T)`.

Differential Revision: D69879669
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D69879669

@@ -256,7 +258,7 @@ TEST_F(CustomTypeTest, nullConstant) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Does CustomTypeTest.getCustomTypeNames test need to be updated to use another function? T-Digest isn't returned from Type.getCustomNames().

Is that expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably are not registering the type factory during test initialization. That's super minor.

Copy link
Contributor

@xiaoxmeng xiaoxmeng left a comment

Choose a reason for hiding this comment

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

@Yuhta LGTM. Thanks!

for (auto& param : parameters_) {
children.push_back(param.type->serialize());
}
obj["cTypes"] = children;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/cTypes/childTypes/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That name is already used by the serialization framework, not sure how dangerous is if we change it now

return TDIGEST();
TypePtr getType(const std::vector<TypeParameter>& parameters) const override {
VELOX_CHECK_EQ(parameters.size(), 1);
VELOX_CHECK(parameters[0].kind == TypeParameterKind::kType);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use VELOX_CHECK_EQ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No there is a build error on GitHub complaining don't know how to convert kType to string

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 027452c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants