You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During evaluation of FastDDS I tried to create a filtered subscription based on a STRING value. According to the documentation: DefaultFilter the string may be compared with LIKE/MATCH or EQUALS.
If the check for the color is added to the filter of the ShapesDemo ShapeSubscriber the following variants should behave identically:
Fixed color within filter expression
staticuint64_t filter_index = 0;
//const std::string color = "RED";
std::vector<std::string> parameters;
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_minX));
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_maxX));
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_minY));
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_maxY));
// parameters.emplace_back(color);
mp_filtered_topic = mp_sd->getParticipant()->create_contentfilteredtopic(
std::to_string(filter_index++), mp_topic,
"x > %0 AND x < %1 AND y > %2 AND y < %3 AND color = 'RED'", parameters);
Color supplied as a parameter to the filter
staticuint64_t filter_index = 0;
const std::string color = "RED";
std::vector<std::string> parameters;
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_minX));
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_maxX));
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_minY));
parameters.emplace_back(std::to_string(m_shapeHistory.m_filter.m_maxY));
parameters.emplace_back(color);
mp_filtered_topic = mp_sd->getParticipant()->create_contentfilteredtopic(
std::to_string(filter_index++), mp_topic,
"x > %0 AND x < %1 AND y > %2 AND y < %3 AND color = '%4'", parameters);
Both filters should filter the samples of the selected shape topic if the position is within the boundaries and the color is RED.
Current behavior
Fixed color within filter expression
If the color is fixed within the filter expression the subscription works as expected. Only the shapes with the RED color within the boundaries are filtered.
Color supplied as a parameter to the filter
If the color is provided as a parameter the subscription does not yield any samples of the RED shape.
Steps to reproduce
Create a Filter with a STRING variable e.g. ""x > %0 AND x < %1 AND y > %2 AND y < %3 AND color = '%4'"
Other. Please specify in Additional context section.
Transport layer
UDPv4
Additional context
Some preliminary debugging points to the DDSFilterPredicate. If the STRING value is provided as a parameter the content of the _right->string_value is "%4" instead of "RED". It seems that the parser mixes up the parameter and the LIKE expression?
Compiled on: Linux 6.1.69-1-MANJARO #1 SMP PREEMPT_DYNAMIC Thu Dec 21 12:29:38 UTC 2023 x86_64 GNU/Linux
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered:
You should remove the single quotes around the parameter, so your filter expression would be something like x > %0 AND x < %1 AND y > %2 AND y < %3 AND color = %4
Is there an already existing issue for this?
Expected behavior
During evaluation of FastDDS I tried to create a filtered subscription based on a STRING value. According to the documentation: DefaultFilter the string may be compared with LIKE/MATCH or EQUALS.
If the check for the color is added to the filter of the ShapesDemo ShapeSubscriber the following variants should behave identically:
Both filters should filter the samples of the selected shape topic if the position is within the boundaries and the color is RED.
Current behavior
If the color is fixed within the filter expression the subscription works as expected. Only the shapes with the RED color within the boundaries are filtered.
If the color is provided as a parameter the subscription does not yield any samples of the RED shape.
Steps to reproduce
Example available at : https://github.com/p2k-ko/ShapesDemo/tree/issue_4199
Fast DDS version/commit
commit 7195ede
Platform/Architecture
Other. Please specify in Additional context section.
Transport layer
UDPv4
Additional context
Some preliminary debugging points to the
DDSFilterPredicate
. If the STRING value is provided as a parameter the content of the_right->string_value
is "%4" instead of "RED". It seems that the parser mixes up the parameter and the LIKE expression?Compiled on: Linux 6.1.69-1-MANJARO #1 SMP PREEMPT_DYNAMIC Thu Dec 21 12:29:38 UTC 2023 x86_64 GNU/Linux
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: