From cc245ac0c6a7f5335df7a828a460918ad09b5fe3 Mon Sep 17 00:00:00 2001 From: Rafael Biehler Date: Wed, 18 Dec 2024 11:22:28 +0100 Subject: [PATCH] Make it possible to insert test data --- .../db/routing/routers/BaseRouter.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dbms/src/main/java/org/polypheny/db/routing/routers/BaseRouter.java b/dbms/src/main/java/org/polypheny/db/routing/routers/BaseRouter.java index 6bd00cf352..fa58613f8d 100644 --- a/dbms/src/main/java/org/polypheny/db/routing/routers/BaseRouter.java +++ b/dbms/src/main/java/org/polypheny/db/routing/routers/BaseRouter.java @@ -196,10 +196,26 @@ protected List handleGeneric( AlgNode node, List builder.replaceTop( node.copy( node.getTraitSet(), ImmutableList.of( builder.peek( 1 ), builder.peek( 0 ) ) ), 2 ) + builder -> builder.replaceTop( + node.copy( node.getTraitSet(), ImmutableList.of( builder.peek( 1 ), builder.peek( 0 ) ) ) + , 2 ) ); break; default: + if ( node instanceof LogicalRelUnion l ) { + builders.forEach( + builder -> { + List inputs = new ArrayList<>(); + for ( int i = 0; i < node.getInputs().size(); i++ ) { + inputs.add( builder.peek( i ) ); + } + builder.replaceTop( + node.copy( node.getTraitSet(), inputs ) + , l.getInputs().size() ); + } + ); + break; + } throw new GenericRuntimeException( "Unexpected number of input elements: " + node.getInputs().size() ); } return builders;