paul-rogers commented on code in PR #2867: URL: https://github.com/apache/drill/pull/2867#discussion_r1444117648
########## exec/java-exec/src/test/java/org/apache/drill/exec/physical/resultSet/impl/TestResultSetLoaderUnprojected.java: ########## @@ -0,0 +1,455 @@ +/* + * 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.physical.resultSet.impl; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +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.resultSet.ResultSetLoader; +import org.apache.drill.exec.physical.resultSet.RowSetLoader; +import org.apache.drill.exec.physical.resultSet.impl.ResultSetLoaderImpl.ResultSetOptions; +import org.apache.drill.exec.physical.resultSet.project.Projections; +import org.apache.drill.exec.physical.rowSet.RowSet; +import org.apache.drill.exec.physical.rowSet.RowSet.SingleRowSet; +import org.apache.drill.exec.physical.rowSet.RowSetTestUtils; +import org.apache.drill.exec.record.metadata.SchemaBuilder; +import org.apache.drill.exec.record.metadata.TupleMetadata; +import org.apache.drill.exec.vector.accessor.ArrayWriter; +import org.apache.drill.exec.vector.accessor.ScalarWriter; +import org.apache.drill.exec.vector.accessor.TupleWriter; +import org.apache.drill.test.SubOperatorTest; +import org.apache.drill.test.rowSet.RowSetUtilities; +import org.junit.Test; + +/** + * Verify the correct functioning of the "dummy" columns created + * for unprojected columns. + */ +public class TestResultSetLoaderUnprojected extends SubOperatorTest { Review Comment: The UNION type has been discussed for as long as I've been involved in the project: since 2016. The idea is simple: Drill should be able to read any kind of JSON, and UNION (plus LIST, etc.) have been essential for this. The problem, as we've also discussed for a long time, is that UNION barely works, and JDBC and similar clients can't make sense of it. That is, UNION turned out to be the wrong solution to the problem. Still, there is always the hope that UNION can be made to work -- somehow. Also, there is always the worry that "maybe somebody, somewhere, is using it! Removing UNION would require quite a bit of work: remove the vectors, EVF support, old-school vector writers, old-school JSON parser, operators that somewhat handle UNION, etc. What would be the advantage of doing so? Drill wouldn't be faster, though the code might be a bit smaller. There is no harm in leaving UNION in Drill. It doesn't cause any problems if it is not used. It only causes problems when it *is* used. Leaving it in Drill also avoids the long discussions that would otherwise occur if someone proposed to remove it. Here's another idea. If folks really want the promise of (unstructured) JSON, then maybe open a Jira ticket asking to implement a Druid-like alternative: use Drill's OBJECT vector to store JSON as a set of Java objects (scalars, maps, and lists). Provide the needed serialization. Adopt the standard SQL JSON functions, since the SQL standards committee (and other vendors) have done the hard work to figure out a way to integrate JSON into SQL. Once that new, modern, JSON solution were available, we could easily remove the old UNION-based support with no worries. -- 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. To unsubscribe, e-mail: dev-unsubscr...@drill.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org