[ 
https://issues.apache.org/jira/browse/DRILL-8190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17608217#comment-17608217
 ] 

ASF GitHub Bot commented on DRILL-8190:
---------------------------------------

jnturton commented on code in PR #2652:
URL: https://github.com/apache/drill/pull/2652#discussion_r977498910


##########
exec/java-exec/src/main/java/org/apache/drill/exec/store/plan/rule/PluginIntermediatePrelConverterRule.java:
##########
@@ -53,7 +54,7 @@ public void onMatch(RelOptRuleCall call) {
     VertexDrel in = call.rel(0);
     RelNode intermediatePrel = new PluginIntermediatePrel(
         in.getCluster(),
-        in.getTraitSet().replace(outTrait),
+        
in.getTraitSet().replace(outTrait).plus(DrillDistributionTrait.SINGLETON),

Review Comment:
   What is the effect of adding this SINGLETON distribution trait on computed 
plans?



##########
exec/java-exec/src/main/java/org/apache/drill/exec/store/plan/rel/PluginAggregateRel.java:
##########
@@ -51,7 +51,7 @@ public Aggregate copy(RelTraitSet traitSet, RelNode input, 
ImmutableBitSet group
 
   @Override
   public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery 
mq) {
-    return super.computeSelfCost(planner, mq).multiplyBy(0.1);
+    return super.computeLogicalAggCost(planner, mq).multiplyBy(0.1);

Review Comment:
   Are these Plugin*Rel RelNodes used when operations are pushed down to 
storage plugins?



##########
exec/java-exec/src/main/java/org/apache/drill/exec/store/enumerable/DynamicTypeResolverBuilder.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.enumerable;
+
+import com.fasterxml.jackson.databind.DeserializationConfig;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.jsontype.NamedType;
+import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
+import com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder;
+import org.reflections.Reflections;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class DynamicTypeResolverBuilder extends StdTypeResolverBuilder {

Review Comment:
   Did this new serde builder become necessary because of the changes made in 
this PR for pushing down projections to Mongo?



##########
exec/java-exec/src/main/java/org/apache/drill/exec/store/enumerable/plan/VertexDrel.java:
##########
@@ -51,4 +58,15 @@ protected Object clone() {
   public LogicalOperator implement(DrillImplementor implementor) {
     throw new UnsupportedOperationException();
   }
+
+  @Override
+  public @Nullable RelOptCost computeSelfCost(RelOptPlanner planner, 
RelMetadataQuery mq) {
+    double rowCount = estimateRowCount(mq);
+    double columnCount = Utilities.isStarQuery(getRowType()) ? 
STAR_COLUMN_COST : getRowType().getFieldCount();
+    double valueCount = rowCount * columnCount;

Review Comment:
   Was it only queries with a pushed down join that were affected by there 
being no cost saving for adding a plugin projection?





> Mongo query: "Schema change not currently supported for schemas with complex 
> types"
> -----------------------------------------------------------------------------------
>
>                 Key: DRILL-8190
>                 URL: https://issues.apache.org/jira/browse/DRILL-8190
>             Project: Apache Drill
>          Issue Type: Bug
>          Components:  Server
>    Affects Versions: 1.20.0
>         Environment: RHEL 7: Linux  3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed 
> Feb 16 12:17:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Daniel Clark
>            Assignee: Vova Vysotskyi
>            Priority: Major
>             Fix For: 1.20.3
>
>         Attachments: customGrounds.gz, log_4.txt, profile_4.json
>
>
> I'm attempting to run this mongo query that ran successfully in Drill 1.19 
> with the 1.21.0-SNAPSHOT build. 
>  
> SELECT `Elements_Efforts`.`EffortTypeName` AS `EffortTypeName`,
>   `Elements`.`ElementSubTypeName` AS `ElementSubTypeName`,
>   `Elements`.`ElementTypeName` AS `ElementTypeName`,
>   `Elements`.`PlanID` AS `PlanID`
> FROM `mongo.grounds`.`Elements` `Elements`
>   INNER JOIN `mongo.grounds`.`Elements_Efforts` `Elements_Efforts` ON 
> (`Elements`.`_id` = `Elements_Efforts`.`_id`)
> WHERE (`Elements`.`PlanID` = '1623263140')
> GROUP BY `Elements_Efforts`.`EffortTypeName`,
>   `Elements`.`ElementSubTypeName`,
>   `Elements`.`ElementTypeName`,
>   `Elements`.`PlanID`
>  
> I'm getting this error message: UserRemoteException : SYSTEM ERROR: 
> RuntimeException: Schema change not currently supported for schemas with 
> complex types. I've attached the log, profile, and a mongodb dump containing 
> the relevant datasets.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to