Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unify special chars in index property #1670

Merged
merged 4 commits into from
Nov 25, 2021
Merged

unify special chars in index property #1670

merged 4 commits into from
Nov 25, 2021

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Nov 24, 2021

just not allow leading special char in index property,
it's ok a special char is placed in non-leading position.

NOTE: not allowed 0x00 byte in any position for pgsql/rocksdb/hbase

fix #1638

Change-Id: Id3f0eb39c30da2ff4b11221df0e138cc77c885b2

just not allow leading specail char in index property,
it's ok a specail char is placed in non-leading position.

fix #1638

Change-Id: Id3f0eb39c30da2ff4b11221df0e138cc77c885b2
coderzc
coderzc previously approved these changes Nov 24, 2021
@codecov
Copy link

codecov bot commented Nov 24, 2021

Codecov Report

Merging #1670 (ad622be) into master (b3468c7) will increase coverage by 0.05%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1670      +/-   ##
============================================
+ Coverage     66.91%   66.96%   +0.05%     
- Complexity     7062     7067       +5     
============================================
  Files           421      421              
  Lines         34673    34674       +1     
  Branches       4802     4803       +1     
============================================
+ Hits          23200    23221      +21     
+ Misses         9128     9108      -20     
  Partials       2345     2345              
Impacted Files Coverage Δ
...u/hugegraph/backend/serializer/TextSerializer.java 86.46% <ø> (ø)
.../baidu/hugegraph/backend/query/ConditionQuery.java 85.79% <80.00%> (-0.33%) ⬇️
...du/hugegraph/backend/tx/GraphIndexTransaction.java 83.95% <90.90%> (-0.10%) ⬇️
...c/main/java/com/baidu/hugegraph/task/HugeTask.java 72.30% <0.00%> (+0.30%) ⬆️
...a/com/baidu/hugegraph/backend/query/Condition.java 79.78% <0.00%> (+0.36%) ⬆️
...egraph/backend/store/cassandra/CassandraStore.java 72.64% <0.00%> (+0.85%) ⬆️
...aidu/hugegraph/backend/serializer/BytesBuffer.java 88.66% <0.00%> (+0.90%) ⬆️
.../java/com/baidu/hugegraph/auth/RolePermission.java 91.76% <0.00%> (+1.17%) ⬆️
...in/java/com/baidu/hugegraph/auth/HugeResource.java 79.22% <0.00%> (+1.29%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3468c7...ad622be. Read the comment docs.

@javeme javeme changed the title unify specail chars in index property unify special chars in index property Nov 24, 2021
Change-Id: Ie682a7df5ad013808520a4f89af021a50a6086c5
Change-Id: I134ec3cc4e7f330b9c916bf34ba98d9df1cfe090
@javeme
Copy link
Contributor Author

javeme commented Nov 24, 2021

ci error of postgresql:

testAddVertexPropertyWithSpecialValueForSecondaryIndex(com.baidu.hugegraph.core.VertexCoreTest)  Time elapsed: 0.455 s  <<< ERROR!
com.baidu.hugegraph.backend.BackendException: Failed to commit
	at com.baidu.hugegraph.core.VertexCoreTest.testAddVertexPropertyWithSpecialValueForSecondaryIndex(VertexCoreTest.java:6004)
Caused by: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO g_si (FIELD_VALUES, EXPIRED_TIME, ELEMENT_IDS, INDEX_LABEL_ID) VALUES ('aa', 0, 'S764:0', 199) ON CONFLICT (FIELD_VALUES, INDEX_LABEL_ID, ELEMENT_IDS) DO UPDATE SET FIELD_VALUES = 'aa', EXPIRED_TIME = 0, ELEMENT_IDS = 'S764:0', INDEX_LABEL_ID = 199 was aborted: ERROR: invalid byte sequence for encoding "UTF8": 0x00  Call getNextException to see other errors in the batch.
	at com.baidu.hugegraph.core.VertexCoreTest.testAddVertexPropertyWithSpecialValueForSecondaryIndex(VertexCoreTest.java:6004)
Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
	at com.baidu.hugegraph.core.VertexCoreTest.testAddVertexPropertyWithSpecialValueForSecondaryIndex(VertexCoreTest.java:6004)

coderzc
coderzc previously approved these changes Nov 25, 2021
imbajin
imbajin previously approved these changes Nov 25, 2021
@@ -1350,22 +1338,22 @@ private static ConditionQuery constructQuery(ConditionQuery query,
String joinedValues;
// 2.1 All fields have equal-conditions
if (prefixes.size() == fields.size()) {
// Prefix numeric values should be converted to sortable string
// Prefix numeric values should be converted to sort-able string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this word?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IDE prompt "The word 'sortable' is not correctly spelled", I will revert to "sortable".

Change-Id: I04b0e2aa058523aa3655063d40f40e6d65185c7f
@javeme javeme dismissed stale reviews from imbajin and coderzc via ad622be November 25, 2021 06:20
@javeme javeme merged commit 5021b11 into master Nov 25, 2021
@javeme javeme deleted the fix-index-specail-char branch November 25, 2021 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception while inserting special char values like '\\u0000'
3 participants