MD-548: Remove reference to mapr-release pom. * Bumped the Drill+plugin version to 1.6.0-SNAPSHOT. * Updated MapR client artifacts to 5.1.0. * Added missing Apache license headers to few files. * Added a base test class BaseJsonTest for all OJAI Unit tests. * Invoke GuavaPatcher from BaseJsonTest.
Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/6988254f Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/6988254f Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/6988254f Branch: refs/heads/master Commit: 6988254f08dd4e2519eb17b5863b827a7803264b Parents: c62361e Author: Aditya <adi...@mapr.com> Authored: Tue Feb 23 23:15:36 2016 -0800 Committer: Aditya Kishore <a...@apache.org> Committed: Fri Sep 9 10:08:36 2016 -0700 ---------------------------------------------------------------------- contrib/format-maprdb/pom.xml | 145 ++++++++++--------- .../maprdb/json/CompareFunctionsProcessor.java | 21 ++- .../store/maprdb/json/JsonConditionBuilder.java | 25 +++- .../exec/store/maprdb/json/JsonScanSpec.java | 19 ++- .../exec/store/maprdb/json/JsonSubScanSpec.java | 17 +++ .../store/maprdb/json/JsonTableGroupScan.java | 7 - .../drill/maprdb/tests/json/BaseJsonTest.java | 47 ++++++ .../drill/maprdb/tests/json/TestSimpleJson.java | 17 +-- 8 files changed, 194 insertions(+), 104 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/pom.xml ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/pom.xml b/contrib/format-maprdb/pom.xml index db0572f..4dfc4a7 100644 --- a/contrib/format-maprdb/pom.xml +++ b/contrib/format-maprdb/pom.xml @@ -21,24 +21,67 @@ <modelVersion>4.0.0</modelVersion> <parent> - <groupId>com.mapr</groupId> - <artifactId>mapr-release</artifactId> - <version>5.1.0-mapr-SNAPSHOT</version> + <artifactId>drill-root</artifactId> + <groupId>org.apache.drill</groupId> + <version>1.6.0-SNAPSHOT</version> <relativePath/> </parent> <artifactId>drill-storage-maprdb</artifactId> <name>maprdb-storage-plugin</name> - <version>1.5.0-SNAPSHOT</version> <properties> - <mapr.version>${project.parent.version}</mapr.version> - <drill.version>${project.version}</drill.version> - <hbase.version>0.98.12-mapr-1506</hbase.version> - <guava.version>18.0</guava.version> + <maprdb-storage-plugin.mapr.version>5.1.0-mapr</maprdb-storage-plugin.mapr.version> + <maprdb-storage-plugin.hbase.version>0.98.12-mapr-1506</maprdb-storage-plugin.hbase.version> + <maprdb-storage-plugin.hadoop.version>2.7.0-mapr-1602</maprdb-storage-plugin.hadoop.version> <maprdb.TestSuite>**/MaprDBTestsSuite.class</maprdb.TestSuite> </properties> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>com.mapr.hadoop</groupId> + <artifactId>maprfs</artifactId> + <version>${maprdb-storage-plugin.mapr.version}</version> + </dependency> + <dependency> + <groupId>com.mapr.fs</groupId> + <artifactId>mapr-hbase</artifactId> + <version>${maprdb-storage-plugin.mapr.version}</version> + </dependency> + <dependency> + <groupId>com.mapr.db</groupId> + <artifactId>maprdb</artifactId> + <version>${maprdb-storage-plugin.mapr.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-client</artifactId> + <version>${maprdb-storage-plugin.hbase.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hbase</groupId> + <artifactId>hbase-server</artifactId> + <version>${maprdb-storage-plugin.hbase.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-annotations</artifactId> + <version>${maprdb-storage-plugin.hadoop.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-client</artifactId> + <version>${maprdb-storage-plugin.hadoop.version}</version> + </dependency> + <dependency> + <groupId>org.apache.hadoop</groupId> + <artifactId>hadoop-common</artifactId> + <version>${maprdb-storage-plugin.hadoop.version}</version> + </dependency> + </dependencies> + </dependencyManagement> + <build> <plugins> <plugin> @@ -60,6 +103,7 @@ </build> <dependencies> + <dependency> <groupId>com.mapr.hadoop</groupId> <artifactId>maprfs</artifactId> @@ -69,6 +113,10 @@ <groupId>commons-logging</groupId> </exclusion> <exclusion> + <artifactId>log4j</artifactId> + <groupId>log4j</groupId> + </exclusion> + <exclusion> <artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion> @@ -79,54 +127,27 @@ <artifactId>mapr-hbase</artifactId> <exclusions> <exclusion> - <artifactId>slf4j-log4j12</artifactId> - <groupId>org.slf4j</groupId> - </exclusion> - <exclusion> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-core</artifactId> - </exclusion> - <exclusion> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-server</artifactId> - </exclusion> - <exclusion> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-json</artifactId> - </exclusion> - <exclusion> - <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> + <groupId>commons-logging</groupId> </exclusion> <exclusion> - <groupId>asm</groupId> - <artifactId>asm</artifactId> + <artifactId>log4j</artifactId> + <groupId>log4j</groupId> </exclusion> <exclusion> - <groupId>org.mortbay.jetty</groupId> <artifactId>servlet-api-2.5</artifactId> + <groupId>org.mortbay.jetty</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.mapr.db</groupId> <artifactId>maprdb</artifactId> - <exclusions> - <exclusion> - <artifactId>slf4j-log4j12</artifactId> - <groupId>org.slf4j</groupId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>${guava.version}</version> </dependency> <dependency> <groupId>org.apache.drill.exec</groupId> <artifactId>drill-java-exec</artifactId> - <version>${drill.version}</version> + <version>${project.version}</version> <exclusions> <exclusion> <artifactId>log4j-over-slf4j</artifactId> @@ -137,57 +158,38 @@ <dependency> <groupId>org.apache.drill.contrib</groupId> <artifactId>drill-storage-hbase</artifactId> - <version>${drill.version}</version> + <version>${project.version}</version> <exclusions> <exclusion> <artifactId>log4j-over-slf4j</artifactId> <groupId>org.slf4j</groupId> </exclusion> - <exclusion> - <artifactId>hbase-client</artifactId> - <groupId>org.apache.hbase</groupId> - </exclusion> </exclusions> </dependency> <!-- Test dependencies --> <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - </dependency> - <dependency> - <groupId>de.huxhorn.lilith</groupId> - <artifactId>de.huxhorn.lilith.logback.appender.multiplex-classic</artifactId> - <version>0.9.44</version> - <scope>test</scope> - </dependency> - - <dependency> <groupId>com.mapr</groupId> <artifactId>mapr-java-utils</artifactId> + <version>${maprdb-storage-plugin.mapr.version}</version> <classifier>tests</classifier> - <exclusions> - <exclusion> - <artifactId>slf4j-log4j12</artifactId> - <groupId>org.slf4j</groupId> - </exclusion> - </exclusions> + </dependency> + <dependency> + <groupId>com.mapr</groupId> + <artifactId>mapr-test-annotations</artifactId> + <version>${maprdb-storage-plugin.mapr.version}</version> </dependency> <dependency> <groupId>org.apache.drill.exec</groupId> <artifactId>drill-java-exec</artifactId> - <version>${drill.version}</version> + <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.drill</groupId> <artifactId>drill-common</artifactId> - <version>${drill.version}</version> + <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> <exclusions> @@ -200,13 +202,14 @@ <dependency> <groupId>org.apache.drill.contrib</groupId> <artifactId>drill-storage-hbase</artifactId> - <version>${drill.version}</version> + <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-server</artifactId> + <version>${maprdb-storage-plugin.hbase.version}</version> <scope>test</scope> <classifier>tests</classifier> <exclusions> @@ -226,6 +229,10 @@ <artifactId>slf4j-log4j12</artifactId> <groupId>org.slf4j</groupId> </exclusion> + <exclusion> + <artifactId>log4j</artifactId> + <groupId>log4j</groupId> + </exclusion> </exclusions> </dependency> http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java index 024fa2b..ba44145 100644 --- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java +++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/CompareFunctionsProcessor.java @@ -1,3 +1,20 @@ +/** + * 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.maprdb.json; import org.apache.drill.common.expression.CastExpression; @@ -14,12 +31,8 @@ import org.apache.drill.common.expression.ValueExpressions.IntExpression; import org.apache.drill.common.expression.ValueExpressions.LongExpression; import org.apache.drill.common.expression.ValueExpressions.QuotedString; import org.apache.drill.common.expression.ValueExpressions.TimeExpression; -import org.apache.drill.common.expression.ValueExpressions.TimeStampExpression; import org.apache.drill.common.expression.visitors.AbstractExprVisitor; import org.ojai.Value; -import org.ojai.types.ODate; -import org.ojai.types.OTime; -import org.ojai.types.OTimestamp; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonConditionBuilder.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonConditionBuilder.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonConditionBuilder.java index a48d784..ef32436 100644 --- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonConditionBuilder.java +++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonConditionBuilder.java @@ -1,23 +1,36 @@ +/** + * 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.maprdb.json; +import static org.ojai.DocumentConstants.ID_KEY; + import org.apache.drill.common.expression.BooleanOperator; import org.apache.drill.common.expression.FunctionCall; import org.apache.drill.common.expression.LogicalExpression; import org.apache.drill.common.expression.SchemaPath; import org.apache.drill.common.expression.visitors.AbstractExprVisitor; import org.apache.drill.exec.store.hbase.DrillHBaseConstants; -import org.apache.hadoop.hbase.HConstants; -import org.bouncycastle.util.Arrays; import org.ojai.Value; - -import static org.ojai.DocumentConstants.ID_KEY; - import org.ojai.store.QueryCondition; import org.ojai.store.QueryCondition.Op; import com.google.common.collect.ImmutableList; import com.mapr.db.MapRDB; -import com.mapr.db.impl.IdCodec; public class JsonConditionBuilder extends AbstractExprVisitor<JsonScanSpec, Void, RuntimeException> implements DrillHBaseConstants { http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonScanSpec.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonScanSpec.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonScanSpec.java index f278dd4..7763273 100644 --- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonScanSpec.java +++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonScanSpec.java @@ -1,8 +1,23 @@ +/** + * 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.maprdb.json; -import org.apache.drill.exec.store.hbase.HBaseUtils; import org.apache.hadoop.hbase.HConstants; -import org.apache.hadoop.hbase.util.Bytes; import org.ojai.store.QueryCondition; import com.fasterxml.jackson.annotation.JsonCreator; http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonSubScanSpec.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonSubScanSpec.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonSubScanSpec.java index adb8014..996f658 100644 --- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonSubScanSpec.java +++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonSubScanSpec.java @@ -1,3 +1,20 @@ +/** + * 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.maprdb.json; import java.nio.ByteBuffer; http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonTableGroupScan.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonTableGroupScan.java b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonTableGroupScan.java index e723179..db27137 100644 --- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonTableGroupScan.java +++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/JsonTableGroupScan.java @@ -21,20 +21,15 @@ import static org.apache.drill.exec.store.maprdb.util.CommonFns.isNullOrEmpty; import java.io.IOException; import java.util.List; -import java.util.Map; -import java.util.NavigableMap; import java.util.TreeMap; import org.apache.drill.common.exceptions.DrillRuntimeException; import org.apache.drill.common.exceptions.ExecutionSetupException; import org.apache.drill.common.expression.SchemaPath; -import org.apache.drill.exec.physical.PhysicalOperatorSetupException; -import org.apache.drill.exec.physical.base.AbstractGroupScan; import org.apache.drill.exec.physical.base.GroupScan; import org.apache.drill.exec.physical.base.PhysicalOperator; import org.apache.drill.exec.physical.base.ScanStats; import org.apache.drill.exec.physical.base.ScanStats.GroupScanProperty; -import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint; import org.apache.drill.exec.store.StoragePluginRegistry; import org.apache.drill.exec.store.dfs.FileSystemConfig; import org.apache.drill.exec.store.dfs.FileSystemPlugin; @@ -44,8 +39,6 @@ import org.apache.drill.exec.store.maprdb.MapRDBGroupScan; import org.apache.drill.exec.store.maprdb.MapRDBSubScan; import org.apache.drill.exec.store.maprdb.MapRDBTableStats; import org.apache.drill.exec.store.maprdb.TabletFragmentInfo; -import org.apache.drill.exec.store.maprdb.json.JsonScanSpec; -import org.apache.drill.exec.store.maprdb.json.JsonSubScanSpec; import org.apache.hadoop.conf.Configuration; import org.codehaus.jackson.annotate.JsonCreator; http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/BaseJsonTest.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/BaseJsonTest.java b/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/BaseJsonTest.java new file mode 100644 index 0000000..5e10528 --- /dev/null +++ b/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/BaseJsonTest.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 com.mapr.drill.maprdb.tests.json; + +import org.apache.drill.BaseTestQuery; +import org.apache.drill.hbase.GuavaPatcher; +import org.junit.AfterClass; +import org.junit.BeforeClass; + +import com.mapr.drill.maprdb.tests.MaprDBTestsSuite; + +public class BaseJsonTest extends BaseTestQuery { + + @BeforeClass + public static void setupDefaultTestCluster() throws Exception { + // Invoke the Guava patcher before any code + GuavaPatcher.patch(); + + // Since we override the class initializer of parent class, + // invoke it explicitly. This will setup a Drill cluster. + BaseTestQuery.setupDefaultTestCluster(); + + MaprDBTestsSuite.setupTests(); + MaprDBTestsSuite.createPluginAndGetConf(getDrillbitContext()); + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + MaprDBTestsSuite.cleanupTests(); + } + +} http://git-wip-us.apache.org/repos/asf/drill/blob/6988254f/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/TestSimpleJson.java ---------------------------------------------------------------------- diff --git a/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/TestSimpleJson.java b/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/TestSimpleJson.java index 414b823..84a73ce 100644 --- a/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/TestSimpleJson.java +++ b/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/json/TestSimpleJson.java @@ -19,32 +19,17 @@ package com.mapr.drill.maprdb.tests.json; import java.util.List; -import org.apache.drill.BaseTestQuery; import org.apache.drill.PlanTestBase; import org.apache.drill.exec.exception.SchemaChangeException; import org.apache.drill.exec.rpc.user.QueryDataBatch; -import org.junit.AfterClass; import org.junit.Assert; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.mapr.drill.maprdb.tests.MaprDBTestsSuite; import com.mapr.tests.annotations.ClusterTest; @Category(ClusterTest.class) -public class TestSimpleJson extends BaseTestQuery { - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - MaprDBTestsSuite.setupTests(); - MaprDBTestsSuite.createPluginAndGetConf(getDrillbitContext()); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - MaprDBTestsSuite.cleanupTests(); - } +public class TestSimpleJson extends BaseJsonTest { @Test public void testMe() throws Exception {