jinggou commented on code in PR #1704:
URL: https://github.com/apache/phoenix/pull/1704#discussion_r1357583251
##########
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:
setViewTypeToBe needs connection to SYSTEM_CHILD_LINK_TABLE, which is used
to get sibling views and mark if view is updatable. How can we avoid calling it?
--
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]