diff --git a/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgDeclaration.java b/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgDeclaration.java index 65df942332..d1109c1e47 100644 --- a/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgDeclaration.java +++ b/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgDeclaration.java @@ -167,6 +167,9 @@ private static boolean hasRequiredTags( ImmutableList 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; } @@ -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 } } diff --git a/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgRegistry.java b/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgRegistry.java index 945edae476..399d03031d 100644 --- a/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgRegistry.java +++ b/core/src/main/java/org/polypheny/db/algebra/polyalg/PolyAlgRegistry.java @@ -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 )