Skip to content

Commit

Permalink
fix UnsupportedOperation issue due to ConnectionlessQueryServices used
Browse files Browse the repository at this point in the history
  • Loading branch information
jinggou committed Oct 18, 2023
1 parent d1614d4 commit 217a7cb
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.apache.phoenix.parse.SelectStatement;
import org.apache.phoenix.parse.TableName;
import org.apache.phoenix.query.ConnectionQueryServices;
import org.apache.phoenix.query.ConnectionlessQueryServicesImpl;
import org.apache.phoenix.query.QueryConstants;
import org.apache.phoenix.schema.ColumnRef;
import org.apache.phoenix.schema.MetaDataClient;
Expand Down Expand Up @@ -179,11 +180,13 @@ public MutationPlan compile(CreateTableStatement create) throws SQLException {
new ViewWhereExpressionValidatorVisitor(parentToBe,
pkColumnsInWhere, nonPkColumnsInWhere);
where.accept(validatorVisitor);
try {
viewTypeToBe = setViewTypeToBe(connection, parentToBe, pkColumnsInWhere,
nonPkColumnsInWhere);
} catch (IOException e) {
throw new RuntimeException(e);
if (!(connection.getQueryServices() instanceof ConnectionlessQueryServicesImpl)) {
try {
viewTypeToBe = setViewTypeToBe(connection, parentToBe, pkColumnsInWhere,
nonPkColumnsInWhere);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}

Expand Down

0 comments on commit 217a7cb

Please sign in to comment.