Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
6bacbe94
Commit
6bacbe94
authored
May 11, 2018
by
nixonrodrigues
Committed by
Madhan Neethiraj
May 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2673: Decode query string for DSL search
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
e4ffcf24
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
QuickStartV2.java
...src/main/java/org/apache/atlas/examples/QuickStartV2.java
+5
-0
DiscoveryREST.java
...rc/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
+3
-0
Servlets.java
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java
+11
-0
No files found.
webapp/src/main/java/org/apache/atlas/examples/QuickStartV2.java
View file @
6bacbe94
...
...
@@ -463,6 +463,9 @@ public class QuickStartV2 {
return
new
String
[]{
"from DB"
,
"DB"
,
"DB where name=%22Reporting%22"
,
"DB where name=%22encode_db_name%22"
,
"Table where name=%2522sales_fact%2522"
,
"DB where name=\"Reporting\""
,
"DB where DB.name=\"Reporting\""
,
"DB name = \"Reporting\""
,
...
...
@@ -519,6 +522,8 @@ public class QuickStartV2 {
System
.
out
.
println
(
"query ["
+
dslQuery
+
"] returned ["
+
fullTextResults
.
size
()
+
"] rows."
);
}
else
if
(
attribResult
!=
null
)
{
System
.
out
.
println
(
"query ["
+
dslQuery
+
"] returned ["
+
attribResult
.
getValues
().
size
()
+
"] rows."
);
}
else
{
System
.
out
.
println
(
"query ["
+
dslQuery
+
"] returned [ 0 ] rows."
);
}
}
else
{
System
.
out
.
println
(
"query ["
+
dslQuery
+
"] failed, results:"
+
results
);
...
...
webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java
View file @
6bacbe94
...
...
@@ -112,6 +112,9 @@ public class DiscoveryREST {
AtlasPerfTracer
perf
=
null
;
try
{
query
=
Servlets
.
decodeQueryString
(
query
);
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"DiscoveryREST.searchUsingDSL("
+
query
+
","
+
typeName
+
","
+
classification
+
","
+
limit
+
","
+
offset
+
")"
);
...
...
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java
View file @
6bacbe94
...
...
@@ -40,10 +40,12 @@ import javax.ws.rs.core.MediaType;
import
javax.ws.rs.core.Response
;
import
java.io.IOException
;
import
java.io.StringWriter
;
import
java.io.UnsupportedEncodingException
;
import
java.nio.charset.Charset
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.web.util.UriUtils
;
/**
* Utility functions for dealing with servlets.
...
...
@@ -211,4 +213,13 @@ public final class Servlets {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_QUERY_PARAM_LENGTH
,
paramName
);
}
}
public
static
String
decodeQueryString
(
String
query
){
try
{
return
UriUtils
.
decode
(
query
,
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
){
return
query
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment