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
f6e252f8
Commit
f6e252f8
authored
Nov 05, 2019
by
nikhilbonte
Committed by
Ashutosh Mestry
Nov 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3504-DSL-query-with-like-clause-returns-unexpected-results-v1.patch
Signed-off-by:
Ashutosh Mestry
<
amestry@hortonworks.com
>
parent
9115e7d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
Solr6Index.java
...main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
+7
-0
DSLQueriesTest.java
.../src/test/java/org/apache/atlas/query/DSLQueriesTest.java
+8
-0
No files found.
graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
View file @
f6e252f8
...
...
@@ -24,6 +24,8 @@ import java.io.IOException;
import
java.io.StringReader
;
import
java.io.UncheckedIOException
;
import
java.lang.reflect.Constructor
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.Instant
;
...
...
@@ -1077,6 +1079,10 @@ public class Solr6Index implements IndexProvider {
}
else
if
(
AttributeUtil
.
isDecimal
(
dataType
))
{
if
(
dataType
.
equals
(
Float
.
class
))
postfix
=
"_f"
;
else
postfix
=
"_d"
;
}
else
if
(
dataType
.
equals
(
BigInteger
.
class
))
{
postfix
=
"_bi"
;
}
else
if
(
dataType
.
equals
(
BigDecimal
.
class
))
{
postfix
=
"_bd"
;
}
else
if
(
dataType
.
equals
(
Geoshape
.
class
))
{
postfix
=
"_g"
;
}
else
if
(
dataType
.
equals
(
Date
.
class
)
||
dataType
.
equals
(
Instant
.
class
))
{
...
...
@@ -1086,6 +1092,7 @@ public class Solr6Index implements IndexProvider {
}
else
if
(
dataType
.
equals
(
UUID
.
class
))
{
postfix
=
"_uuid"
;
}
else
throw
new
IllegalArgumentException
(
"Unsupported data type ["
+
dataType
+
"] for field: "
+
key
);
if
(
keyInfo
.
getCardinality
()
==
Cardinality
.
SET
||
keyInfo
.
getCardinality
()
==
Cardinality
.
LIST
)
{
postfix
+=
"s"
;
}
...
...
repository/src/test/java/org/apache/atlas/query/DSLQueriesTest.java
View file @
f6e252f8
...
...
@@ -134,6 +134,14 @@ public class DSLQueriesTest extends BasicTestSetup {
@DataProvider
(
name
=
"comparisonQueriesProvider"
)
private
Object
[][]
comparisonQueriesProvider
()
{
return
new
Object
[][]
{
{
"Person where (name = \"Julius\" )"
,
1
},
{
"Person where (name like \"Jul*\" )"
,
1
},
{
"Person where (name like \"J*\" )"
,
3
},
{
"Person where (name like \"*us\" )"
,
1
},
{
"Person where (name like \"*uli*\" )"
,
1
},
{
"Person where (name like \"Julius\" )"
,
1
},
{
"Person where (name like \"Jul\" )"
,
0
},
{
"Person where (birthday < \"1950-01-01T02:35:58.440Z\" )"
,
0
},
{
"Person where (birthday > \"1975-01-01T02:35:58.440Z\" )"
,
2
},
{
"Person where (birthday >= \"1975-01-01T02:35:58.440Z\" )"
,
2
},
...
...
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