Skip to content

Commit cec650b

Browse files
committed
add delta sharing REST Client implementation
1 parent cce16dc commit cec650b

File tree

3 files changed

+589
-9
lines changed

3 files changed

+589
-9
lines changed

plugin/trino-delta-lake/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
<artifactId>configuration</artifactId>
6363
</dependency>
6464

65+
<dependency>
66+
<groupId>io.airlift</groupId>
67+
<artifactId>http-client</artifactId>
68+
</dependency>
69+
6570
<dependency>
6671
<groupId>io.airlift</groupId>
6772
<artifactId>json</artifactId>

plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/metastore/deltasharing/DeltaSharingProfile.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
114
package io.trino.plugin.deltalake.metastore.deltasharing;
215

3-
import static java.util.Objects.requireNonNull;
16+
import com.fasterxml.jackson.annotation.JsonCreator;
17+
import com.fasterxml.jackson.annotation.JsonProperty;
18+
import com.fasterxml.jackson.databind.ObjectMapper;
419

520
import java.io.IOException;
621
import java.nio.file.Path;
722
import java.util.Optional;
823

9-
import com.fasterxml.jackson.annotation.JsonCreator;
10-
import com.fasterxml.jackson.annotation.JsonProperty;
11-
import com.fasterxml.jackson.databind.ObjectMapper;
24+
import static java.util.Objects.requireNonNull;
1225

1326
/**
1427
* Represents a Delta Sharing profile file configuration
@@ -21,11 +34,7 @@ public class DeltaSharingProfile
2134
private final Optional<String> expirationTime;
2235

2336
@JsonCreator
24-
public DeltaSharingProfile(
25-
@JsonProperty("shareCredentialsVersion") int shareCredentialsVersion,
26-
@JsonProperty("endpoint") String endpoint,
27-
@JsonProperty("bearerToken") String bearerToken,
28-
@JsonProperty("expirationTime") String expirationTime)
37+
public DeltaSharingProfile(@JsonProperty("shareCredentialsVersion") int shareCredentialsVersion, @JsonProperty("endpoint") String endpoint, @JsonProperty("bearerToken") String bearerToken, @JsonProperty("expirationTime") String expirationTime)
2938
{
3039
this.shareCredentialsVersion = shareCredentialsVersion;
3140
this.endpoint = requireNonNull(endpoint, "endpoint is null");

0 commit comments

Comments
 (0)