Repository: lens Updated Branches: refs/heads/master fe44e69fd -> 2901b4b33
LENS-729 : Add apache license header in es driver's json files Project: http://git-wip-us.apache.org/repos/asf/lens/repo Commit: http://git-wip-us.apache.org/repos/asf/lens/commit/0aad08f9 Tree: http://git-wip-us.apache.org/repos/asf/lens/tree/0aad08f9 Diff: http://git-wip-us.apache.org/repos/asf/lens/diff/0aad08f9 Branch: refs/heads/master Commit: 0aad08f919571c45fa7f5bdc4365bc18109cc72a Parents: 1ba567f Author: Rajat Khandelwal <[email protected]> Authored: Mon Aug 17 13:50:03 2015 +0530 Committer: Amareshwari Sriramadasu <[email protected]> Committed: Mon Aug 17 14:27:54 2015 +0530 ---------------------------------------------------------------------- .../lens/driver/es/QueryTranslationTest.java | 2 ++ .../src/test/resources/invalid-queries.data | 21 +++++++++++++++++++- .../src/test/resources/valid-queries.data | 21 +++++++++++++++++++- 3 files changed, 42 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lens/blob/0aad08f9/lens-driver-es/src/test/java/org/apache/lens/driver/es/QueryTranslationTest.java ---------------------------------------------------------------------- diff --git a/lens-driver-es/src/test/java/org/apache/lens/driver/es/QueryTranslationTest.java b/lens-driver-es/src/test/java/org/apache/lens/driver/es/QueryTranslationTest.java index be33764..3846b23 100644 --- a/lens-driver-es/src/test/java/org/apache/lens/driver/es/QueryTranslationTest.java +++ b/lens-driver-es/src/test/java/org/apache/lens/driver/es/QueryTranslationTest.java @@ -33,6 +33,7 @@ import org.testng.annotations.Test; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -85,6 +86,7 @@ public class QueryTranslationTest extends ESDriverTest { private static final ImmutableList<ValidQuery> VALID_QUERIES; private static final ImmutableList<InvalidQuery> IN_VALID_QUERIES; static { + OBJECT_MAPPER.configure(JsonParser.Feature.ALLOW_COMMENTS, true); // Jackson 1.2+ VALID_QUERIES = ImmutableList.copyOf(loadResource(VALID_QUERIES_RESOURCE_PATH, ValidQuery[].class)); IN_VALID_QUERIES = ImmutableList.copyOf(loadResource(INVALID_QUERIES_RESOURCE_PATH, InvalidQuery[].class)); } http://git-wip-us.apache.org/repos/asf/lens/blob/0aad08f9/lens-driver-es/src/test/resources/invalid-queries.data ---------------------------------------------------------------------- diff --git a/lens-driver-es/src/test/resources/invalid-queries.data b/lens-driver-es/src/test/resources/invalid-queries.data index 8756a51..dd6a57f 100644 --- a/lens-driver-es/src/test/resources/invalid-queries.data +++ b/lens-driver-es/src/test/resources/invalid-queries.data @@ -1,3 +1,22 @@ +/** + * 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. + */ + [ { "name" : "Ambiguous column selection", @@ -15,4 +34,4 @@ "name" : "Invalid columns in select and group by", "hql" : "select a, b from a.x group by r" } -] \ No newline at end of file +] http://git-wip-us.apache.org/repos/asf/lens/blob/0aad08f9/lens-driver-es/src/test/resources/valid-queries.data ---------------------------------------------------------------------- diff --git a/lens-driver-es/src/test/resources/valid-queries.data b/lens-driver-es/src/test/resources/valid-queries.data index 982325c..46de030 100644 --- a/lens-driver-es/src/test/resources/valid-queries.data +++ b/lens-driver-es/src/test/resources/valid-queries.data @@ -1,3 +1,22 @@ +/** + * 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. + */ + [ { "name" : "Basic simple select", @@ -64,4 +83,4 @@ "hql" : "select count(col1), col2, max(col3) from index.type where !(col1=5 and col2='p' and col3='wer' or (col4='9')) group by col2", "expectedJson" : {"size":0,"timeout":10000,"aggs":{"filter_wrapper":{"aggs":{"col2":{"terms":{"field":"col2","size":100},"aggs":{"col1":{"value_count":{"field":"col1"}},"col3":{"max":{"field":"col3"}}}}},"filter":{"not":{"or":[{"and":[{"and":[{"term":{"col1":"5"}},{"term":{"col2":"p"}}]},{"term":{"col3":"wer"}}]},{"term":{"col4":"9"}}]}}}}} } -] \ No newline at end of file +]
