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

Expand push_back for arrayWriter support to generics and strings. #8334

Closed

Conversation

laithsakka
Copy link
Contributor

@laithsakka laithsakka commented Jan 10, 2024

Summary:

This simplify functions in two ways:

  1. one common pattern in functions is
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }

now can be done in one line
out.push_back(inputArray[i]);

  1. since primitive and generic with this have same interface many duplicate of functions wont be needed.

Differential Revision: D52672124

Copy link

netlify bot commented Jan 10, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 3d9b736
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/659f172d6c9bb30008b213dd

@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 Jan 10, 2024
@facebook-github-bot
Copy link
Contributor

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

laithsakka added a commit to laithsakka/velox that referenced this pull request Jan 10, 2024
…cebookincubator#8334)

Summary:

This simply functions alot in two ways:

- one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(item);

- since primitive and generic with this have same interface many duplicate of functions wont be needed.
(See examples in the diff).

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

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

@facebook-github-bot
Copy link
Contributor

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

laithsakka added a commit to laithsakka/velox that referenced this pull request Jan 10, 2024
…cebookincubator#8334)

Summary:

This simply functions alot in two ways:
1. one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(inputArray[i]);

2. since primitive and generic with this have same interface many duplicate of functions wont be needed.

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

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

…cebookincubator#8334)

Summary:

This simply functions alot in two ways:
1. one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(inputArray[i]);

2. since primitive and generic with this have same interface many duplicate of functions wont be needed.

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

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

laithsakka added a commit to laithsakka/velox that referenced this pull request Jan 10, 2024
…cebookincubator#8334)

Summary:

This simplify functions  in two ways:
1. one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(inputArray[i]);

2. since primitive and generic with this have same interface many duplicate of functions wont be needed.

Differential Revision: D52672124
laithsakka added a commit to laithsakka/velox that referenced this pull request Jan 10, 2024
…cebookincubator#8334)

Summary:

This simplify functions  in two ways:
1. one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(inputArray[i]);

2. since primitive and generic with this have same interface many duplicate of functions wont be needed.

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

This pull request has been merged in 5e38168.

liujiayi771 pushed a commit to liujiayi771/velox that referenced this pull request Jan 16, 2024
…cebookincubator#8334)

Summary:
Pull Request resolved: facebookincubator#8334

This simplify functions  in two ways:
-  one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(inputArray[i]);.

- since primitive and generic with this have same interface many duplicate of functions body wont be needed.

Reviewed By: amitkdutta

Differential Revision: D52672124

fbshipit-source-id: 1397461b59a82d7aec99d762e6f1c955191df55a
mbasmanova pushed a commit to mbasmanova/velox-1 that referenced this pull request Jan 17, 2024
…cebookincubator#8334)

Summary:
Pull Request resolved: facebookincubator#8334

This simplify functions  in two ways:
-  one common pattern in functions is
```
     if (inputArray[i].has_value()) {
        auto& newItem = out.add_item();
        newItem.copy_from(inputArray[i].value());
      } else {
        out.add_null();
      }
````
now can be done in one line
      out.push_back(inputArray[i]);.

- since primitive and generic with this have same interface many duplicate of functions body wont be needed.

Reviewed By: amitkdutta

Differential Revision: D52672124

fbshipit-source-id: 1397461b59a82d7aec99d762e6f1c955191df55a
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.

2 participants