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

Changes to support common view #377

Merged
merged 2 commits into from
Dec 3, 2019
Merged

Changes to support common view #377

merged 2 commits into from
Dec 3, 2019

Conversation

zhljen
Copy link
Contributor

@zhljen zhljen commented Dec 2, 2019

No description provided.

/**
* Iceberg table type.
*/
public static final String COMMON_VIEW = "common_view";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this lower-cased?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, this is a key in table paramters, e.g.

parameters: {
previous_metadata_location: "",
metadata_location: "s3n:https://netflixxee.metadata.json",
common_view: "true",
table_type: "VIRTUAL_VIEW"
},

return;
}
}
final String message = String.format("Originally table %s is not type of iceberg ", tableName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Message should have the correct context in terms of iceberg vs common-view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The validation error here is that "we can't update a table that is not an iceberg table or not a common view". I have updated the message.
I don't think we can't tell if the table should be an iceberg table/common view but it is not so that we can give out the message separately.

@@ -159,11 +170,36 @@ public void update(final ConnectorRequestContext requestContext, final TableInfo
} else {
directSqlTable.updateIcebergTable(tableInfo);
}
} else if (connectorContext.getConfig().isCommonViewEnabled()
Copy link
Contributor

Choose a reason for hiding this comment

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

We should refactor this to handle common-view separately in a different method (handleCommonView). Also refactor the iceberg code to handleIcebergTable)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, refactored as suggested.

@zhljen zhljen merged commit cc158f9 into Netflix:master Dec 3, 2019
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.

2 participants