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

Adding QueryParameter support in BigQuery #1451

Merged
merged 5 commits into from
Dec 7, 2016

Conversation

garrettjonesgoogle
Copy link
Member

@garrettjonesgoogle garrettjonesgoogle commented Dec 6, 2016

Also, adding DATE, TIME, and DATETIME support for legacy SQL types.

Fixes #1411

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 6, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 83.518% when pulling 6271268 on garrettjonesgoogle:master into b24ec1a on GoogleCloudPlatform:master.

Copy link
Contributor

@lesv lesv left a comment

Choose a reason for hiding this comment

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

PTAL

}

/** Returns the query parameter name. */
public String getName() {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

}

/** Returns the typed query parameter value. */
public QueryParameterValue getParameterValue() {

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 83.518% when pulling 38451c2 on garrettjonesgoogle:master into b24ec1a on GoogleCloudPlatform:master.

@garrettjonesgoogle
Copy link
Member Author

I decided to add the missing types TIME/DATE/DATETIME into LegacySQLTypeName to resolve #1388 .

@@ -0,0 +1,51 @@
/*
* Copyright 2015 Google Inc. All Rights Reserved.

This comment was marked as spam.

This comment was marked as spam.


/**
* A type used in legacy SQL contexts. For example, these types are used in query results,
* even if the query is a standard SQL query.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

* Creates a named {@code QueryParameter} object with the given value.
*/
public static QueryParameter named(String name, QueryParameterValue value) {
return new QueryParameter(name, value);

This comment was marked as spam.

This comment was marked as spam.

/**
* A type used in standard SQL contexts. For example, these types are used in queries
* with query parameters, which requires usage of standard SQL.
*/

This comment was marked as spam.

This comment was marked as spam.

}

/** Returns the query parameter name. */
public String getName() {

This comment was marked as spam.

This comment was marked as spam.

}

/** Returns the query parameter name. */
public String getName() {

This comment was marked as spam.

if (queryParameters == null) {
queryParameters = Lists.newArrayList();
}
queryParameters.add(checkNotNull(queryParameter));

This comment was marked as spam.

This comment was marked as spam.

* Sets the query parameters for the query.
*
* The set of query parameters must either be all positional or all named parameters.
* Positional parameters are denoted in the query with a question mark (?), and named

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


private QueryParameterValue(Builder builder) {
checkArgument(
(builder.arrayValues != null) == (StandardSQLTypeName.ARRAY.equals(builder.type)));

This comment was marked as spam.


private QueryParameterValue(Builder builder) {
checkArgument(
(builder.arrayValues != null) == (StandardSQLTypeName.ARRAY.equals(builder.type)));

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 83.52% when pulling 0173f63 on garrettjonesgoogle:master into b24ec1a on GoogleCloudPlatform:master.

@aozarov
Copy link
Contributor

aozarov commented Dec 7, 2016

I decided to add the missing types TIME/DATE/DATETIME into LegacySQLTypeName to resolve #1388

Update PR description?

@garrettjonesgoogle
Copy link
Member Author

Description updated.

@garrettjonesgoogle
Copy link
Member Author

Review comments addressed - PTAL

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 83.559% when pulling 179132b on garrettjonesgoogle:master into b24ec1a on GoogleCloudPlatform:master.

@garrettjonesgoogle garrettjonesgoogle merged commit 0f6a47e into googleapis:master Dec 7, 2016
}

private static <T> StandardSQLTypeName classToType(Class<T> type) {
if (Boolean.class.isAssignableFrom(type)) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

* <p>A named parameter cannot be added after positional parameters have been added.
*/
public Builder addNamedParameter(String name, QueryParameterValue value) {
checkNotNull(value);

This comment was marked as spam.

github-actions bot pushed a commit that referenced this pull request Aug 25, 2022
…datatransfer to v2.3.5 (#1451)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-bigquerydatatransfer](https://togithub.com/googleapis/java-bigquerydatatransfer) | `2.3.4` -> `2.3.5` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerydatatransfer/2.3.5/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerydatatransfer/2.3.5/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerydatatransfer/2.3.5/compatibility-slim/2.3.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-bigquerydatatransfer/2.3.5/confidence-slim/2.3.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-bigquerydatatransfer</summary>

### [`v2.3.5`](https://togithub.com/googleapis/java-bigquerydatatransfer/blob/HEAD/CHANGELOG.md#&#8203;235-httpsgithubcomgoogleapisjava-bigquerydatatransfercomparev234v235-2022-08-24)

[Compare Source](https://togithub.com/googleapis/java-bigquerydatatransfer/compare/v2.3.4...v2.3.5)

##### Dependencies

-   update dependency com.google.cloud:google-cloud-bigquery to v2.14.7 ([#&#8203;1448](https://togithub.com/googleapis/java-bigquerydatatransfer/issues/1448)) ([3310cbb](https://togithub.com/googleapis/java-bigquerydatatransfer/commit/3310cbb4f30964e4d36bcbd1f80278cac1eef9d0))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-bigquerydatatransfer).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNzQuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE3NC4wIn0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants