Skip to content

Commit 0f46c9c

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 b177e87 commit 0f46c9c

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
@@ -995,6 +995,19 @@ void dds_domain_examples()
995995
"true"); // true or True or TRUE or 1
996996
//!--
997997
}
998+
999+
{
1000+
// DDS_SQL_LIMITS_PROPERTY
1001+
DomainParticipantQos pqos;
1002+
1003+
pqos.properties().properties().emplace_back(
1004+
"dds.sql.expression.max_expression_length",
1005+
"20000");
1006+
pqos.properties().properties().emplace_back(
1007+
"dds.sql.expression.max_subexpressions",
1008+
"10");
1009+
//!--
1010+
}
9981011
}
9991012

10001013
//DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS

code/XMLTester.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,6 +3317,34 @@
33173317
-->
33183318
<!--><-->
33193319

3320+
<!-->DDS_SQL_LIMITS_PROPERTY<-->
3321+
<!--
3322+
<?xml version="1.0" encoding="UTF-8" ?>
3323+
<dds xmlns="http://www.eprosima.com">
3324+
<profiles>
3325+
-->
3326+
<participant profile_name="custom_sql_limits_domainparticipant_xml_profile">
3327+
<rtps>
3328+
<propertiesPolicy>
3329+
<properties>
3330+
<property>
3331+
<name>dds.sql.expression.max_expression_length</name>
3332+
<value>20000</value>
3333+
</property>
3334+
<property>
3335+
<name>dds.sql.expression.max_subexpressions</name>
3336+
<value>10</value>
3337+
</property>
3338+
</properties>
3339+
</propertiesPolicy>
3340+
</rtps>
3341+
</participant>
3342+
<!--
3343+
</profiles>
3344+
</dds>
3345+
-->
3346+
<!--><-->
3347+
33203348
<!-->FASTDDS_STATISTICS_MODULE<-->
33213349
<participant profile_name="statistics_domainparticipant_conf_xml_profile">
33223350
<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)