[ 
https://issues.apache.org/jira/browse/CALCITE-4431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246369#comment-17246369
 ] 

Vladimir Sitnikov commented on CALCITE-4431:
--------------------------------------------

Please clarify why do you object to the change. I believe it is a harmless 
change since most of the time the code is generated automatically, and the 
build script keeps the message aligned with the used variables.

I'm open to suggestions, especially for cases like the following:

{code:java}
  protected Correlate(
      RelOptCluster cluster,
      RelTraitSet traitSet,
      RelNode left,
      RelNode right,
      CorrelationId correlationId,
      ImmutableBitSet requiredColumns,
      JoinRelType joinType) {
    super(cluster, traitSet, left, right);
    assert !joinType.generatesNullsOnLeft() : "Correlate has invalid join type 
" + joinType;
    this.joinType = requireNonNull(joinType);
    this.correlationId = requireNonNull(correlationId);
    this.requiredColumns = requireNonNull(requiredColumns);
{code}

The constructor has three null checks, and it is hard to tell which triggers 
NPE.


> Use requireNonNull(var, "var") instead of requireNonNull(var) for better 
> error messages
> ---------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4431
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4431
>             Project: Calcite
>          Issue Type: Improvement
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Vladimir Sitnikov
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to