Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.concurrent.ExecutionException;

import static com.facebook.presto.iceberg.CatalogType.NESSIE;
import static com.facebook.presto.iceberg.IcebergSessionProperties.getNessieReferenceHash;
import static com.facebook.presto.iceberg.IcebergSessionProperties.getNessieReferenceName;
import static com.facebook.presto.iceberg.nessie.AuthenticationType.BASIC;
import static com.facebook.presto.iceberg.nessie.AuthenticationType.BEARER;
Expand Down Expand Up @@ -121,8 +120,6 @@ private String getCatalogCacheKey(ConnectorSession session)

if (catalogType == NESSIE) {
sb.append(getNessieReferenceName(session));
sb.append("@");
sb.append(getNessieReferenceHash(session));
}

return sb.toString();
Expand Down Expand Up @@ -157,10 +154,6 @@ public Map<String, String> getCatalogProperties(ConnectorSession session)
if (catalogType == NESSIE) {
properties.put("ref", getNessieReferenceName(session));
properties.put("uri", nessieConfig.getServerUri().orElseThrow(() -> new IllegalStateException("iceberg.nessie.uri must be set for Nessie")));
String hash = getNessieReferenceHash(session);
if (hash != null) {
properties.put("ref.hash", hash);
}
nessieConfig.getReadTimeoutMillis().ifPresent(val -> properties.put("transport.read-timeout", val.toString()));
nessieConfig.getConnectTimeoutMillis().ifPresent(val -> properties.put("transport.connect-timeout", val.toString()));
nessieConfig.getClientBuilderImpl().ifPresent(val -> properties.put("client-builder-impl", val));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public final class IcebergSessionProperties
private static final String MINIMUM_ASSIGNED_SPLIT_WEIGHT = "minimum_assigned_split_weight";
private static final String NODE_SELECTION_STRATEGY = "node_selection_strategy";
private static final String NESSIE_REFERENCE_NAME = "nessie_reference_name";
private static final String NESSIE_REFERENCE_HASH = "nessie_reference_hash";
public static final String READ_MASKED_VALUE_ENABLED = "read_null_masked_parquet_encrypted_value_enabled";
public static final String PARQUET_DEREFERENCE_PUSHDOWN_ENABLED = "parquet_dereference_pushdown_enabled";
public static final String MERGE_ON_READ_MODE_ENABLED = "merge_on_read_enabled";
Expand Down Expand Up @@ -275,11 +274,6 @@ public IcebergSessionProperties(
"Nessie reference name to use",
nessieConfig.getDefaultReferenceName(),
false),
stringProperty(
NESSIE_REFERENCE_HASH,
"Nessie reference hash to use",
null,
false),
booleanProperty(
READ_MASKED_VALUE_ENABLED,
"Return null when access is denied for an encrypted parquet column",
Expand Down Expand Up @@ -458,11 +452,6 @@ public static String getNessieReferenceName(ConnectorSession session)
return session.getProperty(NESSIE_REFERENCE_NAME, String.class);
}

public static String getNessieReferenceHash(ConnectorSession session)
{
return session.getProperty(NESSIE_REFERENCE_HASH, String.class);
}

public static double getMinimumAssignedSplitWeight(ConnectorSession session)
{
return session.getProperty(MINIMUM_ASSIGNED_SPLIT_WEIGHT, Double.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,13 @@ public void testTableDataVisibility()
// retrieve the second to the last commit hash and query the table with that hash
List<LogResponse.LogEntry> logEntries = nessieApiV1.getCommitLog().refName(two.getName()).get().getLogEntries();
assertThat(logEntries).isNotEmpty();
String hash = logEntries.get(1).getCommitMeta().getHash();
Session sessionTwoAtHash = sessionOnRef(two.getName(), hash);

// at this hash there were only 3 rows
assertThat(computeScalar(sessionTwoAtHash, "SELECT count(*) FROM namespace_one.tbl")).isEqualTo(3L);
rows = computeActual(sessionTwoAtHash, "SELECT * FROM namespace_one.tbl");
assertThat(rows.getMaterializedRows()).hasSize(3);
assertEqualsIgnoreOrder(rows.getMaterializedRows(), resultBuilder(sessionTwoAtHash, rows.getTypes()).row(1).row(2).row(5).build().getMaterializedRows());
}

private Session sessionOnRef(String reference)
{
return Session.builder(getSession()).setCatalogSessionProperty("iceberg", "nessie_reference_name", reference).build();
}

private Session sessionOnRef(String reference, String hash)
{
return Session.builder(getSession()).setCatalogSessionProperty("iceberg", "nessie_reference_name", reference).setCatalogSessionProperty("iceberg", "nessie_reference_hash", hash).build();
}

private Reference createBranch(String branchName)
throws NessieConflictException, NessieNotFoundException
{
Expand Down