-
Notifications
You must be signed in to change notification settings - Fork 119
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 clone #2553
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
@shollyman PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this! I'm always a little hesistant with extensions to TableDefinition due to it being a java-only pattern. I wonder if we should have a generic mechanism somewhere for populating the known common fields within the various table definition subclasses.
|
||
Table cloneTable = bigquery.getTable(DATASET, cloneTableName); | ||
assertNotNull(cloneTable); | ||
System.out.println(cloneTable.getDefinition().getType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing the System.out.println lines in here are stale debug statements that survived?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@@ -85,6 +85,8 @@ public Type apply(String constant) { | |||
|
|||
public static final Type SNAPSHOT = type.createAndRegister("SNAPSHOT"); | |||
|
|||
public static final Type CLONE = type.createAndRegister("CLONE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, here's the issue. We likely shouldn't make a new CloneTableDefinition at all. The type returned by the table metadata for a clone tables is still TABLE, not CLONE. It just has the CloneTableDefinition present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.. That Makes a lot more sense. By that definition shouldn't SNAPSHOT also follow a similar implementation flow? Or is that different?
Does creating a SNAPSHOT table change its definition?
No description provided.