Skip to content

Commit

Permalink
Fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Jan 15, 2024
1 parent 1b32e2d commit f2a5554
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,21 @@ class TrinoStatement(
// update catalog and schema
if (trino.getSetCatalog.isPresent || trino.getSetSchema.isPresent) {
builder = builder
.withCatalog(trino.getSetCatalog.orElse(session.getCatalog))
.withSchema(trino.getSetSchema.orElse(session.getSchema))
.catalog(trino.getSetCatalog.orElse(session.getCatalog))
.schema(trino.getSetSchema.orElse(session.getSchema))
}

// update path if present
if (trino.getSetPath.isPresent) {
builder = builder.withPath(trino.getSetPath.get)
builder = builder.path(trino.getSetPath.get)
}

// update session properties if present
if (!trino.getSetSessionProperties.isEmpty || !trino.getResetSessionProperties.isEmpty) {
val properties = session.getProperties.asScala.clone()
properties ++= trino.getSetSessionProperties.asScala
properties --= trino.getResetSessionProperties.asScala
builder = builder.withProperties(properties.asJava)
builder = builder.properties(properties.asJava)
}

trinoContext.clientSession.set(builder.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class TrinoSessionImpl(
Optional.ofNullable(keystoreType.orNull),
Optional.ofNullable(truststorePath.orNull),
Optional.ofNullable(truststorePassword.orNull),
Optional.ofNullable(truststoreType.orNull))
Optional.ofNullable(truststoreType.orNull), true)

sessionConf.get(KyuubiConf.ENGINE_TRINO_CONNECTION_PASSWORD).foreach { password =>
require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ class TrinoClientApiSuite extends KyuubiFunSuite with TrinoRestFrontendTestHelpe
// update catalog and schema
if (trino.getSetCatalog.isPresent || trino.getSetSchema.isPresent) {
builder = builder
.withCatalog(trino.getSetCatalog.orElse(session.getCatalog))
.withSchema(trino.getSetSchema.orElse(session.getSchema))
.catalog(trino.getSetCatalog.orElse(session.getCatalog))
.schema(trino.getSetSchema.orElse(session.getSchema))
}

// update path if present
if (trino.getSetPath.isPresent) {
builder = builder.withPath(trino.getSetPath.get)
builder = builder.path(trino.getSetPath.get)
}

// update session properties if present
if (!trino.getSetSessionProperties.isEmpty || !trino.getResetSessionProperties.isEmpty) {
val properties = session.getProperties.asScala.clone()
properties ++= trino.getSetSessionProperties.asScala
properties --= trino.getResetSessionProperties.asScala
builder = builder.withProperties(properties.asJava)
builder = builder.properties(properties.asJava)
}
clientSession.set(builder.build())
}
Expand Down

0 comments on commit f2a5554

Please sign in to comment.