Skip to content

Commit

Permalink
Add ability to hide trivial arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-weber committed May 2, 2024
1 parent c99a315 commit 646182b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ private static boolean hasRequiredTags( ImmutableList<Parameter> params ) {
if ( p.requiresAlias && !p.tags.contains( ParamTag.ALIAS ) ) {
return false;
}
if (p.tags.contains( ParamTag.HIDE_TRIVIAL ) && ! p.tags.contains( ParamTag.ALIAS ) ) {
return false;
}
}
return true;
}
Expand Down Expand Up @@ -423,7 +426,12 @@ public enum ParamTag {
/**
* Indicates that negative values are not permitted (typically together with IntArg)
*/
NON_NEGATIVE
NON_NEGATIVE,

/**
* For projects and some other operators it is useful to let the user hide any trivial arguments in the UI
*/
HIDE_TRIVIAL
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private static void populateDeclarationsMap() {
declarations.put( LogicalRelProject.class, PolyAlgDeclaration.builder()
.creator( LogicalRelProject::create ).model( DataModel.RELATIONAL )
.opName( "PROJECT" ).opAliases( List.of( "P", "PROJECT#" ) ).numInputs( 1 ).opTags( logTags )
.param( Parameter.builder().name( "projects" ).tag( ParamTag.ALIAS ).isMultiValued( true ).type( ParamType.REX ).build() )
.param( Parameter.builder().name( "projects" ).tags( List.of(ParamTag.ALIAS, ParamTag.HIDE_TRIVIAL ) ).isMultiValued( true ).type( ParamType.REX ).build() )
.build() );
declarations.put( LogicalRelScan.class, PolyAlgDeclaration.builder()
.creator( LogicalRelScan::create ).model( DataModel.RELATIONAL )
Expand Down

0 comments on commit 646182b

Please sign in to comment.