-
Notifications
You must be signed in to change notification settings - Fork 76
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
skip presto view parsing #211
Changes from 6 commits
0deda8d
8cec0a9
a0574be
8eb2a05
59e3461
a765d92
35d47cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,15 @@ public MetaStoreFilterHook getMetastoreFilter() { | |
|
||
@Override | ||
public Table transformOutboundTable(Table table) { | ||
table.setDbName(metaStoreMapping.transformOutboundDatabaseName(table.getDbName())); | ||
String originalDatabaseName = table.getDbName(); | ||
String databaseName = metaStoreMapping.transformOutboundDatabaseName(originalDatabaseName); | ||
table.setDbName(databaseName); | ||
if (databaseName.equalsIgnoreCase(originalDatabaseName)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what's going on here - why is the db name the same in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if it is that's true that's why I'm checking: This creeped in when we removed the IdentityMapping (which was just returning table for non prefixed metastores). So the if will mimic that behaviour again. |
||
// Skip all the view parsing if nothing is going to change, the parsing is not without problems and we can't catch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it worth keeping the code on line 123 since that will throw an error still? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the original can't have the same string as the extended cause it also needs the colon. if we add it will it still throw an error? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I return the table in this if so we'll not even try to parse. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, but if the database name is different it will still throw an error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No because I skip parsing in the parser class for Presto markers. The if in here is to ensure other crazy markers don't also through errors. The code here is to basically get back to same support as in pre WD 3.6.0. WD 3.7.0 introduced the problems. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, thanks for creating that issue. So for now we'll return the Presto view "as is" but that could mean it won't actually work since it doesn't have the correct prefixes and that's what #212 is all about. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct this is fixing and reverting old behaviour. Make it work again if there are no prefixes to remove. |
||
// all use cases here. For instance Presto creates views that are stored in these fields and this is stored | ||
// differently than Hive. There might be others. | ||
return table; | ||
} | ||
if (table.isSetViewExpandedText()) { | ||
try { | ||
log.debug("Transforming ViewExpandedText: {}", table.getViewExpandedText()); | ||
|
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.
The function name
hasMarker
isn't super descriptive. Can we change it to something likehasIncompatibleViewMarker
, orhasPrestoViewMarker
, orhasNonHiveViewMarker
, or something like that?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.
sure I like
hasNonHiveViewMarker