-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Sync Tool registers 2 tables, RO and RT Tables #210
Conversation
//sync a RO table for MOR | ||
syncHoodieTable(false); | ||
String originalTableName = cfg.tableName; | ||
cfg.tableName = cfg.tableName + SUFFIX_REALTIME_TABLE; |
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.
Another way to do this is to add an optional config parameter to HiveSyncConfig (only for MOR type of tables) and then refactor parts of HiveSyncTool and HiveHoodieClient to use it conditionally for MOR table types. I feel this keeps conditional clauses away from HiveHoodieClient,HiveSyncTool.
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.
Can you leave a todo - its always best to have a possible config
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.
Looks okay to me overall. Few minor comments.
//sync a RO table for MOR | ||
syncHoodieTable(false); | ||
String originalTableName = cfg.tableName; | ||
cfg.tableName = cfg.tableName + SUFFIX_REALTIME_TABLE; |
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.
Can you leave a todo - its always best to have a possible config
switch(hoodieHiveClient.getTableType()) { | ||
case COPY_ON_WRITE: | ||
syncHoodieTable(false); | ||
hoodieHiveClient.close(); |
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.
Do this once outside the switch
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.
I've added one to the default case. There should be no scenario where we reach outside the switch without an exception (in which case it doesn't there).
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.
I meant why repeat this on every case instead of doing it once outside the switch once.
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.
Makes sense, should've been obvious.
// TODO - RO Table for MOR only after major compaction (UnboundedCompaction is default for now) | ||
hoodieHiveClient.createTable(schema, HoodieInputFormat.class.getName(), | ||
MapredParquetOutputFormat.class.getName(), ParquetHiveSerDe.class.getName()); | ||
} else { | ||
// create RT Table |
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.
remove comment
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.
addressed.
4488228
to
7fe8623
Compare
7fe8623
to
36a1947
Compare
@prazanna I've addressed all the comments. |
No description provided.