sreemanamala commented on code in PR #16660:
URL: https://github.com/apache/druid/pull/16660#discussion_r1705249059
##########
docs/querying/sql.md:
##########
@@ -409,3 +409,26 @@ To solve this issue, explicitly provide the type of the
dynamic parameter using
```
SELECT * FROM druid.foo WHERE dim1 like CONCAT('%', CAST (? AS VARCHAR), '%')
```
+
+Dynamic parameters can also replace arrays, reducing the parsing time.
+
+for example:
+```json
+{
+ "query": "SELECT doubleArrayColumn from druid.table where
ARRAY_CONTAINS(?, doubleArrayColumn)",
+ "parameters": [
+ {"type":"ARRAY", "value":[-25.7, null, 36.85]}
+ ]
+}
+```
+
+Also, an IN filter being supplied with a lot of values, can be replaced by a
dynamic parameter passed inside
[SCALAR_IN_ARRAY](sql-functions.md#scalar_in_array)
+```json
+{
+ "query": "SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city,
?)",
+ "parameters": [
+ {"type":"ARRAY", "value":["Vienna", "Seoul", "San Francisco"]}
+ ]
+}
+```
Review Comment:
sample code added to `sql-jdbc.md`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]