Conversation
| @@ -2105,7 +2105,13 @@ private void getMetaData(QB qb, ReadEntity parentInput) | |||
| Table tab = getTableObjectByName(tabName, false); | |||
| if (tab != null) { | |||
| // do a deep copy, in case downstream changes it. | |||
There was a problem hiding this comment.
Can we update the comment since this is no longer deep copy?
There was a problem hiding this comment.
This has not changed, it is still creating a deep copy of the metastore table.
...tab.getTTable().deepCopy()...
There was a problem hiding this comment.
The constraints are not deep copied though, you are right. Those should not change in any case; I will change the comment accordingly.
|
|
||
| @Override | ||
| protected Table getTableObjectByName(String tableName, boolean throwException) throws HiveException { | ||
| if (!tabNameToTabObject.containsKey(tableName)) { |
There was a problem hiding this comment.
What happens if although tableName is same but they are different tables belonging to different database?
There was a problem hiding this comment.
This is the qualified table name (see L1226 in Hive.java).
| private Table getTable(String tableName) { | ||
| if (!tablesCache.containsKey(tableName)) { | ||
| try { | ||
| Table table = db.getTable(tableName); |
There was a problem hiding this comment.
Null check for db? HiveMaterializedViewsRegistry.java is passing NULL for db.
There was a problem hiding this comment.
You do not need the null check; this will never be called for materialized views, since currently you cannot define constraints on them. Not sure if you mean that?
There was a problem hiding this comment.
L:393 in HiveMaterializedViewsRegistry creates new RelOptHiveTable by passing NULL for db. getTable here is using db to call getTable. I meant it should be checked if db is null or not before calling getTable on it
There was a problem hiding this comment.
I prefer that it fails instead of ignoring the retrieval silently, as it should never be null unless you know what you are doing, i.e. materialized views. I can add a comment in the table creation in HiveMaterializedViewsRegistry.
… traffic (Jesus Camacho Rodriguez, reviewed by Vineet Garg) Close apache#663 Change-Id: Icc15e8944e6110d8d40d2816ee451a2e6a980c03
No description provided.