@@ -508,10 +508,40 @@ public List<FieldReference> fieldReferences(Rel input, int... indexes) {
508508 .collect (java .util .stream .Collectors .toList ());
509509 }
510510
511+ /**
512+ * Creates a field reference for a join operation by index across both left and right relations.
513+ * The index spans across the combined schema of both join inputs, where fields from the left
514+ * relation come first, followed by fields from the right relation.
515+ *
516+ * @param inputs the join inputs containing both left and right relations
517+ * @param index the zero-based field index across the combined schema of both relations
518+ * @return a {@link FieldReference} pointing to the specified field in the join context
519+ */
520+ public FieldReference fieldReference (JoinInput inputs , int index ) {
521+ return FieldReference .newInputRelReference (index , List .of (inputs .left , inputs .right ));
522+ }
523+
511524 public FieldReference fieldReference (List <Rel > inputs , int index ) {
512525 return FieldReference .newInputRelReference (index , inputs );
513526 }
514527
528+ /**
529+ * Creates multiple field references for a join operation by indexes across both left and right
530+ * relations. Each index spans across the combined schema of both join inputs, where fields from
531+ * the left relation come first, followed by fields from the right relation.
532+ *
533+ * @param inputs the join inputs containing both left and right relations
534+ * @param indexes the zero-based field indexes across the combined schema of both relations
535+ * @return a list of {@link FieldReference} objects pointing to the specified fields in the join
536+ * context
537+ */
538+ public List <FieldReference > fieldReferences (JoinInput inputs , int ... indexes ) {
539+ final List <Rel > inputsList = List .of (inputs .left , inputs .right );
540+ return Arrays .stream (indexes )
541+ .mapToObj (index -> fieldReference (inputsList , index ))
542+ .collect (java .util .stream .Collectors .toList ());
543+ }
544+
515545 public List <FieldReference > fieldReferences (List <Rel > inputs , int ... indexes ) {
516546 return Arrays .stream (indexes )
517547 .mapToObj (index -> fieldReference (inputs , index ))
0 commit comments