-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-28288 Add support for regex and timestamp types. #18530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. Questions regarding clarity more than anything else.
@@ -57,6 +57,13 @@ layoutDates := {STRING bucket_start_date, STRING bucket_end_date}; | |||
layoutEmployee := {INTEGER1 id, STRING25 first, STRING25 last, REAL salary}; | |||
layoutperson := {String username, String address, String email}; | |||
|
|||
layoutRegexTimestamp := RECORD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this definition (and the associated test code) conflating testing regex and timestamp data types? I feel like the new data types should be defined and tested separately, for clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separated the test cases.
@@ -26,3 +26,6 @@ EXPORT boolean supportsScript := true; | |||
EXPORT updateResultRecord := {INTEGER matched_count, INTEGER modified_count}; | |||
EXPORT insertManyResultRecord := {INTEGER inserted_count}; | |||
EXPORT deleteResultRecord := {INTEGER deleted_count}; | |||
|
|||
EXPORT regexType := {STRING pattern, STRING options}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document these fields, or provide a URL to a MongoDB page describing their usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a url in the ecllib file and added to the documentation in the README.md file.
@@ -26,3 +26,6 @@ EXPORT boolean supportsScript := true; | |||
EXPORT updateResultRecord := {INTEGER matched_count, INTEGER modified_count}; | |||
EXPORT insertManyResultRecord := {INTEGER inserted_count}; | |||
EXPORT deleteResultRecord := {INTEGER deleted_count}; | |||
|
|||
EXPORT regexType := {STRING pattern, STRING options}; | |||
EXPORT timestampType := {UNSIGNED t, UNSIGNED i}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we document these fields, or provide a URL to a MongoDB page describing their usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much clearer, thanks. Approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment, otherwise looks good.
plugins/mongodb/mongodbembed.cpp
Outdated
while (*end && *end != '}') | ||
end++; | ||
|
||
end++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if *end is '\0' (which I imagine should never happen) then this will increment end
to point past the end of the string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a check for the null character in case there is invalid json or an error while processing.
Also needs re-basing following the change to fixes white-space. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash.
@ghalliday Squashed. |
Type of change:
Checklist:
Smoketest:
Testing: