Skip to content

Commit d63d8e5

Browse files
MiguelCompanymergify[bot]
authored andcommitted
Add documentation for SQL filter expression limits (#1224)
* Refs #24181. Add properties in non-consolidated QoS. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #24181. Add example. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #24181. Add link from the filtering section. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #24181. Fix doc8. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #24181. Apply suggestions. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 7bb4e28)
1 parent 6eb8e40 commit d63d8e5

4 files changed

Lines changed: 87 additions & 0 deletions

File tree

code/DDSCodeTester.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,19 @@ void dds_domain_examples()
10131013
"true"); // true or True or TRUE or 1
10141014
//!--
10151015
}
1016+
1017+
{
1018+
// DDS_SQL_LIMITS_PROPERTY
1019+
DomainParticipantQos pqos;
1020+
1021+
pqos.properties().properties().emplace_back(
1022+
"dds.sql.expression.max_expression_length",
1023+
"20000");
1024+
pqos.properties().properties().emplace_back(
1025+
"dds.sql.expression.max_subexpressions",
1026+
"10");
1027+
//!--
1028+
}
10161029
}
10171030

10181031
//DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS

code/XMLTester.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,6 +3327,34 @@
33273327
-->
33283328
<!--><-->
33293329

3330+
<!-->DDS_SQL_LIMITS_PROPERTY<-->
3331+
<!--
3332+
<?xml version="1.0" encoding="UTF-8" ?>
3333+
<dds xmlns="http://www.eprosima.com">
3334+
<profiles>
3335+
-->
3336+
<participant profile_name="custom_sql_limits_domainparticipant_xml_profile">
3337+
<rtps>
3338+
<propertiesPolicy>
3339+
<properties>
3340+
<property>
3341+
<name>dds.sql.expression.max_expression_length</name>
3342+
<value>20000</value>
3343+
</property>
3344+
<property>
3345+
<name>dds.sql.expression.max_subexpressions</name>
3346+
<value>10</value>
3347+
</property>
3348+
</properties>
3349+
</propertiesPolicy>
3350+
</rtps>
3351+
</participant>
3352+
<!--
3353+
</profiles>
3354+
</dds>
3355+
-->
3356+
<!--><-->
3357+
33303358
<!-->FASTDDS_STATISTICS_MODULE<-->
33313359
<participant profile_name="statistics_domainparticipant_conf_xml_profile">
33323360
<rtps>

docs/fastdds/dds_layer/topic/contentFilteredTopic/defaultFilter.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ The default SQL-like filter
99
Filter expressions used by :ref:`dds_layer_topic_contentFilteredTopic` API may use a subset of SQL syntax, extended with
1010
the possibility to use program variables in the SQL expression.
1111
This section shows this default SQL-like syntax and how to use it.
12+
Apart from the syntax described in this section, certain restrictions apply to the allowed SQL expressions.
13+
These restrictions can be relaxed or tightened by the user, as explained in
14+
:ref:`properties_sql_filter_expression_limits`.
1215

1316
* :ref:`default_sql_filter_grammar`
1417
* :ref:`default_sql_filter_like`

docs/fastdds/property_policies/non_consolidated_qos.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,3 +543,46 @@ The following table lists all the optional QoS that can be serialized in the dis
543543
:start-after: <!-->SERIALIZE_OPTIONAL_QOS_PROPERTY<-->
544544
:end-before: <!--><-->
545545
:lines: 2-4,6-17,19-20
546+
547+
.. _properties_sql_filter_expression_limits:
548+
549+
SQL Filter Expression limits
550+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
551+
552+
When creating content-filtered topics using the
553+
:ref:`default SQL-like filter <dds_layer_topic_contentFilteredTopic_default_filter>`, some restrictions apply to the
554+
SQL expressions that can be used for content-based filtering.
555+
The default limits are set to values that should be enough for most use cases, but they can be customized using the
556+
following properties when a participant is created:
557+
558+
.. list-table::
559+
:header-rows: 1
560+
:align: left
561+
562+
* - PropertyPolicyQos name
563+
- PropertyPolicyQos value
564+
- Default value
565+
* - ``"dds.sql.expression.max_expression_length"``
566+
- Maximum length of the SQL expression, in characters.
567+
- ``16384``
568+
* - ``"dds.sql.expression.max_subexpressions"``
569+
- Maximum number of sub-expressions in the SQL expression.
570+
- ``256``
571+
572+
Creating content-filtered topics with expressions exceeding any of these limits will fail.
573+
Expressions received in discovery messages exceeding any of these limits will be ignored, and filtering will happen
574+
in the reader side.
575+
576+
.. tab-set-code::
577+
578+
.. literalinclude:: /../code/DDSCodeTester.cpp
579+
:language: c++
580+
:start-after: // DDS_SQL_LIMITS_PROPERTY
581+
:end-before: //!--
582+
:dedent: 8
583+
584+
.. literalinclude:: /../code/XMLTester.xml
585+
:language: xml
586+
:start-after: <!-->DDS_SQL_LIMITS_PROPERTY<-->
587+
:end-before: <!--><-->
588+
:lines: 2-4,6-21,23-24

0 commit comments

Comments
 (0)