Skip to content

Commit

Permalink
minor adjustment for logging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
datomo committed Dec 10, 2024
1 parent 855de30 commit 4d9f16f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,12 @@ private List<ImplementationContext> implementTranslatedQuery( Statement statemen
if ( transaction.isAnalyze() ) {
transaction.getQueryAnalyzer().attachStacktrace( e );
}
cancelTransaction( transaction, "Caught exception: " + e.getMessage() );
if ( !(e instanceof DeadlockException) ) {
// we only log unexpected cases with stacktrace
log.warn( "Caught exception: ", e );
}

cancelTransaction( transaction, String.format( "Caught %s exception: %s", e.getClass().getSimpleName(), e.getMessage() ) );
return List.of( (ImplementationContext.ofError( e, translated, statement )) );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.polypheny.db.algebra.logical.relational.LogicalRelProject;
import org.polypheny.db.algebra.logical.relational.LogicalRelScan;
import org.polypheny.db.algebra.logical.relational.LogicalRelSort;
import org.polypheny.db.algebra.metadata.CyclicMetadataException;
import org.polypheny.db.algebra.polyalg.PolyAlgRegistry;
import org.polypheny.db.algebra.polyalg.parser.PolyAlgParser;
import org.polypheny.db.algebra.polyalg.parser.PolyAlgToAlgConverter;
Expand Down Expand Up @@ -71,7 +70,6 @@
import org.polypheny.db.transaction.TransactionManager;
import org.polypheny.db.transaction.TransactionManagerImpl;
import org.polypheny.db.type.entity.PolyValue;
import org.polypheny.db.webui.UiTestingConfigPage;


@SuppressWarnings("SqlNoDataSourceInspection")
Expand Down Expand Up @@ -270,7 +268,8 @@ private static String executePolyAlg( String polyAlg, PlanType planType, QueryLa
private static String getResultAsString( List<ExecutedContext> executedContexts, DataModel dataModel ) {
assertEquals( 1, executedContexts.size() );
ExecutedContext context = executedContexts.get( 0 );
assertTrue( context.getException().isEmpty() || context.getException().get().getClass() == CyclicMetadataException.class, "Query resulted in an exception" );

assertTrue( context.getException().isEmpty(), "Query resulted in an exception" );
@NotNull ResultIterator iter = context.getIterator();
String tupleType = context.getImplementation().tupleType.toString();
List<List<PolyValue>> rows = iter.getAllRowsAndClose();
Expand Down

0 comments on commit 4d9f16f

Please sign in to comment.