Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

SUBSTRING() function is 0-indexed #226

@jordanw-bq

Description

@jordanw-bq

Using Docker image amazon/opendistro-for-elasticsearch:1.1.0
Dataset: Flights sample data (loaded through Kibana)
SQL Plugin version: 1.1.0.1

Example Query:
SELECT substring(OriginWeather, 1, 4) FROM kibana_sample_data_flights

Results:

| substring_1 | 
| unn | 
| lea | 
| ain | 
| hun | 
| ama | 
...

Expectation:
The JDBC standard defines the SUBSTRING() function as being 1-indexed (ie. the first character in the string is index 0), and the upper bound as inclusive, so the results should be as shown below:

| substring_1 | 
| Sunn | 
| Clea | 
| Rain | 
| Thun | 
| Dama | 
...

Metadata

Metadata

Assignees

Labels

BI integrationIssues for integration with BI toolsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions