deniskuzZ commented on code in PR #4869:
URL: https://github.com/apache/hive/pull/4869#discussion_r1405240351
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/views/HiveAugmentSnapshotMaterializationRule.java:
##########
@@ -125,11 +129,20 @@ public void onMatch(RelOptRuleCall call) {
Table table = hiveTable.getHiveTableMD();
SnapshotContext mvMetaTableSnapshot =
mvMetaStoredSnapshot.get(table.getFullyQualifiedName());
- if
(mvMetaTableSnapshot.equals(table.getStorageHandler().getCurrentSnapshotContext(table)))
{
+ if (table.getStorageHandler() == null) {
+ throw new UnsupportedOperationException(String.format("Table %s does not
have Storage handler defined. " +
+ "Mixing native and non-native tables in a materialized view
definition is currently not supported!",
+ table.getFullyQualifiedName()));
+ }
+ if (Objects.equals(mvMetaTableSnapshot,
table.getStorageHandler().getCurrentSnapshotContext(table))) {
return;
}
-
table.setVersionIntervalFrom(Long.toString(mvMetaTableSnapshot.getSnapshotId()));
+ Long snapshotId = null;
+ if (mvMetaTableSnapshot != null) {
Review Comment:
````
Long snapshotId = mvMetaTableSnapshot != null ?
mvMetaTableSnapshot.getSnapshotId() : null;
table.setVersionIntervalFrom(String.valueOf(snapshotId));
````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]