apache / apache/druid

Issue with numerical properties using Avatica JDBC driver

Open
#11,656 1 comment 0 reactions 0 assignees View on GitHub
Area - SQL Bug
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

### Affected Version

Druid 0.21.1
Avatica 1.18.0

### Description

When I send a query via JDBC driver with a numerical property (eg. numParallelCombineThreads), I get a ClassCastException.

This is an example of how I send the query with context property :
```
val properties = new Properties()
properties.setProperty("numParallelCombineThreads", "4")
val connection = DriverManager.getConnection(url, properties)
val statement = connection.createStatement()
val resultSet = statement.executeQuery(query)
```
and the response I get
```
Exception in thread "main" org.apache.calcite.avatica.AvaticaSqlException: Error -1 (00000) : Error while executing SQL "select caseid from "2a03cee0-2511-4ee2-b2e9-0068527fc437" group by caseid": Remote driver error: RuntimeException: java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
```
I also tried with put method, but I get the same error
```
properties.put("numParallelCombineThreads", 4)
```
Requests with string and boolean properties are processed successfully, the problem arise only with numerical values.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the example with Druid 0.21.1 and Avatica 1.18.0, using a numerical context property through DriverManager and executeQuery. Trace how JDBC connection properties reach query context handling; done means numerical properties work without the reported ClassCastException. The issue names no repository file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.