[
https://issues.apache.org/jira/browse/EAGLE-473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426388#comment-15426388
]
ASF GitHub Bot commented on EAGLE-473:
--------------------------------------
Github user haoch commented on a diff in the pull request:
https://github.com/apache/incubator-eagle/pull/361#discussion_r75302554
--- Diff:
eagle-core/eagle-query/eagle-query-base/src/test/java/org/apache/eagle/query/aggregate/test/TestListQueryCompiler.java
---
@@ -0,0 +1,51 @@
+/*
+ * 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.eagle.query.aggregate.test;
+
+import org.apache.eagle.query.ListQueryCompiler;
+import org.apache.eagle.query.parser.EagleQueryParseException;
+import org.junit.Assert;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TestListQueryCompiler {
+ private final static Logger LOG =
LoggerFactory.getLogger(TestListQueryCompiler.class);
+ @Test
+ public void test() throws Exception {
+ try {
+ try {
+ String queryWithCondition =
"JobExecutionService[@site=\"apollo\"]{*}";
+ ListQueryCompiler compiler1 = new
ListQueryCompiler(queryWithCondition);
+ } catch (EagleQueryParseException ex) {}
+ try {
+ String queryWithSquareBrackets =
"JobExecutionService[@jobId=\"[A9BB756F29494F3C8281117FE58A4632/361C947C782F44748BFD840CE2FDBFB8]
com.ebay.scalding.coview.CoviewsBasedOnSojornerData[site=2,
runDate=2016-08-17, nDays=7}]/(4/5)\"]{*}";
--- End diff --
1) Clean sensitive info.
2) Add clear `Assert` checking, especially should equal with expected value.
> Query error if query string contains "[]"
> -----------------------------------------
>
> Key: EAGLE-473
> URL: https://issues.apache.org/jira/browse/EAGLE-473
> Project: Eagle
> Issue Type: Bug
> Affects Versions: v0.3.0
> Reporter: Zhao, Qingwen
> Fix For: v0.5.0
>
>
> Query
> string:[7279137F3E23471BBB397E52FC94543A/ED1F4AD763A64097B640A7CBD54F4AD9]
> Promoted Listing Job 2016/08/15/(25/29)
> {code}
> success: false,
> exception: "java.lang.Exception: java.io.IOException:
> org.apache.eagle.storage.exception.QueryCompileException:
> java.lang.IllegalArgumentException: List query syntax is
> <EntityName>[<Filter>]{<Projection>} Aggregate query syntax is
> <EntityName>[<Filter>]<GroupbyFields>{<AggregateFunctions>}.{<SortOptions>}
> org.apache.eagle.storage.operation.QueryStatement.execute(QueryStatement.java:43)
>
> org.apache.eagle.service.generic.GenericEntityServiceResource.search(GenericEntityServiceResource.java:443)
>
> org.apache.eagle.service.jpm.MRJobExecutionResource.searchJobsById(MRJobExecutionResource.java:149)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> java.lang.reflect.Method.invoke(Method.java:498)
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
>
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>
> org.apache.eagle.service.jpm.MRJobExecutionResource.searchJobsById(MRJobExecutionResource.java:158)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> java.lang.reflect.Method.invoke(Method.java:498)
> com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
>
> com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
>
> com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
>
> com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
>
> com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
> ",
> obj: [ ]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)