virajjasani commented on code in PR #1704:
URL: https://github.com/apache/phoenix/pull/1704#discussion_r1357540449
##########
phoenix-core/src/main/java/org/apache/phoenix/compile/CreateTableCompiler.java:
##########
@@ -160,9 +170,23 @@ public MutationPlan compile(CreateTableStatement create)
throws SQLException {
viewColumnConstantsToBe = new byte[nColumns][];
ViewWhereExpressionVisitor visitor = new
ViewWhereExpressionVisitor(parentToBe, viewColumnConstantsToBe);
where.accept(visitor);
+
+ viewTypeToBe = visitor.isUpdatable() ? ViewType.UPDATABLE
: ViewType.READ_ONLY;
+ if (viewTypeToBe == ViewType.UPDATABLE) {
+ ViewWhereExpressionValidatorVisitor validatorVisitor =
+ new
ViewWhereExpressionValidatorVisitor(parentToBe,
+ pkColumnsInWhere, nonPkColumnsInWhere);
+ where.accept(validatorVisitor);
+ try {
+ viewTypeToBe = setViewTypeToBe(connection,
parentToBe, pkColumnsInWhere,
+ nonPkColumnsInWhere);
Review Comment:
test failures are due to
```
@Override
public Table getTable(byte[] tableName) throws SQLException {
throw new UnsupportedOperationException();
}
```
let's avoid calling `setViewTypeToBe` if we are going to use
`ConnectionlessQueryServicesImpl`, no need to remove tests.
--
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]