[
https://issues.apache.org/jira/browse/DRILL-4081?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15006135#comment-15006135
]
ASF GitHub Bot commented on DRILL-4081:
---------------------------------------
Github user jacques-n commented on a diff in the pull request:
https://github.com/apache/drill/pull/257#discussion_r44882984
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/record/BaseVectorWrapper.java
---
@@ -0,0 +1,92 @@
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.record;
+
+import org.apache.drill.common.expression.PathSegment;
+import org.apache.drill.common.expression.SchemaPath;
+import org.apache.drill.common.types.TypeProtos.DataMode;
+import org.apache.drill.common.types.TypeProtos.MajorType;
+import org.apache.drill.common.types.TypeProtos.MinorType;
+import org.apache.drill.exec.vector.ValueVector;
+import org.apache.drill.exec.vector.complex.AbstractContainerVector;
+import org.apache.drill.exec.vector.complex.ListVector;
+import org.apache.drill.exec.vector.complex.UnionVector;
+
+import java.util.List;
+
+public abstract class BaseVectorWrapper implements VectorWrapper {
+
+ protected TypedFieldId getFieldIdIfMatches(ValueVector vector, int id,
SchemaPath expectedPath) {
+ if
(!expectedPath.getRootSegment().segmentEquals(vector.getField().getPath().getRootSegment()))
{
+ return null;
+ }
+ PathSegment seg = expectedPath.getRootSegment();
+
+ if (vector instanceof UnionVector) {
--- End diff --
Need docs on all of this.
> Handle schema changes in ExternalSort
> -------------------------------------
>
> Key: DRILL-4081
> URL: https://issues.apache.org/jira/browse/DRILL-4081
> Project: Apache Drill
> Issue Type: Improvement
> Reporter: Steven Phillips
> Assignee: Steven Phillips
>
> This improvement will make use of the Union vector to handle schema changes.
> When a new schema appears, the schema will be "merged" with the previous
> schema. The result will be a new schema that uses Union type to store the
> columns where this is a type conflict. All of the batches (including the
> batches that have already arrived) will be coerced into this new schema.
> A new comparison function will be included to handle the comparison of Union
> type. Comparison of union type will work as follows:
> 1. All numeric types can be mutually compared, and will be compared using
> Drill implicit cast rules.
> 2. All other types will not be compared against other types, but only among
> values of the same type.
> 3. There will be an overall precedence of types with regards to ordering.
> This precedence is not yet defined, but will be as part of the work on this
> issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)