arina-ielchiieva commented on a change in pull request #1914: DRILL-7458: Base 
framework for storage plugins
URL: https://github.com/apache/drill/pull/1914#discussion_r369434855
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/base/DummyGroupScan.java
 ##########
 @@ -0,0 +1,214 @@
+/*
+ * 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 org.apache.drill.exec.store.base;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.common.types.TypeProtos.MinorType;
+import org.apache.drill.exec.physical.base.ScanStats;
+import org.apache.drill.exec.physical.base.ScanStats.GroupScanProperty;
+import org.apache.drill.exec.physical.base.SubScan;
+import org.apache.drill.exec.store.StoragePluginRegistry;
+import org.apache.drill.exec.store.base.filter.FilterSpec;
+import org.apache.drill.exec.store.base.filter.RelOp;
+import org.apache.drill.shaded.guava.com.google.common.base.Preconditions;
+import org.apache.drill.shaded.guava.com.google.common.collect.ImmutableList;
+
+import com.fasterxml.jackson.annotation.JacksonInject;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+@JsonTypeName("dummy-scan")
+@JsonPropertyOrder({"userName", "scanSpec", "columns",
+                    "filters", "cost", "config"})
+@JsonInclude(value=Include.NON_EMPTY, content=Include.NON_NULL)
+public class DummyGroupScan extends BaseGroupScan {
+
+  private final DummyScanSpec scanSpec;
+  private final FilterSpec filters;
+
+  public DummyGroupScan(DummyStoragePlugin storagePlugin, String userName,
+      DummyScanSpec scanSpec) {
+    super(storagePlugin, userName, null);
+    this.scanSpec = scanSpec;
+    filters = null;
+  }
+
+  public DummyGroupScan(DummyGroupScan from, List<SchemaPath> columns) {
+    super(from.storagePlugin, from.getUserName(), columns);
+    this.scanSpec = from.scanSpec;
+    this.filters = from.filters;
+  }
+
+  @JsonCreator
+  public DummyGroupScan(
+      @JsonProperty("config") DummyStoragePluginConfig config,
+      @JsonProperty("userName") String userName,
+      @JsonProperty("scanSpec") DummyScanSpec scanSpec,
+      @JsonProperty("columns") List<SchemaPath> columns,
+      @JsonProperty("filters") FilterSpec filters,
+      @JacksonInject StoragePluginRegistry engineRegistry) {
+    super(config, userName, columns, engineRegistry);
+    this.scanSpec = scanSpec;
+    this.filters = filters;
+  }
+
+  public DummyGroupScan(DummyGroupScan from, FilterSpec filters) {
+    super(from);
+    this.scanSpec = from.scanSpec;
+    this.filters = filters;
+  }
+
+  @JsonProperty("scanSpec")
+  public DummyScanSpec scanSpec() { return scanSpec; }
+
+  @JsonProperty("filters")
+  public FilterSpec andFilters() { return filters; }
+
+  public boolean hasFilters() {
+    return filters != null && ! filters.isEmpty();
+  }
+
+  private static final List<String> FILTER_COLS = ImmutableList.of("a", "b", 
"id");
 
 Review comment:
   Use `Arrays.asList`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to