Skip to content

Conversation

@pdabre12
Copy link
Contributor

@pdabre12 pdabre12 commented Aug 1, 2024

Description

Adds a native function namespace manager

Motivation and Context

To help resolve : #23000

Impact

Test Plan

Unit and end-to-end tests. More comprehensive end-to-end tests will be written in the future.

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
== RELEASE NOTES ==

General C++ changes
* Add a native function namespace manager :pr:`23358`

Depends on : #23671

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 1, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch from 49d3b9d to 5ed5a18 Compare August 13, 2024 23:37
@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch 2 times, most recently from bcb09bc to ce7ca4b Compare August 17, 2024 00:06
steveburnett
steveburnett previously approved these changes Sep 10, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)

Pull branch, new local doc build, the doc looks good. Thanks!

@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch from 4d00991 to c3ed29f Compare September 13, 2024 23:03
@pdabre12 pdabre12 changed the title [WIP] Native function namespace manager [WIP] Add a native function namespace manager Sep 13, 2024
steveburnett
steveburnett previously approved these changes Sep 25, 2024
Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)

Pull updated branch, new local doc build, doc looks good. Thanks!

@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch 2 times, most recently from 3fde055 to ebfa361 Compare September 27, 2024 05:55
@pdabre12 pdabre12 changed the title [WIP] Add a native function namespace manager Add a native function namespace manager Sep 27, 2024
@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch from f203d25 to 88e1152 Compare November 1, 2024 01:09
@pdabre12 pdabre12 marked this pull request as ready for review November 1, 2024 16:40
@pdabre12 pdabre12 requested a review from presto-oss November 1, 2024 16:40
@tdcmeehan tdcmeehan self-assigned this Nov 11, 2024
Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Just some initial comments

Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Refactored qualifyObjectName from static to instance method

Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Add utility functions to resolve intermediate type in aggregate funct…

Thank you for the really extensive tests for this utility. I think the tests should be broken down to the various different types, because the tests are rather large.

Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

[native] Fix bug when handling multiple params and no params aggregat…

Can you help me understand when this bug manifests? Is there any way to add a unit test for it?

@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch from d7dec93 to c4fe9ec Compare January 31, 2025 17:18
@pdabre12 pdabre12 requested a review from tdcmeehan January 31, 2025 17:21
@pdabre12 pdabre12 force-pushed the native-function-namespace-manager branch from c4fe9ec to 38edeb3 Compare January 31, 2025 18:25
tdcmeehan
tdcmeehan previously approved these changes Jan 31, 2025
folly::split(
'.',
prestoDefaultNamespacePrefix,
prestoDefaultNamespacePrefixParts,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add CHECK that prestoDefaultNamespacePrefixParts has only 2 parts.

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

@pdabre12 : Have 2 minor comments.


std::vector<std::string> parts;
folly::split('.', functionName, parts, true);
if ((parts.size() != 3) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a check instead ? Are there functions that don't follow since (since you added all the built-ins with prefixes) ?

Copy link
Contributor Author

@pdabre12 pdabre12 Jan 31, 2025

Choose a reason for hiding this comment

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

All the functions should have a prefix. Added the check, thanks.

#include "presto_cpp/presto_protocol/core/presto_protocol_core.h"
#include "velox/core/Expressions.h"

namespace {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider moving this to presto_cpp/main/common/Utils.h

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @pdabre12

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.

Add fail-fast function validation support for Presto C++

5 participants