code: private void checkConstraint(
  		SqlValidatorTable validatorTable,
  		SqlUpdate update,
  		RelDataType targetRowType) {
  		final ModifiableViewTable modifiableViewTable =
  			validatorTable.unwrap(ModifiableViewTable.class);
  		if (modifiableViewTable != null) {
  			final Table table = modifiableViewTable.unwrap(Table.class);
  			final RelDataType tableRowType = table.getRowType(typeFactory);
  
  			final Map<Integer, RexNode> projectMap =
  				RelOptUtil.getColumnConstraints(modifiableViewTable, targetRowType,
  					typeFactory);
  			final Map<String, Integer> nameToIndex =
  				SqlValidatorUtil.mapNameToIndex(tableRowType.getFieldList());
  
  			// Validate update values against the view constraint.
  			final List<SqlNode> targets = update.getTargetColumnList().getList();
  			final List<SqlNode> sources = update.getSourceExpressionList().getList();
  			for (final Pair<SqlNode, SqlNode> column : Pair.zip(targets, sources)) {
  				final String columnName = ((SqlIdentifier) column.left).getSimple();
  				final Integer columnIndex = nameToIndex.get(columnName);
  				if (projectMap.containsKey(columnIndex)) {
  					final RexNode columnConstraint = projectMap.get(columnIndex);
  					final ValidationError validationError =
  						new ValidationError(column.right,
  							RESOURCE.viewConstraintNotSatisfied(columnName,
  								Util.last(validatorTable.getQualifiedName())));
  					RelOptUtil.validateValueAgainstConstraint(column.right,
  						columnConstraint, validationError);
  				}
  			}
  		}
  	}
docs: Validates updates against the constraint of a modifiable view.
  
  @param validatorTable A {@link SqlValidatorTable} that may wrap a
  ModifiableViewTable
  @param update         The UPDATE parse tree node
  @param targetRowType  The target type