Skip to content

Commit

Permalink
temporary adjustments for statement calls from avatica
Browse files Browse the repository at this point in the history
  • Loading branch information
datomo committed Apr 2, 2024
1 parent 94d72cb commit 4408f36
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
12 changes: 10 additions & 2 deletions core/src/main/java/org/polypheny/db/languages/LanguageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,17 @@ public static void removeQueryLanguage( String name ) {


public List<ImplementationContext> anyPrepareQuery( QueryContext context, Transaction transaction ) {
Statement statement = transaction.createStatement();
return anyPrepareQuery( context, transaction.createStatement() );
}


// This method is still called from the Avatica interface and leaves the statement management to the caller.
// This should be refactored to use the new method only transmitting the transaction as soon as the
// new prism interface is enabled
public List<ImplementationContext> anyPrepareQuery( QueryContext context, Statement statement ) {
Transaction transaction = statement.getTransaction();
if ( transaction.isAnalyze() ) {
context.getInformationTarget().accept( transaction.getQueryAnalyzer() );
context.getInformationTarget().accept( statement.getTransaction().getQueryAnalyzer() );
}

if ( transaction.isAnalyze() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ private void prepare( StatementHandle h, String sql ) throws NoSuchStatementExce
.transactionManager( transactionManager )
.build();

PolySignature signature = PolySignature.from( LanguageManager.getINSTANCE().anyPrepareQuery( context, statementHandle.getStatement().getTransaction() ).get( 0 ) );
PolySignature signature = PolySignature.from( LanguageManager.getINSTANCE().anyPrepareQuery( context, statementHandle.getStatement() ).get( 0 ) );

h.signature = signature;
statementHandle.setSignature( signature );
Expand Down
2 changes: 1 addition & 1 deletion webui/src/main/java/org/polypheny/db/webui/HttpServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private void attachRoutes( Javalin webuiServer, Crud crud ) {

webuiServer.get( "/getAvailableSources", crud::getAvailableSources );

webuiServer.post( "/createStore", crud::addAdapter );
webuiServer.post( "/createAdapter", crud::addAdapter );

webuiServer.post( "/pathAccess", crud::startAccessRequest );

Expand Down

0 comments on commit 4408f36

Please sign in to comment.