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

feat: add support for Hive partitioning options when creating external tables #236

Merged
merged 1 commit into from Mar 20, 2020

Conversation

ekanth
Copy link
Contributor

@ekanth ekanth commented Mar 20, 2020

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #235 ☕️

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Mar 20, 2020
@ekanth
Copy link
Contributor Author

ekanth commented Mar 20, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Mar 20, 2020
@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@6213ea9). Click here to learn what that means.
The diff coverage is 53.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #236   +/-   ##
=========================================
  Coverage          ?   77.53%           
  Complexity        ?     1151           
=========================================
  Files             ?       75           
  Lines             ?     6089           
  Branches          ?      654           
=========================================
  Hits              ?     4721           
  Misses            ?     1019           
  Partials          ?      349
Impacted Files Coverage Δ Complexity Δ
...google/cloud/bigquery/HivePartitioningOptions.java 83.78% <20%> (ø) 11 <2> (?)
...google/cloud/bigquery/ExternalTableDefinition.java 57.69% <70%> (ø) 19 <1> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6213ea9...5d017bd. Read the comment docs.

*/
@SuppressWarnings("unchecked")
@Nullable
public abstract HivePartitioningOptions getHivePartitioningOptions();
Copy link
Contributor

Choose a reason for hiding this comment

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

this breaks binary compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @stephaniewang526 for the review. I will update the patch and send again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stephaniewang526, @pmakani I updated the patch and I wonder if the tests would automatically run?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stephaniewang526, thanks for triggering the tests. It was my bad with the previous patch - I missed a line that I fixed locally related to the test failures. Could you please trigger the tests again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @stephaniewang526. All tests passed now.

@stephaniewang526
Copy link
Contributor

In general, when you make a commit please be sure to:

  1. make initial commit message in the format - "feat: blah blah..." (note that "blah" has a space in front of the colon and is in lowercase)

  2. run maven coveo code formatter so that code format is correct: mvn com.coveo:fmt-maven-plugin:format

  3. check and make sure all builds succeed and correct any build failures. In this case, abstract classes were added which break binary compatibility --

[ERROR] 7013: com.google.cloud.bigquery.ExternalTableDefinition: Abstract method 'public com.google.cloud.bigquery.HivePartitioningOptions getHivePartitioningOptions()' has been added
[ERROR] 7013: com.google.cloud.bigquery.ExternalTableDefinition$Builder: Abstract method 'public com.google.cloud.bigquery.ExternalTableDefinition$Builder setHivePartitioningOptions(com.google.cloud.bigquery.HivePartitioningOptions)' has been added

we don't want to do this because this renders our client unstable and would break customer's existing implementation. I suggest to try either implement without abstract and add default implementation or encapsulate with an inner method.

@stephaniewang526 stephaniewang526 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@stephaniewang526 stephaniewang526 changed the title Add support for Hive partitioning options when creating external tables feat: add support for Hive partitioning options when creating external tables Mar 20, 2020
@stephaniewang526 stephaniewang526 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2020
@@ -135,6 +135,9 @@ public Builder setFormatOptions(FormatOptions formatOptions) {
/** Sets the table schema. */
public abstract Builder setSchema(Schema schema);

/** Sets the table Hive partitioning options. */
public abstract Builder setHivePartitioningOptions(HivePartitioningOptions hivePartitioningOptions);
Copy link
Contributor

Choose a reason for hiding this comment

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

this breaks binary compatibility

@stephaniewang526 stephaniewang526 merged commit ccc2bb3 into googleapis:master Mar 20, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 20, 2020
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.

Need support for Hive partitioning options when creating external table
5 participants