This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 545a2bb Remove filter and iterable methods from Snapshot. (#17)
545a2bb is described below
commit 545a2bb3aa8c7e4e5aa83bbbc7d00d5df86d6f46
Author: Ryan Blue <[email protected]>
AuthorDate: Wed Nov 28 15:31:26 2018 -0800
Remove filter and iterable methods from Snapshot. (#17)
These are not used.
---
.../main/java/com/netflix/iceberg/Filterable.java | 4 --
.../java/com/netflix/iceberg/FilteredSnapshot.java | 62 ----------------------
.../main/java/com/netflix/iceberg/Snapshot.java | 2 +-
.../java/com/netflix/iceberg/SnapshotIterable.java | 33 ------------
.../java/com/netflix/iceberg/BaseSnapshot.java | 42 +--------------
5 files changed, 2 insertions(+), 141 deletions(-)
diff --git a/api/src/main/java/com/netflix/iceberg/Filterable.java
b/api/src/main/java/com/netflix/iceberg/Filterable.java
index e591bf5..ac7df63 100644
--- a/api/src/main/java/com/netflix/iceberg/Filterable.java
+++ b/api/src/main/java/com/netflix/iceberg/Filterable.java
@@ -19,11 +19,9 @@
package com.netflix.iceberg;
-import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.netflix.iceberg.expressions.Expression;
import java.util.Collection;
-import java.util.List;
/**
* Methods to filter files in a snapshot or manifest when reading.
@@ -31,8 +29,6 @@ import java.util.List;
* @param <T> Java class returned by filter methods, also filterable
*/
public interface Filterable<T extends Filterable<T>> extends
Iterable<DataFile> {
- List<String> ALL_COLUMNS = ImmutableList.of("*");
-
/**
* Selects the columns of a file manifest to read.
* <p>
diff --git a/api/src/main/java/com/netflix/iceberg/FilteredSnapshot.java
b/api/src/main/java/com/netflix/iceberg/FilteredSnapshot.java
deleted file mode 100644
index 6acabd9..0000000
--- a/api/src/main/java/com/netflix/iceberg/FilteredSnapshot.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package com.netflix.iceberg;
-
-import com.netflix.iceberg.expressions.Expression;
-import com.netflix.iceberg.expressions.Expressions;
-import java.util.Collection;
-import java.util.Iterator;
-
-public class FilteredSnapshot implements Filterable<FilteredSnapshot> {
- private final SnapshotIterable snapshot;
- private final Expression partFilter;
- private final Expression rowFilter;
- private final Collection<String> columns;
-
- FilteredSnapshot(SnapshotIterable snapshot,
- Expression partFilter,
- Expression rowFilter,
- Collection<String> columns) {
- this.snapshot = snapshot;
- this.partFilter = partFilter;
- this.rowFilter = rowFilter;
- this.columns = columns;
- }
-
- @Override
- public FilteredSnapshot select(Collection<String> columns) {
- return new FilteredSnapshot(snapshot, partFilter, rowFilter, columns);
- }
-
- @Override
- public FilteredSnapshot filterPartitions(Expression expr) {
- return new FilteredSnapshot(snapshot, Expressions.and(partFilter, expr),
rowFilter, columns);
- }
-
- @Override
- public FilteredSnapshot filterRows(Expression expr) {
- return new FilteredSnapshot(snapshot, partFilter,
Expressions.and(rowFilter, expr), columns);
- }
-
- @Override
- public Iterator<DataFile> iterator() {
- return snapshot.iterator(partFilter, rowFilter, columns);
- }
-}
diff --git a/api/src/main/java/com/netflix/iceberg/Snapshot.java
b/api/src/main/java/com/netflix/iceberg/Snapshot.java
index 9519451..7fc878b 100644
--- a/api/src/main/java/com/netflix/iceberg/Snapshot.java
+++ b/api/src/main/java/com/netflix/iceberg/Snapshot.java
@@ -29,7 +29,7 @@ import java.util.List;
* <p>
* Snapshots are created by table operations, like {@link AppendFiles} and
{@link RewriteFiles}.
*/
-public interface Snapshot extends Filterable<FilteredSnapshot> {
+public interface Snapshot {
/**
* Return this snapshot's ID.
*
diff --git a/api/src/main/java/com/netflix/iceberg/SnapshotIterable.java
b/api/src/main/java/com/netflix/iceberg/SnapshotIterable.java
deleted file mode 100644
index 035f0a7..0000000
--- a/api/src/main/java/com/netflix/iceberg/SnapshotIterable.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package com.netflix.iceberg;
-
-import com.netflix.iceberg.expressions.Expression;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Interface used by BaseSnapshot to back FilteredSnapshot.
- */
-interface SnapshotIterable {
- Iterator<DataFile> iterator(Expression partFilter,
- Expression rowFilter,
- Collection<String> columns);
-}
diff --git a/core/src/main/java/com/netflix/iceberg/BaseSnapshot.java
b/core/src/main/java/com/netflix/iceberg/BaseSnapshot.java
index 828def7..5409b9a 100644
--- a/core/src/main/java/com/netflix/iceberg/BaseSnapshot.java
+++ b/core/src/main/java/com/netflix/iceberg/BaseSnapshot.java
@@ -19,21 +19,15 @@
package com.netflix.iceberg;
-import com.google.common.base.Function;
import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.netflix.iceberg.exceptions.RuntimeIOException;
-import com.netflix.iceberg.expressions.Expression;
-import com.netflix.iceberg.expressions.Expressions;
import com.netflix.iceberg.io.CloseableGroup;
import java.io.IOException;
import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
-class BaseSnapshot extends CloseableGroup implements Snapshot,
SnapshotIterable {
+class BaseSnapshot extends CloseableGroup implements Snapshot {
private final TableOperations ops;
private final long snapshotId;
private final Long parentId;
@@ -86,40 +80,6 @@ class BaseSnapshot extends CloseableGroup implements
Snapshot, SnapshotIterable
}
@Override
- public FilteredSnapshot select(Collection<String> columns) {
- return new FilteredSnapshot(this, Expressions.alwaysTrue(),
Expressions.alwaysTrue(), columns);
- }
-
- @Override
- public FilteredSnapshot filterPartitions(Expression expr) {
- return new FilteredSnapshot(this, expr, Expressions.alwaysTrue(),
ALL_COLUMNS);
- }
-
- @Override
- public FilteredSnapshot filterRows(Expression expr) {
- return new FilteredSnapshot(this, Expressions.alwaysTrue(), expr,
ALL_COLUMNS);
- }
-
- @Override
- public Iterator<DataFile> iterator(Expression partFilter,
- Expression rowFilter,
- Collection<String> columns) {
- return Iterables.concat(Iterables.transform(manifestFiles,
- (Function<String, Iterable<DataFile>>) path -> {
- ManifestReader reader = ManifestReader.read(ops.newInputFile(path));
- addCloseable(reader);
- return reader.filterPartitions(partFilter)
- .filterRows(rowFilter)
- .select(columns);
- })).iterator();
- }
-
- @Override
- public Iterator<DataFile> iterator() {
- return iterator(Expressions.alwaysTrue(), Expressions.alwaysTrue(),
ALL_COLUMNS);
- }
-
- @Override
public List<DataFile> addedFiles() {
if (adds == null) {
cacheChanges();