Bug #2601
matching document not found when Ingesting the same book in overwrite mode
100%
Description
When comparing the section heirarchy of old and new version of Document 60 of Library reference DT, it didn't find the match document eventhough old and new version are the same book
Updated by Venmuhilan B about 2 years ago
- Status changed from New to In Progress
Reason:
ssname present in the text file - print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
ssname in the content kind:
- String value -> "print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)"
ssname in the query to fetch the document from content kind:
select * from content where documentProcessingId = '68881601-b3dc-484e-ba5f-01246c2457b0' and ssname = 'Built-in Functions' and sssname = 'print(*objects, sep=\' \', end=\'\n\', file=sys.stdout, flush=False)'
we are doing escape SingleQuotation for the sname( ' to \'). If we don't escape single quotation, it will throw this error
SEVERE: com.google.cloud.datastore.DatastoreException: Encountered "r" at line 1, column 157.
Was expecting one of:
<EOF>
"and" ...
"group" ...
"limit" ...
"offset" ...
"order" ...
That's why the single quotation is escaped as the sssname is included in the query string. After the query, the filter looks like this,
filters {
property_filter {
property {
name: "sssname"
}
op: EQUAL
value {
string_value: "print(*objects, sep=\' \', end=\'\n\', file=sys.stdout, flush=False)"
}
}
}
So, the sssname present in the filter and the sssname present in the content kind will not match. I thinks that's why it can't able find the matching document.
If we don't do escape single quotation, it will throw this error
SEVERE: com.google.cloud.datastore.DatastoreException: Encountered "r" at line 1, column 157., If we do escape single quotation, it will not find the comaparable document for document 60 of Lib ref DT.
Updated by Venmuhilan B about 2 years ago
*Fix:
Used *PropertyFilter instead of queryString to avoid escaping single and double quotes in section Names.
reference - https://cloud.google.com/datastore/docs/concepts/queries
MR - https://gitlab.com/kordale/rapidken-j/-/merge_requests/1474
Updated by Venmuhilan B about 2 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Updated by Ayush Khandelwal about 2 years ago
- Due date set to 09/08/2022
- Priority changed from Normal to Urgent
- Estimated time set to 2.00 h
Updated by Venmuhilan B about 2 years ago
- Status changed from Resolved to Feedback
- Assignee changed from Venmuhilan B to Ayush Khandelwal
Updated by Ayush Khandelwal about 2 years ago
- Status changed from Feedback to Closed
Working as expected on QA