From 5f2b6181ece03f8f7a60ce74c3818b04ea4ae60e Mon Sep 17 00:00:00 2001 From: datomo Date: Thu, 4 Apr 2024 13:00:20 +0200 Subject: [PATCH] fixes for tuplecount race condition and neo4j errors during graph bench --- .../org/polypheny/db/algebra/metadata/AlgMetadataQuery.java | 1 - .../java/org/polypheny/db/adapter/neo4j/util/NeoUtil.java | 1 - .../java/org/polypheny/db/adapter/neo4j/util/Translator.java | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/polypheny/db/algebra/metadata/AlgMetadataQuery.java b/core/src/main/java/org/polypheny/db/algebra/metadata/AlgMetadataQuery.java index c93c78319c..4374f6786d 100644 --- a/core/src/main/java/org/polypheny/db/algebra/metadata/AlgMetadataQuery.java +++ b/core/src/main/java/org/polypheny/db/algebra/metadata/AlgMetadataQuery.java @@ -236,7 +236,6 @@ public Double getTupleCount( AlgNode alg ) { rowCountHandler = revise( e.algClass, TupleCount.DEF ); } catch ( CyclicMetadataException e ) { log.warn( "Cyclic metadata detected while computing row count for {}", alg ); - return null; // Ignore this algebra expression; there will be non-cyclic ones in this set. } } } diff --git a/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/NeoUtil.java b/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/NeoUtil.java index 2ba78bcca1..2ddf2adc85 100644 --- a/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/NeoUtil.java +++ b/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/NeoUtil.java @@ -218,7 +218,6 @@ static PolyValue asPolyValue( @NonNull Value value ) { return new PolyList<>( (value).asList( NeoUtil::getComparableOrString ) ); } throw new NotImplementedException( "Type not supported" ); - //return PolyString.of( value.asObject().toString() ); } static Function1 getTypesFunction( NestedPolyType types ) { diff --git a/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/Translator.java b/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/Translator.java index d465364f65..e0bec794e6 100644 --- a/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/Translator.java +++ b/plugins/neo4j-adapter/src/main/java/org/polypheny/db/adapter/neo4j/util/Translator.java @@ -191,11 +191,11 @@ private String handleBinaries( RexCall call ) { RexNode rightRex = call.operands.get( 1 ); String left = leftRex.accept( this ); if ( leftRex.isA( Kind.LITERAL ) && PolyType.STRING_TYPES.contains( leftRex.getType().getPolyType() ) ) { - left = String.format( "'%s'", left ); + //left = String.format( "'%s'", left ); } String right = rightRex.accept( this ); if ( rightRex.isA( Kind.LITERAL ) && PolyType.STRING_TYPES.contains( rightRex.getType().getPolyType() ) ) { - right = String.format( "'%s'", right ); + //right = String.format( "'%s'", right ); } return getFinalFunction( call, List.of( left, right ) ); @@ -204,7 +204,6 @@ private String handleBinaries( RexCall call ) { private String handleExtractFromPath( RexCall call ) { - //AlgDataTypeField field = beforeFields.get( ((RexInputRef) call.operands.get( 0 )).getIndex() ); assert call.operands.get( 1 ).isA( Kind.LITERAL ); return ((RexLiteral) call.operands.get( 1 )).value.asString().value;