# Dremio JDBC Driver with CONTAINS

**URL:** <https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363>\
**Category:** Uncategorized\
**Created:** [October 12, 2017, 4:53pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363 "2017-10-12T16:53:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felixls](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/felixls/32/208_2.png) [@Felixls](https://community.dremio.com/u/Felixls)\
**Post date:** [October 12, 2017, 4:53pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/1 "2017-10-12T16:53:36Z")

</div>

Dremio JDBC has problems with multiple fields specified on Contains

sqlline

`!connect jdbc:dremio:direct=localhost:31010 master secret com.dremio.jdbc.Driver`

`create view siren.Companies as select * from localES.company.Company where contains(city:*San* or founded_month:*San*);`

```
0: jdbc:dremio:direct=localhost:31010> create view siren.Companies as select * from localES.company.Company where contains(city:*San* or founded_month:*San*);
Error: VALIDATION ERROR: No match found for function signature CONTAINS(<CHARACTER>, <NUMERIC>, <CHARACTER>)

Sql Query SELECT *
FROM "localES"."company"."Company"
WHERE "contains"("city", "founded_month", '$0 : *San* or $1 : *San*')
startLine 3
startColumn 7
endLine 3
endColumn 70

[Error Id: 7deea38b-101e-42bf-9e1d-49ae86cd1b9f on localhost:31010]

  (org.apache.calcite.runtime.CalciteContextException) From line 3, column 7 to line 3, column 70: No match found for function signature CONTAINS(<CHARACTER>, <NUMERIC>, <CHARACTER>)
    sun.reflect.GeneratedConstructorAccessor270.newInstance():-1
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance():45
    java.lang.reflect.Constructor.newInstance():423
    org.apache.calcite.runtime.Resources$ExInstWithCause.ex():463
    org.apache.calcite.sql.SqlUtil.newContextException():798
    org.apache.calcite.sql.SqlUtil.newContextException():786
    org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError():4080
    org.apache.calcite.sql.validate.SqlValidatorImpl.handleUnresolvedFunction():1615
    org.apache.calcite.sql.SqlFunction.deriveType():278
    org.apache.calcite.sql.SqlFunction.deriveType():223
    org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit():4445
    org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit():4432
    org.apache.calcite.sql.SqlCall.accept():137
    org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl():1531
    org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType():1516
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereOrOn():3529
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereClause():3516
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect():3080
    org.apache.calcite.sql.validate.SelectNamespace.validateImpl():60
    org.apache.calcite.sql.validate.AbstractNamespace.validate():84
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace():910
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery():891
    org.apache.calcite.sql.SqlSelect.validate():208
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression():866
    org.apache.calcite.sql.validate.SqlValidatorImpl.validate():577
    com.dremio.exec.planner.sql.SqlConverter.validate():187
    com.dremio.exec.planner.sql.handlers.PrelTransformer.validateNode():167
    com.dremio.exec.planner.sql.handlers.PrelTransformer.validateAndConvert():155
    com.dremio.exec.planner.sql.handlers.query.NormalHandler.getPlan():43
    com.dremio.exec.planner.sql.handlers.commands.HandlerToPreparePlan.plan():85
    com.dremio.exec.work.foreman.AttemptManager.run():306
    java.util.concurrent.ThreadPoolExecutor.runWorker():1149
    java.util.concurrent.ThreadPoolExecutor$Worker.run():624
    java.lang.Thread.run():748
  Caused By (org.apache.calcite.sql.validate.SqlValidatorException) No match found for function signature CONTAINS(<CHARACTER>, <NUMERIC>, <CHARACTER>)
    sun.reflect.GeneratedConstructorAccessor273.newInstance():-1
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance():45
    java.lang.reflect.Constructor.newInstance():423
    org.apache.calcite.runtime.Resources$ExInstWithCause.ex():463
    org.apache.calcite.runtime.Resources$ExInst.ex():572
    org.apache.calcite.sql.SqlUtil.newContextException():798
    org.apache.calcite.sql.SqlUtil.newContextException():786
    org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError():4080
    org.apache.calcite.sql.validate.SqlValidatorImpl.handleUnresolvedFunction():1615
    org.apache.calcite.sql.SqlFunction.deriveType():278
    org.apache.calcite.sql.SqlFunction.deriveType():223
    org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit():4445
    org.apache.calcite.sql.validate.SqlValidatorImpl$DeriveTypeVisitor.visit():4432
    org.apache.calcite.sql.SqlCall.accept():137
    org.apache.calcite.sql.validate.SqlValidatorImpl.deriveTypeImpl():1531
    org.apache.calcite.sql.validate.SqlValidatorImpl.deriveType():1516
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereOrOn():3529
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateWhereClause():3516
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect():3080
    org.apache.calcite.sql.validate.SelectNamespace.validateImpl():60
    org.apache.calcite.sql.validate.AbstractNamespace.validate():84
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace():910
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery():891
    org.apache.calcite.sql.SqlSelect.validate():208
    org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression():866
    org.apache.calcite.sql.validate.SqlValidatorImpl.validate():577
    com.dremio.exec.planner.sql.SqlConverter.validate():187
    com.dremio.exec.planner.sql.handlers.PrelTransformer.validateNode():167
    com.dremio.exec.planner.sql.handlers.PrelTransformer.validateAndConvert():155
    com.dremio.exec.planner.sql.handlers.query.NormalHandler.getPlan():43
    com.dremio.exec.planner.sql.handlers.commands.HandlerToPreparePlan.plan():85
    com.dremio.exec.work.foreman.AttemptManager.run():306
    java.util.concurrent.ThreadPoolExecutor.runWorker():1149
    java.util.concurrent.ThreadPoolExecutor$Worker.run():624
    java.lang.Thread.run():748 (state=,code=0)
0: jdbc:dremio:direct=localhost:31010> 
Error: Statement is already closed. (state=,code=0)
```

---

<div class="post-metadata">

**Author:** ![kelly](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kelly/32/11_2.png) [@kelly](https://community.dremio.com/u/kelly)\
**Post date:** [October 13, 2017, 3:50pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/2 "2017-10-13T15:50:11Z")

</div>

Does this query work from the Dremio SQL console?

Does it work for you without the create view clause? It does for me on 1.2.

Kelly

---

<div class="post-metadata">

**Author:** ![Felixls](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/felixls/32/208_2.png) [@Felixls](https://community.dremio.com/u/Felixls)\
**Post date:** [October 14, 2017, 12:54pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/3 "2017-10-14T12:54:52Z")

</div>

Hi Kelly,  
Yes, on the Dremio UI SQL console works fine (without create view), but fail with JDBC connection (with or without create view).

---

<div class="post-metadata">

**Author:** ![kelly](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/kelly/32/11_2.png) [@kelly](https://community.dremio.com/u/kelly)\
**Post date:** [October 14, 2017, 2:36pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/4 "2017-10-14T14:36:43Z")

</div>

Thanks. We are tracking this and will follow up with additional questions or information about when this issue will be addressed.

---

<div class="post-metadata">

**Author:** ![shachar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/shachar/32/797_2.png) [@shachar](https://community.dremio.com/u/shachar)\
**Post date:** [June 8, 2018, 7:02pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/5 "2018-06-08T19:02:42Z")

</div>

Hi Kelly,

Getting the same issue - classpath is OK  
any insight ?

---

<div class="post-metadata">

**Author:** ![laurent](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/laurent/32/16_2.png) [@laurent](https://community.dremio.com/u/laurent)\
**Post date:** [June 8, 2018, 7:27pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/6 "2018-06-08T19:27:09Z")

</div>

Sorry folks, I missed the thread. Currently it is not possible to create a view using CONTAINS.

---

<div class="post-metadata">

**Author:** ![shachar](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/shachar/32/797_2.png) [@shachar](https://community.dremio.com/u/shachar)\
**Post date:** [June 9, 2018, 6:25pm UTC](https://community.dremio.com/t/dremio-jdbc-driver-with-contains/363/7 "2018-06-09T18:25:08Z")

</div>

No Problem,

The real issue that I had was installing the additional - unix odbc dev package

The ODBC wasn’t connecting on ubuntu without installing only the unix odbc package on ubuntu

Thanks !
