Data Source Configuration Properties¶
The source configuration of a JDBC data source represents the capabilities of the underlying database. That is, it stores a list of the SQL operations and functions this database supports, the comparison operators it supports, etc. The Execution Engine uses this information to build the queries it executes in a database, with the goal of pushing down to the data source as much processing as possible, to optimize response times and minimize traffic through the network. Each database adapter defines a default source configuration. The default source configuration is different for each adapter because the capabilities of let us say Oracle, are different than the capabilities of SQL Server.
It is an uncommon that you need to modify the source configuration of a data source since the default options are tailored to the database you are connecting to. However, you can do so with this command:
ALTER DATASOURCE JDBC "<data source name>"
SOURCECONFIGURATION (
[ <source configuration property>
[ , <source configuration property> ]* ]
);
Note that with this command you are modifying the source configuration of “<data source name>”; not the source configuration of all the data sources that use the same database adapter.
For example:
ALTER DATASOURCE JDBC ds_jdbc_athena_prod
SOURCECONFIGURATION (
SUPPORTSORDERBYEXPRESSION = false
, DELEGATENATURALOUTERJOIN = false
);
To restore the default value of a property, set it to DEFAULT
. For example:
ALTER DATASOURCE JDBC ds_jdbc_athena_prod
SOURCECONFIGURATION (
DELEGATEAGGREGATEFUNCTIONS = DEFAULT
);
The table below lists the properties you can configure in the
SOURCECONFIGURATION
clause of a JDBC data source.
Property in SOURCECONFIGURATION Clause |
Meaning |
---|---|
ALLOWFORUPDATE |
Allow for UPDATE clause. If |
ALLOWLITERALASPARAMETER |
Allow literal as parameter. If If |
DELEGATEAGGREGATEFUNCTIONS |
Delegate aggregate functions list. Comma-separated list of aggregation functions the execution engine delegates to this database. |
DELEGATEALLOPERATORS |
Delegate all operators. If |
DELEGATEANALYTICFUNCTIONSLIST |
Delegate window functions list. List of window functions that can be delegated. |
DELEGATEARRAYLITERAL |
Delegate array literal. If |
DELEGATE_BINARY_ORDERBY_COLLATION |
Delegate binary ORDER BY collation |
DELEGATECOMPOUNDFIELDPROJECTION |
Delegate compound field projection. If |
DELEGATECOMPOUNDINDEXEDFIELDPROJECTION |
Delegate compound indexed field projection. If |
DELEGATEEXTENDEDUNIONALL |
Delegate EXTENDED UNION ALL. If |
DELEGATEFETCH |
Delegate FETCH clause. If |
DELEGATEGROUPBY |
Delegate GROUP BY clause. If |
DELEGATEHAVING |
Delegate HAVING clause. If |
DELEGATEINFORNONLITERALS |
Delegate in operator when includes non-literal arguments. If |
DELEGATEINNERJOIN |
Delegate INNER JOIN. If |
DELEGATEINTERSECTION |
Delegate INTERSECT. If |
DELEGATEINVALIDNUMBERLITERALSASNULL |
Delegate invalid number literals as NULL. If For example, let us say that we have a view If the property is If the property is set to This enhancement only works in conditions with the operators |
DELEGATEJOIN |
Delegate JOIN. If |
DELEGATELEFTFUNCTION |
Delegate left function. If |
DELEGATELEFTLITERAL |
Delegate left literal. If |
DELEGATELITERALEXPRESSION |
Delegate literal expression. If |
DELEGATEMINUS |
Delegate MINUS. If |
DELEGATEMIXEDAGGREGATEEXPRESSION |
Delegate mixed literal expression. If |
DELEGATENATURALOUTERJOIN |
Delegate natural OUTER JOIN. If |
DELEGATENOTCONDITION |
Delegate NOT condition. If |
DELEGATEOFFSET |
Delegate OFFSET clause. If |
DELEGATE_OFFSET_RESTRICTION |
Delegate OFFSET clause restriction. It indicates if this database has any limitations regarding the use of the clause The possible values of this property are:
If a user executes a query that involves delegating a query to this database and these restrictions are not being met, the Execution Engine will not delegate the clause This property is ignored if Delegate OFFSET clause is set to no. |
DELEGATEOPERATORSLIST |
Delegate operators list. List of operators that can be delegated. The default list has the following operators: |
DELEGATEORCONDITION |
Delegate OR condition |
DELEGATEORDERBY |
Delegate ORDER BY. If |
DELEGATE_ORDERBY_COLLATION_MODIFIER |
Delegate ORDER BY collation modifier. More details below, in ORDER BY Properties of the Source Configuration. |
DELEGATEPROJECTION |
Delegate projection. If |
DELEGATEPROJECTSUBQUERY |
Delegate SELECT subquery. If |
DELEGATEREGISTERLITERAL |
Delegate register literal. If |
DELEGATERIGHTFIELD |
Delegate right field. If |
DELEGATERIGHTFUNCTION |
Delegate right function. If |
DELEGATERIGHTLITERAL |
Delegate right literal. If |
DELEGATESCALARFUNCTIONS |
Delegate scalar functions list. List of scalar functions that the execution engine delegates to the database. |
DELEGATESELECTDISTINCT |
Delegate SELECT DISTINCT. If |
DELEGATESELECTION |
Delegate selection. If |
DELEGATESUBQUERY |
Delegate subquery. If |
DELEGATEUNION |
Delegate UNION. If |
DELEGATEUNIONALL |
Delegate UNION ALL. If |
DELEGATEUNIONDISCTINCT |
Delegate UNION DISTINCT. If |
DELEGATEWHERESUBQUERY |
Delegate WHERE subquery. If |
NESTEDJOINWITHBLOCKSSTRATEGY |
Nested join optimization syntax. This property controls some aspects of how the execution engine delegates a query when the data of the view in the right side of a nested join is obtained from this data source. See more about this in the section Nested Join. |
SUPPORTSAGGREGATEFUNCTIONSOPTIONS |
Supports modifier in aggregate function. If |
SUPPORTSBATCHINSERT |
Supports batch inserts. If This property does not affect |
SUPPORTSBRANCHOUTERJOIN |
Supports branch OUTER JOIN. If |
SUPPORTSCLOBINBATCH |
Supports CLOBs in batch inserts. If If Virtual DataPort inserts rows in batches when moving data from another data source into this one. See more about Data Movement in the section Automatic Simplification of Queries. This property does not affect This property is ignored when Supports batch inserts is |
SUPPORTSCOMPARISONDIFFERENTTYPES |
Supports comparisons between different data types. If |
SUPPORTSEQOUTERJOINOPERATOR |
Supports Eq OUTER JOIN. If |
SUPPORTSEVALUATELITERALFUNCTIONS |
Supports functions with only literal parameters. If |
SUPPORTSEXPLICITCROSSJOIN |
Supports explicit CROSS JOIN. If |
SUPPORTSFULLEQOUTERJOIN |
Supports full Eq OUTER JOIN. If |
SUPPORTSFULLNOTEQOUTERJOIN |
Supports full NotEq OUTER JOIN. If |
SUPPORTSFUSINGINUSINGANDNATURALJOIN |
Supports fusing in USING and natural JOIN. If |
SUPPORTSGROUPBYLITERALASPARAMETER |
Supports GROUP BY literals as parameters. If |
SUPPORTSJOINONCONDITION |
Supports JOIN ON Condition. If |
SUPPORTSJOINPARENTHESIS |
Supports parenthesis in n-joins. If |
SUPPORTSNATURALJOIN |
Supports NATURAL JOIN. If |
SUPPORTS_ORDERBY_BINARY_COLLATION |
Supports binary ORDER BY collation. If |
SUPPORTSORDERBYEXPRESSION |
Supports ORDER BY expressions. If |
SUPPORTSRIGHTDEEPJOIN |
Supports right deep n-joins. If |
SUPPORTSPREPAREDSTATEMENT |
Supports prepared statements (only available for JDBC data sources that use the database adapter Generic). If If Default value: |
SUPPORTSUSINGJOIN |
Supports USING JOIN. If yes, it indicates that the |
ORDER BY Properties of the Source Configuration¶
To perform ORDER BY operations over fields of type “text”, Virtual DataPort uses a “binary” collation to compare the text values of the result set and sort them. Binary collations compare strings using the Unicode value of each character.
When Virtual DataPort pushes down an ORDER BY to a database to be able to perform a merge join, the database has to perform the ORDER BY using a binary collation as well. The reason is that the Execution Engine expects the rows to be sorted using a binary collation. If they were sorted with a different collation, the results may be incorrect when the join conditions involve fields of type text.
The properties “Delegate ORDER BY collation modifier” and “Delegate binary ORDER BY collation” control how Virtual DataPort pushes down the ORDER BY clause to databases.
Note
This section explains how the following properties affect the behavior of Virtual DataPort. However, very rarely you will need to modify their default value.
Supports binary ORDER BY collation (
SUPPORTS_ORDERBY_BINARY_COLLATION
): the default value is yes for databases that meet one of the following conditions, when executing an ORDER BY over fields of type text:By default, they use a binary collation to sort the data.
Or, they support forcing a binary collation to perform the ORDER BY.
When the Execution Engine selects a method to execute a join whose conditions involve fields of type text, it selects the method merge if the property “Supports binary ORDER BY collation” is yes in all the sources involved in the query. In that case, the Execution Engine adds the clause
ORDER BY
to the query pushed down to the databases.If the property “Supports binary ORDER BY collation” is no in at least one data source involved in the query, the Execution Engine does not select the merge method to perform the join. The reason is that Virtual DataPort needs to obtain the data from the database sorted with a binary collation.
If the default value of this property is no, do not set it to yes. If the default value is no, it means that the source is not capable of sorting the data using a binary collation.
Delegate ORDER BY collation modifier (
DELEGATE_ORDERBY_COLLATION_MODIFIER
): if yes, theORDER BY
clause is pushed down with a collation modifier. If no, it is pushed down without any modifier.For instance, by default, the clause
ORDER BY <field of type text>
is pushed down to Oracle with the modifierNLSSORT
. E.g.,SELECT ... FROM ... ORDER BY NLSSORT( <field of type text>, 'NLS_SORT = binary') ASC
If this property is no,
ORDER BY
is pushed down without this modifier. E.g.,SELECT ... FROM ... ORDER BY column1 ASC, column2 ASC
If the default value of this property is yes, setting it to no may lead merge joins that obtain data from this source to return incorrect results. The reason is that the merge join algorithm expects the input data to be sorted with a binary collation.
Only set this property to no if the collation modifier is hurting the performance of the query and the collation used by the database sorts the data in the same way as the collation that Virtual DataPort tries to use when this property is yes.
Do not set this property to yes if its default value no. If the default value is no, it means that the source is not capable of sorting the data using a binary collation.
Delegate binary ORDER BY collation (
DELEGATE_BINARY_ORDERBY_COLLATION
): for JDBC data sources that have a default value for this property, you can change it. However, the default collation set for each adapter performs a binary collation, so you should not modify it.If this property does not have a default value, setting a value for this property does not have any effect.
The default value of these three properties is different depending on the database adapter of the JDBC data source.
These properties only affect queries with an ORDER BY
of text
fields. When sorting by other types of values, they are not important
because there are not different ways of sorting long
or int
values for example.