jinggou commented on code in PR #1704:
URL: https://github.com/apache/phoenix/pull/1704#discussion_r1355629441


##########
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);
+                        } catch (IOException e) {
+                            throw new RuntimeException(e);

Review Comment:
   not sure if try-catch here is a good practice



-- 
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]

Reply via email to